diff options
Diffstat (limited to 'appc-provider')
2 files changed, 1 insertions, 21 deletions
diff --git a/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/lcm/service/DistributeTrafficService.java b/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/lcm/service/DistributeTrafficService.java index 367135265..49b245b8a 100644 --- a/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/lcm/service/DistributeTrafficService.java +++ b/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/lcm/service/DistributeTrafficService.java @@ -37,8 +37,6 @@ import java.util.Map; */ public class DistributeTrafficService extends AbstractBaseService { - - private static final String CONFIG_FILE_NAME_PARAMETER = "ConfigFileName"; private static final String PAYLOAD = "payload"; /** @@ -91,12 +89,7 @@ public class DistributeTrafficService extends AbstractBaseService { try { Map<String, String> payloadMap = JsonUtil.convertJsonStringToFlatMap(payloadString); - // ConfigFileName validation - final String configFileName = payloadMap.get(CONFIG_FILE_NAME_PARAMETER); - if (configFileName == null) { - status = buildStatusForParamName(LCMCommandStatus.MISSING_MANDATORY_PARAMETER, CONFIG_FILE_NAME_PARAMETER); - } - + validateMustHaveParamValue(payloadMap.get(PAYLOAD), PAYLOAD); } catch(IOException e) { logger.error(String.format("DistributeTrafficService (%s) got IOException when converting payload", rpcName), e); status = buildStatusForErrorMsg(LCMCommandStatus.UNEXPECTED_ERROR, e.getMessage()); diff --git a/appc-provider/appc-provider-bundle/src/test/java/org/onap/appc/provider/lcm/service/DistributeTrafficServiceTest.java b/appc-provider/appc-provider-bundle/src/test/java/org/onap/appc/provider/lcm/service/DistributeTrafficServiceTest.java index e0c06f774..671459dd3 100644 --- a/appc-provider/appc-provider-bundle/src/test/java/org/onap/appc/provider/lcm/service/DistributeTrafficServiceTest.java +++ b/appc-provider/appc-provider-bundle/src/test/java/org/onap/appc/provider/lcm/service/DistributeTrafficServiceTest.java @@ -173,17 +173,4 @@ public class DistributeTrafficServiceTest { } - @Test - public void testValidateMissingConfigFileName() throws Exception { - helpInitializeRequestParameters(); - String wrongPayload = "{\"test\":\"test\"}"; - Mockito.doReturn(wrongPayload).when(mockPayload).getValue(); - distributeTrafficService.validate(mockInput); - Status status = (Status) Whitebox.getInternalState(distributeTrafficService, "status"); - assertEquals("should return status null", - Integer.valueOf(LCMCommandStatus.MISSING_MANDATORY_PARAMETER.getResponseCode()), status.getCode()); - } - - - } |