summaryrefslogtreecommitdiffstats
path: root/dcae-analytics/dcae-analytics-tca-web
diff options
context:
space:
mode:
authorKai <lukai@chinamobile.com>2020-01-08 11:02:35 +0800
committerKai <lukai@chinamobile.com>2020-01-08 11:31:28 +0800
commitc7074933aa8d37823fd5865957ea3ab2242e5d03 (patch)
tree71e060f9ae0e9db1a0800c1e0a44e7e9fb5b6961 /dcae-analytics/dcae-analytics-tca-web
parenteac44564ef6a4ca8e7fb9ad05eb76e49f6cf7a7a (diff)
modify checkstyle error for tca test
Issue-ID: DCAEGEN2-2011 Signed-off-by: Kai Lu <lukai@chinamobile.com> Change-Id: Ic62cf14c7a6c2c485aaf506c366d519381784b98
Diffstat (limited to 'dcae-analytics/dcae-analytics-tca-web')
-rw-r--r--dcae-analytics/dcae-analytics-tca-web/src/test/java/org/onap/dcae/analytics/tca/web/controller/TcaRestControllerTest.java7
-rw-r--r--dcae-analytics/dcae-analytics-tca-web/src/test/java/org/onap/dcae/analytics/tca/web/integration/TcaPublisherResponseHandlerTest.java52
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);
- }
+ }
}