diff options
author | Liam Fallon <liam.fallon@est.tech> | 2021-11-22 09:27:23 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-11-22 09:27:23 +0000 |
commit | 226d4c344baa504d90ba7a3a4f3e17733ebc1df8 (patch) | |
tree | ea106a86cb5bf7cdd48a9915ecf84f6420cd84f7 /runtime/src/test/java/org/onap | |
parent | f0a58426aa87795d4fa29eedb5bf2c14f5f6896f (diff) | |
parent | a72ce28fb60c1903ed3ef3da6bb3faac1ae801ba (diff) |
Merge "Added Camel Unit Tests"
Diffstat (limited to 'runtime/src/test/java/org/onap')
2 files changed, 23 insertions, 1 deletions
diff --git a/runtime/src/test/java/org/onap/policy/clamp/clds/it/config/CldsReferencePropertiesItTestCase.java b/runtime/src/test/java/org/onap/policy/clamp/clds/it/config/CldsReferencePropertiesItTestCase.java index eeed51c12..79f3b12d7 100644 --- a/runtime/src/test/java/org/onap/policy/clamp/clds/it/config/CldsReferencePropertiesItTestCase.java +++ b/runtime/src/test/java/org/onap/policy/clamp/clds/it/config/CldsReferencePropertiesItTestCase.java @@ -46,7 +46,7 @@ public class CldsReferencePropertiesItTestCase { */ @Test public void testGetStringValue() { - assertEquals("healthcheck", refProp.getStringValue("policy.api.userName")); + assertEquals("policyadmin", refProp.getStringValue("policy.api.userName")); } /** diff --git a/runtime/src/test/java/org/onap/policy/clamp/runtime/RuntimeInstantiationResponseItTestCase.java b/runtime/src/test/java/org/onap/policy/clamp/runtime/RuntimeInstantiationResponseItTestCase.java index ae80d0498..fdb815d75 100644 --- a/runtime/src/test/java/org/onap/policy/clamp/runtime/RuntimeInstantiationResponseItTestCase.java +++ b/runtime/src/test/java/org/onap/policy/clamp/runtime/RuntimeInstantiationResponseItTestCase.java @@ -41,6 +41,8 @@ public class RuntimeInstantiationResponseItTestCase { private static final String DIRECT_GET_TOSCA_INSTANTIATION = "direct:get-tosca-instantiation"; + private static final String DIRECT_POST_TOSCA_INSTANTANCE_PROPERTIES = "direct:post-tosca-instance-properties"; + private static final String SERVICE_TEMPLATE_NAME = "name"; private static final String SERVICE_TEMPLATE_VERSION = "version"; @@ -51,6 +53,12 @@ public class RuntimeInstantiationResponseItTestCase { + "\"version\": \"1.0.1\",\"definition\": {},\"state\": \"UNINITIALISED\",\"orderedState\": \"UNINITIALISED\"," + "\"description\": \"PMSH control loop instance 0\",\"elements\": {}}]}"; + private static final String SAMPLE_TOSCA_TEMPLATE = + "{\"tosca_definitions_version\": \"tosca_simple_yaml_1_1_0\"," + + "\"data_types\": {},\"node_types\": {}, \"policy_types\": {}," + + " \"topology_template\": {}," + + " \"name\": \"ToscaServiceTemplateSimple\", \"version\": \"1.0.0\", \"metadata\": {}}"; + @Test public void testToscaServiceTemplateStatus() { ProducerTemplate prodTemplate = camelContext.createProducerTemplate(); @@ -93,4 +101,18 @@ public class RuntimeInstantiationResponseItTestCase { assertThat(HttpStatus.valueOf((Integer) exchangeResponse.getIn().getHeader(Exchange.HTTP_RESPONSE_CODE)) .is2xxSuccessful()).isTrue(); } + + @Test + public void testCommissioningOfToscaServiceTemplateStatus() { + ProducerTemplate prodTemplate = camelContext.createProducerTemplate(); + + Exchange exchangeResponse = + prodTemplate.send(DIRECT_POST_TOSCA_INSTANTANCE_PROPERTIES, ExchangeBuilder.anExchange(camelContext) + .withBody(SAMPLE_TOSCA_TEMPLATE) + .withProperty("raiseHttpExceptionFlag", "true") + .build()); + + assertThat(HttpStatus.valueOf((Integer) exchangeResponse.getIn().getHeader(Exchange.HTTP_RESPONSE_CODE)) + .is2xxSuccessful()).isTrue(); + } } |