aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/src/test/java/org/onap
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/src/test/java/org/onap')
-rw-r--r--runtime/src/test/java/org/onap/policy/clamp/runtime/RuntimeCommissioningResponseTestItCase.java47
1 files changed, 47 insertions, 0 deletions
diff --git a/runtime/src/test/java/org/onap/policy/clamp/runtime/RuntimeCommissioningResponseTestItCase.java b/runtime/src/test/java/org/onap/policy/clamp/runtime/RuntimeCommissioningResponseTestItCase.java
index a1eaf27d0..f4e171174 100644
--- a/runtime/src/test/java/org/onap/policy/clamp/runtime/RuntimeCommissioningResponseTestItCase.java
+++ b/runtime/src/test/java/org/onap/policy/clamp/runtime/RuntimeCommissioningResponseTestItCase.java
@@ -147,4 +147,51 @@ public class RuntimeCommissioningResponseTestItCase {
assertThat(HttpStatus.valueOf((Integer) exchangeResponse.getIn().getHeader(Exchange.HTTP_RESPONSE_CODE))
.is2xxSuccessful()).isTrue();
}
+
+ @Test
+ public void testGetCommonOrInstancePropertiesCommonTrue() {
+ ProducerTemplate prodTemplate = camelContext.createProducerTemplate();
+
+ Exchange exchangeResponse =
+ prodTemplate.send("direct:get-common-or-instance-properties", ExchangeBuilder.anExchange(camelContext)
+ .withProperty("name", "ToscaServiceTemplate")
+ .withProperty("version", "1.0.0")
+ .withProperty("common", true)
+ .withProperty("raiseHttpExceptionFlag", "true")
+ .build());
+
+ assertThat(HttpStatus.valueOf((Integer) exchangeResponse.getIn().getHeader(Exchange.HTTP_RESPONSE_CODE))
+ .is2xxSuccessful()).isTrue();
+ }
+
+ @Test
+ public void testGetCommonOrInstancePropertiesCommonFalse() {
+ ProducerTemplate prodTemplate = camelContext.createProducerTemplate();
+
+ Exchange exchangeResponse =
+ prodTemplate.send("direct:get-common-or-instance-properties", ExchangeBuilder.anExchange(camelContext)
+ .withProperty("name", "ToscaServiceTemplate")
+ .withProperty("version", "1.0.0")
+ .withProperty("common", false)
+ .withProperty("raiseHttpExceptionFlag", "true")
+ .build());
+
+ assertThat(HttpStatus.valueOf((Integer) exchangeResponse.getIn().getHeader(Exchange.HTTP_RESPONSE_CODE))
+ .is2xxSuccessful()).isTrue();
+ }
+
+ @Test
+ public void testGetCommonOrInstancePropertiesCommonMissing() {
+ ProducerTemplate prodTemplate = camelContext.createProducerTemplate();
+
+ Exchange exchangeResponse =
+ prodTemplate.send("direct:get-common-or-instance-properties", ExchangeBuilder.anExchange(camelContext)
+ .withProperty("name", "ToscaServiceTemplate")
+ .withProperty("version", "1.0.0")
+ .withProperty("raiseHttpExceptionFlag", "true")
+ .build());
+
+ assertThat(HttpStatus.valueOf((Integer) exchangeResponse.getIn().getHeader(Exchange.HTTP_RESPONSE_CODE))
+ .is2xxSuccessful()).isTrue();
+ }
}