From 4b6371f7ed8e35fd157ea640d05b5898989f32ca Mon Sep 17 00:00:00 2001 From: sebdet Date: Thu, 15 Apr 2021 19:43:27 +0200 Subject: Fix Sonar bugs & sec issues Fix all bugs & sec issues reported by Sonar Issue-ID: POLICY-3200 Signed-off-by: sebdet Change-Id: Ifb3d0d3602586b8defb0826e799ef0e24742235c --- .../clamp/clds/model/dcae/DcaeInventoryResponseCacheTestItCase.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/test') diff --git a/src/test/java/org/onap/policy/clamp/clds/model/dcae/DcaeInventoryResponseCacheTestItCase.java b/src/test/java/org/onap/policy/clamp/clds/model/dcae/DcaeInventoryResponseCacheTestItCase.java index 0e7fe6c7e..f406e5ed2 100644 --- a/src/test/java/org/onap/policy/clamp/clds/model/dcae/DcaeInventoryResponseCacheTestItCase.java +++ b/src/test/java/org/onap/policy/clamp/clds/model/dcae/DcaeInventoryResponseCacheTestItCase.java @@ -37,6 +37,7 @@ import org.junit.runner.RunWith; import org.onap.policy.clamp.clds.Application; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.http.HttpStatus; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @@ -99,7 +100,8 @@ public class DcaeInventoryResponseCacheTestItCase { Exchange exchange = ExchangeBuilder.anExchange(camelContext).build(); Exchange exchangeResponse = camelContext.createProducerTemplate() .send("direct:get-all-dcae-blueprint-inventory", exchange); - assertThat(exchangeResponse.getIn().getHeader("CamelHttpResponseCode")).isEqualTo(200); + assertThat(HttpStatus.valueOf((Integer) exchangeResponse.getIn().getHeader(Exchange.HTTP_RESPONSE_CODE)) + .is2xxSuccessful()).isTrue(); Set blueprint = inventoryCache.getAllBlueprintsPerLoopId("testAsdcServiceId"); assertThat(blueprint.size()).isEqualTo(2); -- cgit 1.2.3-korg