diff options
Diffstat (limited to 'dcae-analytics/dcae-analytics-tca-web/src/test/java/org')
2 files changed, 30 insertions, 29 deletions
diff --git a/dcae-analytics/dcae-analytics-tca-web/src/test/java/org/onap/dcae/analytics/tca/web/controller/TcaRestControllerTest.java b/dcae-analytics/dcae-analytics-tca-web/src/test/java/org/onap/dcae/analytics/tca/web/controller/TcaRestControllerTest.java index 90e0173..04146a3 100644 --- a/dcae-analytics/dcae-analytics-tca-web/src/test/java/org/onap/dcae/analytics/tca/web/controller/TcaRestControllerTest.java +++ b/dcae-analytics/dcae-analytics-tca-web/src/test/java/org/onap/dcae/analytics/tca/web/controller/TcaRestControllerTest.java @@ -33,7 +33,7 @@ import org.onap.dcae.analytics.tca.web.domain.TcaPolicyWrapper; import org.onap.dcae.analytics.tca.web.service.TcaProcessingService; public class TcaRestControllerTest { - + @Test void getTcaPolicyResponseTest() throws Exception { TcaPolicyWrapper tcaPolicyWrapper = Mockito.mock(TcaPolicyWrapper.class); @@ -46,7 +46,7 @@ public class TcaRestControllerTest { restcontroller.getTcaPolicy(); restcontroller.setTcaPolicy(tcaPolicy); } - + @Test void getTcaExecutionResponseTest() throws Exception { TcaPolicyWrapper tcaPolicyWrapper = Mockito.mock(TcaPolicyWrapper.class); @@ -56,7 +56,8 @@ public class TcaRestControllerTest { List<String> cefMessages = Arrays.asList("Test1", "Test2"); TcaPolicy tcaPolicy = Mockito.mock(TcaPolicy.class); List<TcaExecutionContext> executionContexts = Arrays.asList(tcaExecutionContext, tcaExecutionContext); - Mockito.when(tcaProcessingService.getTcaExecutionResults("requestId", "transactioId", tcaPolicy, cefMessages)).thenReturn(executionContexts); + Mockito.when(tcaProcessingService.getTcaExecutionResults("requestId", "transactioId", tcaPolicy, cefMessages)) + .thenReturn(executionContexts); TcaRestController restcontroller = new TcaRestController(tcaProcessingService, tcaPolicyWrapper); restcontroller.execute(tcaExecutionRequest); } diff --git a/dcae-analytics/dcae-analytics-tca-web/src/test/java/org/onap/dcae/analytics/tca/web/integration/TcaPublisherResponseHandlerTest.java b/dcae-analytics/dcae-analytics-tca-web/src/test/java/org/onap/dcae/analytics/tca/web/integration/TcaPublisherResponseHandlerTest.java index 2425041..66043aa 100644 --- a/dcae-analytics/dcae-analytics-tca-web/src/test/java/org/onap/dcae/analytics/tca/web/integration/TcaPublisherResponseHandlerTest.java +++ b/dcae-analytics/dcae-analytics-tca-web/src/test/java/org/onap/dcae/analytics/tca/web/integration/TcaPublisherResponseHandlerTest.java @@ -29,41 +29,41 @@ import org.onap.dcae.analytics.tca.web.TcaAppProperties.Tca; public class TcaPublisherResponseHandlerTest { - static Map<String, Object> headers; + static Map<String, Object> headers; - @BeforeAll - static void initialize() { - headers = new HashMap<>(); - headers.put("X-ECOMP-RequestID", "TestRequestID"); - headers.put("X-ECOMP-TransactionID", "TestTransactionID"); - headers.put("X-ECOMP-FromAppID", "TestFromAppID"); + @BeforeAll + static void initialize() { + headers = new HashMap<>(); + headers.put("X-ECOMP-RequestID", "TestRequestID"); + headers.put("X-ECOMP-TransactionID", "TestTransactionID"); + headers.put("X-ECOMP-FromAppID", "TestFromAppID"); - } + } - @Test - void getHandleLoggingEnabledTest() throws Exception { + @Test + void getHandleLoggingEnabledTest() throws Exception { - TcaAppProperties tcaAppProperties = Mockito.mock(TcaAppProperties.class); - Tca tca = Mockito.mock(Tca.class); - Mockito.when(tcaAppProperties.getTca()).thenReturn(tca); - Mockito.when(tcaAppProperties.getTca().getEnableEcompLogging()).thenReturn(true); + TcaAppProperties tcaAppProperties = Mockito.mock(TcaAppProperties.class); + Tca tca = Mockito.mock(Tca.class); + Mockito.when(tcaAppProperties.getTca()).thenReturn(tca); + Mockito.when(tcaAppProperties.getTca().getEnableEcompLogging()).thenReturn(true); - TcaPublisherResponseHandler responseHandler = new TcaPublisherResponseHandler(tcaAppProperties); - responseHandler.handle("testpayload", headers); + TcaPublisherResponseHandler responseHandler = new TcaPublisherResponseHandler(tcaAppProperties); + responseHandler.handle("testpayload", headers); - } + } - @Test - void getHandleLoggingNotEnabledTest() throws Exception { + @Test + void getHandleLoggingNotEnabledTest() throws Exception { - TcaAppProperties tcaAppProperties = Mockito.mock(TcaAppProperties.class); - Tca tca = Mockito.mock(Tca.class); - Mockito.when(tcaAppProperties.getTca()).thenReturn(tca); - Mockito.when(tcaAppProperties.getTca().getEnableEcompLogging()).thenReturn(false); + TcaAppProperties tcaAppProperties = Mockito.mock(TcaAppProperties.class); + Tca tca = Mockito.mock(Tca.class); + Mockito.when(tcaAppProperties.getTca()).thenReturn(tca); + Mockito.when(tcaAppProperties.getTca().getEnableEcompLogging()).thenReturn(false); - TcaPublisherResponseHandler responseHandler = new TcaPublisherResponseHandler(tcaAppProperties); - responseHandler.handle("testpayload", headers); + TcaPublisherResponseHandler responseHandler = new TcaPublisherResponseHandler(tcaAppProperties); + responseHandler.handle("testpayload", headers); - } + } } |