diff options
author | Joss Armstrong <joss.armstrong@ericsson.com> | 2019-01-23 12:38:05 +0000 |
---|---|---|
committer | Joss Armstrong <joss.armstrong@ericsson.com> | 2019-01-23 12:38:18 +0000 |
commit | 425988fd78defd866d2e02dc9523764be2ec0a51 (patch) | |
tree | 8f33e0de3971d7f2837b124252584598b346d5f0 /appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap | |
parent | 4d39d0e04eabcfb741852c6871a80ac76e40338f (diff) |
Test coverage in interface-services-executorImpl
Increased coverage from 39% to 93%
Issue-ID: APPC-1354
Change-Id: I372be6e61e6041dbf81607d4386fc5123fa5ee79
Signed-off-by: Joss Armstrong <joss.armstrong@ericsson.com>
Diffstat (limited to 'appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap')
5 files changed, 186 insertions, 18 deletions
diff --git a/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaceService/serviceExecutor/TestRequestValidator.java b/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaceService/serviceExecutor/TestRequestValidator.java index 73e45080e..e641b499e 100644 --- a/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaceService/serviceExecutor/TestRequestValidator.java +++ b/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaceService/serviceExecutor/TestRequestValidator.java @@ -3,6 +3,8 @@ * ONAP : APPC * ================================================================================ * Copyright (C) 2018 IBM + * ================================================================================ + * Modifications Copyright (C) 2019 Ericsson * ============================================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,8 +23,6 @@ package org.onap.appc.interfaceService.serviceExecutor; -import static org.junit.Assert.*; - import org.junit.Test; import org.onap.appc.interfaces.service.executor.RequestValidator; diff --git a/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaceService/serviceExecutor/TestServiceExecutor.java b/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaceService/serviceExecutor/TestServiceExecutor.java index 6567a2cce..a81d56db0 100644 --- a/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaceService/serviceExecutor/TestServiceExecutor.java +++ b/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaceService/serviceExecutor/TestServiceExecutor.java @@ -7,6 +7,8 @@ * Copyright (C) 2017 Amdocs * ================================================================================ * Modification Copyright (C) 2018 IBM + * ================================================================================ + * Modifications Copyright (C) 2019 Ericsson * ============================================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,10 +27,9 @@ package org.onap.appc.interfaceService.serviceExecutor; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; import org.junit.Test; - import org.onap.appc.interfaces.service.executorImpl.ServiceExecutorImpl; import org.onap.appc.interfaces.service.data.ScopeOverlap; import org.onap.appc.interfaces.service.executor.ServiceExecutor; @@ -70,7 +71,7 @@ public class TestServiceExecutor { @Test(expected = Exception.class) public void serviceExecutorException() throws Exception { ServiceExecutor sei = new ServiceExecutor(); - String action =""; + String action = ""; String requestDataType = ""; String requestData = "{\"vnf-id\":\"ibcx8888v\",\"current-request\" :{\"action\" : \"Audit\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id\",\"vnf-id\" : \"vnf-id\",\"vnfc-name\" : \"vnfc-name\",\"vf-module-id\" : \"vf-module-id\",\"vserver-id\": \"vserver-id\"}},\"in-progress-requests\" :[{\"action\" : \"HealthCheck\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id1\",\"vnf-id\" : \"vnf-id1\",\"vnfc-name\" : \"vnfc-name1\",\"vf-module-id\" : \"vf-module-id\",\"vserver-id\": \"vserver-id1\"}},{\"action\" : \"CheckLock\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id2\",\"vnf-id\" : \"vnf-id2\",\"vnfc-name\" : \"vnfc-name2\",\"vf-module-id\" : \"vf-module-id2\",\"vserver-id\": \"vserver-id2\"}}]}"; sei.execute(action, requestData, requestDataType); @@ -79,29 +80,29 @@ public class TestServiceExecutor { @Test public void serviceExecutorRequest() throws Exception { ServiceExecutor sei = new ServiceExecutor(); - String action ="isScopeOverlap"; + String action = "isScopeOverlap"; String requestDataType = ""; String requestData = "{\"vnf-id\":\"ibcx8888v\",\"current-request\" :{\"action\" : \"Audit\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id\",\"vnf-id\" : \"vnf-id\",\"vnfc-name\" : \"vnfc-name\",\"vf-module-id\" : \"vf-module-id\",\"vserver-id\": \"vserver-id\"}},\"in-progress-requests\" :[{\"action\" : \"HealthCheck\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id1\",\"vnf-id\" : \"vnf-id1\",\"vnfc-name\" : \"vnfc-name1\",\"vf-module-id\" : \"vf-module-id\",\"vserver-id\": \"vserver-id1\"}},{\"action\" : \"CheckLock\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id2\",\"vnf-id\" : \"vnf-id2\",\"vnfc-name\" : \"vnfc-name2\",\"vf-module-id\" : \"vf-module-id2\",\"vserver-id\": \"vserver-id2\"}}]}"; String actual ="\"requestOverlap\" : true"; String result = sei.execute(action, requestData, requestDataType); - assertEquals(actual,result); + assertEquals(actual, result); } @Test public void serviceExecutorRqsFal() throws Exception { ServiceExecutor sei = new ServiceExecutor(); - String action ="isScopeOverlap"; + String action = "isScopeOverlap"; String requestDataType = ""; String actual ="\"requestOverlap\" : false"; String requestData = "{\"vnf-id\":\"ibcx8888v\",\"current-request\" :{\"action\" : \"Audit\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id\",\"vnf-id\" : \"vnf-id\",\"vnfc-name\" : \"vnfc-name\",\"vf-module-id\" : \"vf-module-id\",\"vserver-id\": \"vserver-id\"}}}"; String result = sei.execute(action, requestData, requestDataType); - assertEquals(actual,result); + assertEquals(actual, result); } @Test(expected = Exception.class) public void serviceExecutorRqstEx() throws Exception { ServiceExecutor sei = new ServiceExecutor(); - String action ="isScopeOverlap"; + String action = "isScopeOverlap"; String requestData = ""; String requestDataType = "{\"vnf-id\":\"ibcx8888v\",\"current-request\" :{\"action\" : \"Audit\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id\"}},\"in-progress-requests\" :[{\"action\" : \"HealthCheck\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id1\",\"vnf-id\" : \"vnf-id1\",\"vnfc-name\" : \"vnfc-name1\",\"vf-module-id\" : \"vf-module-id\",\"vserver-id\": \"vserver-id1\"}},{\"action\" : \"CheckLock\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id2\",\"vnf-id\" : \"vnf-id2\",\"vnfc-name\" : \"vnfc-name2\",\"vf-module-id\" : \"vf-module-id2\",\"vserver-id\": \"vserver-id2\"},\"target-id\":\"ibcx0001v\"}]}"; sei.execute(action, requestData, requestDataType); @@ -114,7 +115,7 @@ public class TestServiceExecutor { ScopeOverlap scopeOverlap = new ScopeOverlap(); ObjectMapper mapper = new ObjectMapper(); scopeOverlap = mapper.readValue(requestData, ScopeOverlap.class); - boolean result = Whitebox.invokeMethod(sei, "isVserverOrVnfcIdOverLap",scopeOverlap); + boolean result = Whitebox.invokeMethod(sei, "isVserverOrVnfcIdOverLap", scopeOverlap); assertEquals(true, result); } @@ -125,7 +126,7 @@ public class TestServiceExecutor { ScopeOverlap scopeOverlap = new ScopeOverlap(); ObjectMapper mapper = new ObjectMapper(); scopeOverlap = mapper.readValue(requestData, ScopeOverlap.class); - boolean result = Whitebox.invokeMethod(sei, "isVserverOrVnfcIdOverLap",scopeOverlap); + boolean result = Whitebox.invokeMethod(sei, "isVserverOrVnfcIdOverLap", scopeOverlap); assertEquals(true, result); } @@ -136,6 +137,6 @@ public class TestServiceExecutor { ScopeOverlap scopeOverlap = new ScopeOverlap(); ObjectMapper mapper = new ObjectMapper(); scopeOverlap = mapper.readValue(requestData, ScopeOverlap.class); - Whitebox.invokeMethod(sei, "isVserverOrVnfcIdOverLap",scopeOverlap); + Whitebox.invokeMethod(sei, "isVserverOrVnfcIdOverLap", scopeOverlap); } } diff --git a/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaces/service/executor/ExecutorExceptionTest.java b/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaces/service/executor/ExecutorExceptionTest.java index 025715910..9e7a96e43 100644 --- a/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaces/service/executor/ExecutorExceptionTest.java +++ b/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaces/service/executor/ExecutorExceptionTest.java @@ -3,6 +3,8 @@ * ONAP : APPC * ================================================================================ * Copyright 2018 TechMahindra +* ================================================================================ +* Modifications Copyright (C) 2019 Ericsson *================================================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,8 +26,9 @@ import org.junit.Test; public class ExecutorExceptionTest { + @Test - public void testConstructorWithMessaqge() throws Exception { + public void testConstructorWithMessage() throws Exception { String message = "testing message"; ExecutorException executorException = new ExecutorException(message); Assert.assertTrue(executorException.getCause() == null); diff --git a/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaces/service/executorImpl/ServiceExecutorImplTest.java b/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaces/service/executorImpl/ServiceExecutorImplTest.java new file mode 100644 index 000000000..6cdca796b --- /dev/null +++ b/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaces/service/executorImpl/ServiceExecutorImplTest.java @@ -0,0 +1,165 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : APPC + * ================================================================================ + * Copyright (C) 2019 Ericsson + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END========================================================= + */ + +package org.onap.appc.interfaces.service.executorImpl; + +import static org.junit.Assert.assertEquals; +import java.util.ArrayList; +import java.util.List; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.mockito.Mockito; +import org.onap.appc.aai.client.aai.AaiService; +import org.onap.appc.interfaces.service.data.Request; +import org.onap.appc.interfaces.service.data.ScopeOverlap; +import org.onap.ccsdk.sli.adaptors.aai.AAIClient; +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class ServiceExecutorImplTest { + + private ServiceExecutorImpl executor; + + @Rule + public ExpectedException expectedEx = ExpectedException.none(); + + @Test + public void testScopeOverlapEmpty() throws Exception { + executor = Mockito.spy(new ServiceExecutorImpl()); + ScopeOverlap scopeOverlap = Mockito.spy(new ScopeOverlap()); + List<Request> emptyList = new ArrayList<Request>(); + Mockito.doReturn(emptyList).when(scopeOverlap).getInProgressRequest(); + ObjectMapper objectMapper = Mockito.spy(new ObjectMapper()); + Mockito.doReturn(objectMapper).when(executor).getObjectMapper(); + Mockito.doReturn(scopeOverlap).when(objectMapper).readValue("{}", ScopeOverlap.class); + assertEquals("\"requestOverlap\" : false", executor.isRequestOverLap("{}")); + } + + @Test + public void testScopeOverlapWithVnfIdInCurrentRequest() throws Exception { + executor = Mockito.spy(new ServiceExecutorImpl()); + String requestData = "{\"current-request\" :{\"action\" : \"Audit\",\"action-identifiers\" : {\"service-instance-id\" :" + + " \"service-instance-id\",\"vnf-id\" : \"vnf-id\",\"vnfc-name\" : \"vnfc-name\",\"vf-module-id\" : \"vf-module-id\"," + + "\"vserver-id\": \"vserver-id\"}},\"in-progress-requests\" :[{\"action\" : \"HealthCheck\",\"action-identifiers\" :" + + " {\"service-instance-id\" : \"service-instance-id1\",\"vnf-id\" : \"vnf-id1\",\"vnfc-name\" : \"vnfc-name1\",\"vf-module-id\" :" + + " \"vf-module-id\",\"vserver-id\": \"vserver-id1\"}},{\"action\" : \"CheckLock\",\"action-identifiers\" : {\"service-instance-id\" :" + + " \"service-instance-id2\",\"vnf-id\" : \"vnf-id2\",\"vnfc-name\" : \"vnfc-name2\",\"vf-module-id\" : \"vf-module-id2\",\"vserver-id\":" + + " \"vserver-id2\"}}]}"; + assertEquals("\"requestOverlap\" : true", executor.isRequestOverLap(requestData)); + } + + @Test + public void testScopeOverlapWithoutVnfIdButWithVfModuleIdCurrentRequest() throws Exception { + executor = Mockito.spy(new ServiceExecutorImpl()); + String requestData = "{\"current-request\" :{\"action\" : \"Audit\",\"action-identifiers\" : {\"service-instance-id\" :" + + " \"service-instance-id\",\"vnfc-name\" : \"vnfc-name\",\"vf-module-id\" : \"vf-module-id\"," + + "\"vserver-id\": \"vserver-id\"}},\"in-progress-requests\" :[{\"action\" : \"HealthCheck\",\"action-identifiers\" :" + + " {\"service-instance-id\" : \"service-instance-id1\",\"vnfc-name\" : \"vnfc-name1\",\"vf-module-id\" :" + + " \"vf-module-id\",\"vserver-id\": \"vserver-id1\"}},{\"action\" : \"CheckLock\",\"action-identifiers\" : {\"service-instance-id\" :" + + " \"service-instance-id2\",\"vnfc-name\" : \"vnfc-name2\",\"vf-module-id\" : \"vf-module-id2\",\"vserver-id\":" + + " \"vserver-id2\"}}]}"; + assertEquals("\"requestOverlap\" : true", executor.isRequestOverLap(requestData)); + } + + @Test + public void testScopeOverlapWithVnfIdAndInProgressRequest() throws Exception { + executor = Mockito.spy(new ServiceExecutorImpl()); + String requestData = "{\"vnf-id\":\"vnf-id1\",\"current-request\" :{\"action\" : \"Audit\",\"action-identifiers\" : {\"service-instance-id\" :" + + " \"service-instance-id\",\"vnfc-name\" : \"vnfc-name\",\"vf-module-id\" : \"vf-module-id\"," + + "\"vserver-id\": \"vserver-id\"}},\"in-progress-requests\" : [{\"target-id\": \"vnf-id1\",\"action\" : \"HealthCheck\",\"action-identifiers\" :" + + " {\"service-instance-id\" : \"service-instance-id1\",\"vnfc-name\" : \"vnfc-name1\",\"vf-module-id\" :" + + " \"vf-module-id\",\"vserver-id\": \"vserver-id1\"}},{\"action\" : \"CheckLock\",\"action-identifiers\" : {\"service-instance-id\" :" + + " \"service-instance-id2\",\"vnfc-name\" : \"vnfc-name2\",\"vf-module-id\" : \"vf-module-id2\",\"vserver-id\":" + + " \"vserver-id2\"}}]}"; + assertEquals("\"requestOverlap\" : true", executor.isRequestOverLap(requestData)); + } + + @Test + public void testScopeOverlapWithVserverIdAndInProgressRequest() throws Exception { + executor = Mockito.spy(new ServiceExecutorImpl()); + String requestData = "{\"vnf-id\":\"\",\"current-request\" :{\"action\" : \"Audit\",\"action-identifiers\" : {\"service-instance-id\" :" + + " \"service-instance-id\",\"vnfc-name\" : \"vnfc-name\",\"vserver-id\": \"vserver-id\"}},\"in-progress-requests\" :" + + " [{\"target-id\": \"vnf-id1\",\"action\" : \"HealthCheck\",\"action-identifiers\" : {\"service-instance-id\" :" + + " \"service-instance-id1\",\"vnfc-name\" : \"vnfc-name1\",\"vserver-id\": \"vserver-id1\"}},{\"action\" :" + + " \"CheckLock\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id2\",\"vnfc-name\" :" + + " \"vnfc-name2\",\"vserver-id\": \"vserver-id2\"}}]}"; + AaiService aaiServiceMock = Mockito.mock(AaiService.class); + Mockito.doReturn(aaiServiceMock).when(executor).getAaiService(Mockito.any(AAIClient.class)); + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("vm-count", "1"); + Mockito.doReturn(ctx).when(executor).getSvcLogicContext(); + assertEquals("\"requestOverlap\" : false", executor.isRequestOverLap(requestData)); + } + + @Test + public void testScopeOverlapWithNoVnfcNameInCurrentRequest() throws Exception { + executor = Mockito.spy(new ServiceExecutorImpl()); + String requestData = "{\"vnf-id\":\"\",\"current-request\" :{\"action\" : \"Audit\",\"action-identifiers\" : {\"service-instance-id\" :" + + " \"service-instance-id\",\"vserver-id\": \"vserver-id\"}},\"in-progress-requests\" :" + + " [{\"target-id\": \"vnf-id1\",\"action\" : \"HealthCheck\",\"action-identifiers\" : {\"service-instance-id\" :" + + " \"service-instance-id1\",\"vnfc-name\" : \"vnfc-name1\",\"vserver-id\": \"vserver-id1\"}},{\"action\" :" + + " \"CheckLock\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id2\",\"vnfc-name\" :" + + " \"vnfc-name2\",\"vserver-id\": \"vserver-id2\"}}]}"; + AaiService aaiServiceMock = Mockito.mock(AaiService.class); + Mockito.doReturn(aaiServiceMock).when(executor).getAaiService(Mockito.any(AAIClient.class)); + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("vm-count", "1"); + Mockito.doReturn(ctx).when(executor).getSvcLogicContext(); + assertEquals("\"requestOverlap\" : false", executor.isRequestOverLap(requestData)); + } + + @Test + public void testScopeOverlapWithVnfcNameAndInProgressRequest() throws Exception { + executor = Mockito.spy(new ServiceExecutorImpl()); + String requestData = "{\"vnf-id\":\"\",\"current-request\" :{\"action\" : \"Audit\",\"action-identifiers\" : {\"service-instance-id\" :" + + " \"service-instance-id\",\"vnfc-name\" : \"vnfc-name\"}},\"in-progress-requests\" :" + + " [{\"target-id\": \"vnf-id1\",\"action\" : \"HealthCheck\",\"action-identifiers\" : {\"service-instance-id\" :" + + " \"service-instance-id1\",\"vnfc-name\" : \"vnfc-name1\",\"vserver-id\": \"vserver-id1\"}},{\"action\" :" + + " \"CheckLock\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id2\",\"vnfc-name\" :" + + " \"vnfc-name2\",\"vserver-id\": \"vserver-id2\"}}]}"; + AaiService aaiServiceMock = Mockito.mock(AaiService.class); + Mockito.doReturn(aaiServiceMock).when(executor).getAaiService(Mockito.any(AAIClient.class)); + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("vm-count", "1"); + Mockito.doReturn(ctx).when(executor).getSvcLogicContext(); + assertEquals("\"requestOverlap\" : false", executor.isRequestOverLap(requestData)); + } + + @Test + public void testScopeOverlapExceptionFlow() throws Exception { + executor = Mockito.spy(new ServiceExecutorImpl()); + String requestData = "{\"vnf-id\":\"\",\"current-request\" :{\"action\" : \"Audit\",\"action-identifiers\" : {\"service-instance-id\" :" + + " \"service-instance-id\"}},\"in-progress-requests\" :" + + " [{\"target-id\": \"vnf-id1\",\"action\" : \"HealthCheck\",\"action-identifiers\" : {\"service-instance-id\" :" + + " \"service-instance-id1\",\"vnfc-name\" : \"vnfc-name1\",\"vserver-id\": \"vserver-id1\"}},{\"action\" :" + + " \"CheckLock\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id2\",\"vnfc-name\" :" + + " \"vnfc-name2\",\"vserver-id\": \"vserver-id2\"}}]}"; + AaiService aaiServiceMock = Mockito.mock(AaiService.class); + Mockito.doReturn(aaiServiceMock).when(executor).getAaiService(Mockito.any(AAIClient.class)); + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("vm-count", "1"); + Mockito.doReturn(ctx).when(executor).getSvcLogicContext(); + expectedEx.expect(Exception.class); + expectedEx.expectMessage(" Action Identifier doesn't have VnfId, VfModuleId, VServerId, VnfcName "); + executor.isRequestOverLap(requestData); + } +} diff --git a/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaces/service/utils/ServiceConstantsTest.java b/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaces/service/utils/ServiceConstantsTest.java index 9367a4420..64d150a52 100644 --- a/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaces/service/utils/ServiceConstantsTest.java +++ b/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaces/service/utils/ServiceConstantsTest.java @@ -3,6 +3,8 @@ * ONAP : APPC * ================================================================================ * Copyright 2018 TechMahindra +* ================================================================================ +* Modifications Copyright (C) 2019 Ericsson *================================================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,12 +26,9 @@ import org.junit.Test; public class ServiceConstantsTest { - private ServiceConstants serviceConstants=new ServiceConstants(); @Test public void testServiceConstants() { - Assert.assertEquals("action-identifiers",serviceConstants.ACTIONIDENTIFIER); - Assert.assertNotNull(serviceConstants.ACTIONIDENTIFIER); - + Assert.assertEquals("action-identifiers", ServiceConstants.ACTIONIDENTIFIER); } } |