From 9d5d128ac706722b4f7495edf0f2515f338b7121 Mon Sep 17 00:00:00 2001 From: Lathish Date: Wed, 22 Jan 2020 15:05:25 +0000 Subject: Fixed the Response code to Response Message Issue-ID: CCSDK-1888 Change-Id: I2b5cc38ccf755a03dfa94337601f14888fa0b108 Signed-off-by: Lathish --- .../northbound/a1Adapter/A1AdapterProvider.java | 24 ++++++++++----------- .../a1Adapter/A1AdapterProviderTest.java | 25 +++++++++++----------- 2 files changed, 24 insertions(+), 25 deletions(-) (limited to 'sdnr/northbound/a1Adapter/provider/src') diff --git a/sdnr/northbound/a1Adapter/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/a1Adapter/A1AdapterProvider.java b/sdnr/northbound/a1Adapter/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/a1Adapter/A1AdapterProvider.java index 9e6e59391..b10177d8f 100644 --- a/sdnr/northbound/a1Adapter/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/a1Adapter/A1AdapterProvider.java +++ b/sdnr/northbound/a1Adapter/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/a1Adapter/A1AdapterProvider.java @@ -207,7 +207,7 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService { LOG.error("Returned FAILED for " + svcOperation + " error code: '" + errorCode + "'"); } else { LOG.info("Returned SUCCESS for " + svcOperation + " "); - serviceDataBuilder.setResponseCode("A1 Adapter Executed for GetNearRTRICs "); + serviceDataBuilder.setResponseMessage("A1 Adapter Executed for GetNearRTRICs "); } RpcResult rpcResult = @@ -277,7 +277,7 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService { LOG.error("Returned FAILED for " + svcOperation + " error code: '" + errorCode + "'"); } else { LOG.info("Returned SUCCESS for " + svcOperation + " "); - serviceDataBuilder.setResponseCode("A1 Adapter Executed for GetHealthCheck. "); + serviceDataBuilder.setResponseMessage("A1 Adapter Executed for GetHealthCheck. "); } RpcResult rpcResult = @@ -347,7 +347,7 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService { LOG.error("Returned FAILED for " + svcOperation + " error code: '" + errorCode + "'"); } else { LOG.info("Returned SUCCESS for " + svcOperation + " "); - serviceDataBuilder.setResponseCode("A1 Adapter Executed for GetPolicyTypes "); + serviceDataBuilder.setResponseMessage("A1 Adapter Executed for GetPolicyTypes "); } RpcResult rpcResult = @@ -418,7 +418,7 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService { LOG.error("Returned FAILED for " + svcOperation + " error code: '" + errorCode + "'"); } else { LOG.info("Returned SUCCESS for " + svcOperation + " "); - serviceDataBuilder.setResponseCode("A1 Adapter Executed for CreatePolicyType"); + serviceDataBuilder.setResponseMessage("A1 Adapter Executed for CreatePolicyType"); } RpcResult rpcResult = @@ -488,7 +488,7 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService { LOG.error("Returned FAILED for " + svcOperation + " error code: '" + errorCode + "'"); } else { LOG.info("Returned SUCCESS for " + svcOperation + " "); - serviceDataBuilder.setResponseCode("A1 Adapter Executed for GetPolicyType. "); + serviceDataBuilder.setResponseMessage("A1 Adapter Executed for GetPolicyType. "); } RpcResult rpcResult = @@ -559,7 +559,7 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService { LOG.error("Returned FAILED for " + svcOperation + " error code: '" + errorCode + "'"); } else { LOG.info("Returned SUCCESS for " + svcOperation + " "); - serviceDataBuilder.setResponseCode("A1 Adapter Executed for DeletePolicyType "); + serviceDataBuilder.setResponseMessage("A1 Adapter Executed for DeletePolicyType "); } RpcResult rpcResult = @@ -630,7 +630,7 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService { LOG.error("Returned FAILED for " + svcOperation + " error code: '" + errorCode + "'"); } else { LOG.info("Returned SUCCESS for " + svcOperation + " "); - serviceDataBuilder.setResponseCode("A1 Adapter Executed for GetPolicyInstances "); + serviceDataBuilder.setResponseMessage("A1 Adapter Executed for GetPolicyInstances "); } RpcResult rpcResult = @@ -703,7 +703,7 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService { LOG.error("Returned FAILED for " + svcOperation + " error code: '" + errorCode + "'"); } else { LOG.info("Returned SUCCESS for " + svcOperation + " "); - serviceDataBuilder.setResponseCode("A1 Adapter Executed for CreatePolicyInstance. "); + serviceDataBuilder.setResponseMessage("A1 Adapter Executed for CreatePolicyInstance. "); } RpcResult rpcResult = RpcResultBuilder.status(true) @@ -776,7 +776,7 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService { LOG.error("Returned FAILED for " + svcOperation + " error code: '" + errorCode + "'"); } else { LOG.info("Returned SUCCESS for " + svcOperation + " "); - serviceDataBuilder.setResponseCode("A1 Adapter Executed for GetPolicyInstance. "); + serviceDataBuilder.setResponseMessage("A1 Adapter Executed for GetPolicyInstance. "); } RpcResult rpcResult = @@ -850,7 +850,7 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService { LOG.error("Returned FAILED for " + svcOperation + " error code: '" + errorCode + "'"); } else { LOG.info("Returned SUCCESS for " + svcOperation + " "); - serviceDataBuilder.setResponseCode("A1 Adapter Executed for DeletePolicyInstance. "); + serviceDataBuilder.setResponseMessage("A1 Adapter Executed for DeletePolicyInstance. "); } RpcResult rpcResult = RpcResultBuilder.status(true) @@ -922,7 +922,7 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService { LOG.error("Returned FAILED for " + svcOperation + " error code: '" + errorCode + "'"); } else { LOG.info("Returned SUCCESS for " + svcOperation + " "); - serviceDataBuilder.setResponseCode("A1 Adapter Executed for GetStatus. "); + serviceDataBuilder.setResponseMessage("A1 Adapter Executed for GetStatus. "); } RpcResult rpcResult = @@ -995,7 +995,7 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService { LOG.error("Returned FAILED for " + svcOperation + " error code: '" + errorCode + "'"); } else { LOG.info("Returned SUCCESS for " + svcOperation + " "); - serviceDataBuilder.setResponseCode("A1 Adapter Executed for notifyPolicyEnforcementUpdate. "); + serviceDataBuilder.setResponseMessage("A1 Adapter Executed for notifyPolicyEnforcementUpdate. "); } RpcResult rpcResult = RpcResultBuilder diff --git a/sdnr/northbound/a1Adapter/provider/src/test/java/org/onap/ccsdk/features/sdnr/northbound/a1Adapter/A1AdapterProviderTest.java b/sdnr/northbound/a1Adapter/provider/src/test/java/org/onap/ccsdk/features/sdnr/northbound/a1Adapter/A1AdapterProviderTest.java index c5bdb99f7..fa8a82c8f 100644 --- a/sdnr/northbound/a1Adapter/provider/src/test/java/org/onap/ccsdk/features/sdnr/northbound/a1Adapter/A1AdapterProviderTest.java +++ b/sdnr/northbound/a1Adapter/provider/src/test/java/org/onap/ccsdk/features/sdnr/northbound/a1Adapter/A1AdapterProviderTest.java @@ -21,7 +21,6 @@ package org.onap.ccsdk.features.sdnr.northbound.a1Adapter; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.when; @@ -148,7 +147,7 @@ public class A1AdapterProviderTest { when(a1AdapterProviderMock.getServiceData(rpc)).thenReturn((Builder) nearRTRICsOutputBuilder); ListenableFuture> result = a1AdapterProviderMock.getNearRTRICs(inputBuilder.build()); - assertNotNull(result.get().getResult().getResponseCode()); + assertEquals("200",result.get().getResult().getResponseCode()); } @Test @@ -215,7 +214,7 @@ public class A1AdapterProviderTest { any(Properties.class))).thenReturn(respProps); ListenableFuture> result = a1AdapterProviderMock.getHealthCheck(inputBuilder.build()); - assertNotNull(result.get().getResult().getResponseCode()); + assertEquals("200",result.get().getResult().getResponseCode()); } @Test @@ -282,7 +281,7 @@ public class A1AdapterProviderTest { eq(null))).thenReturn(respProps); ListenableFuture> result = a1AdapterProviderMock.getPolicyTypes(inputBuilder.build()); - assertNotNull(result.get().getResult().getResponseCode()); + assertEquals("200",result.get().getResult().getResponseCode()); } @Test @@ -349,7 +348,7 @@ public class A1AdapterProviderTest { eq(null))).thenReturn(respProps); ListenableFuture> result = a1AdapterProviderMock.createPolicyType(inputBuilder.build()); - assertNotNull(result.get().getResult().getResponseCode()); + assertEquals("200",result.get().getResult().getResponseCode()); } @Test @@ -417,7 +416,7 @@ public class A1AdapterProviderTest { eq(null))).thenReturn(respProps); ListenableFuture> result = a1AdapterProviderMock.getPolicyType(inputBuilder.build()); - assertNotNull(result.get().getResult().getResponseCode()); + assertEquals("200",result.get().getResult().getResponseCode()); } @Test @@ -484,7 +483,7 @@ public class A1AdapterProviderTest { eq(null))).thenReturn(respProps); ListenableFuture> result = a1AdapterProviderMock.deletePolicyType(inputBuilder.build()); - assertNotNull(result.get().getResult().getResponseCode()); + assertEquals("200",result.get().getResult().getResponseCode()); } @Test @@ -552,7 +551,7 @@ public class A1AdapterProviderTest { eq(null))).thenReturn(respProps); ListenableFuture> result = a1AdapterProviderMock.getPolicyInstances(inputBuilder.build()); - assertNotNull(result.get().getResult().getResponseCode()); + assertEquals("200",result.get().getResult().getResponseCode()); } @Test @@ -621,7 +620,7 @@ public class A1AdapterProviderTest { any(CreatePolicyInstanceOutputBuilder.class), eq(null))).thenReturn(respProps); ListenableFuture> result = a1AdapterProviderMock.createPolicyInstance(inputBuilder.build()); - assertNotNull(result.get().getResult().getResponseCode()); + assertEquals("200",result.get().getResult().getResponseCode()); } @Test @@ -691,7 +690,7 @@ public class A1AdapterProviderTest { eq(null))).thenReturn(respProps); ListenableFuture> result = a1AdapterProviderMock.getPolicyInstance(inputBuilder.build()); - assertNotNull(result.get().getResult().getResponseCode()); + assertEquals("200",result.get().getResult().getResponseCode()); } @Test @@ -759,7 +758,7 @@ public class A1AdapterProviderTest { eq(null))).thenReturn(respProps); ListenableFuture> result = a1AdapterProviderMock.deletePolicyInstance(inputBuilder.build()); - assertNotNull(result.get().getResult().getResponseCode()); + assertEquals("200",result.get().getResult().getResponseCode()); } @Test @@ -826,7 +825,7 @@ public class A1AdapterProviderTest { when(a1AdapterClient.execute(eq(module), eq(rpc), eq(null), eq(mode), any(GetPolicyTypeOutputBuilder.class), eq(null))).thenReturn(respProps); ListenableFuture> result = a1AdapterProviderMock.getStatus(inputBuilder.build()); - assertNotNull(result.get().getResult().getResponseCode()); + assertEquals("200",result.get().getResult().getResponseCode()); } @Test @@ -845,7 +844,7 @@ public class A1AdapterProviderTest { eq(null))).thenReturn(respProps); ListenableFuture> result = a1AdapterProviderMock.notifyPolicyEnforcementUpdate(inputBuilder.build()); - assertNotNull(result.get().getResult().getResponseCode()); + assertEquals("200",result.get().getResult().getResponseCode()); } -- cgit 1.2.3-korg