@Test public final void testGetResult() throws PolicyException { service.getValidation(); String result = service.getResult(false); assertEquals("success", result); }
public String getResult(boolean updateFlag) throws PolicyException { String response = null; String operation = null; if (updateFlag) { operation = "update"; } else { operation = "create"; } String uuid = null; String msLocation = null; String configName = null; String microService = null; String policyDescription = null; String priority = null; String version = null; if (microServiceAttributes.get("service") != null) { microService = microServiceAttributes.get("service").toString().replace("\"", ""); } if (microServiceAttributes.get("uuid") != null) { uuid = microServiceAttributes.get("uuid").toString().replace("\"", ""); } if (microServiceAttributes.get("location") != null) { msLocation = microServiceAttributes.get("location").toString().replace("\"", ""); } if (microServiceAttributes.get("configName") != null) { configName = microServiceAttributes.get("configName").toString().replace("\"", ""); } if (microServiceAttributes.containsKey("description")) { policyDescription = microServiceAttributes.get("description").toString().replace("\"", ""); } if (microServiceAttributes.containsKey("priority")) { priority = microServiceAttributes.get("priority").toString().replace("\"", ""); } if (microServiceAttributes.containsKey("version")) { version = microServiceAttributes.get("version").toString().replace("\"", ""); } StdPAPPolicy newPAPPolicy = new StdPAPPolicy( StdPAPPolicyParams.builder().configPolicyType("Micro Service") .policyName(policyName) .description(policyDescription) .onapName(onapName) .configName(configName) .serviceType(microService) .uuid(uuid) .msLocation(msLocation) .jsonBody(microServiceAttributes.toString()) .priority(priority) .version(version) .editPolicy(updateFlag) .domain(policyScope) .highestVersion(0) .riskLevel(policyParameters.getRiskLevel()) .riskType(policyParameters.getRiskType()) .guard(String.valueOf(policyParameters.getGuard())) .ttlDate(date) .build()); response = (String) papServices.callPAP(newPAPPolicy, new String[]{"operation=" + operation, "apiflag=api", "policyType=Config"}, policyParameters.getRequestID(), "ConfigMS"); LOGGER.info("Policy MS created Response: " + response); return response; }
MicroServicesPolicyService { public String getResult(boolean updateFlag) throws PolicyException { String response = null; String operation = null; if (updateFlag) { operation = "update"; } else { operation = "create"; } String uuid = null; String msLocation = null; String configName = null; String microService = null; String policyDescription = null; String priority = null; String version = null; if (microServiceAttributes.get("service") != null) { microService = microServiceAttributes.get("service").toString().replace("\"", ""); } if (microServiceAttributes.get("uuid") != null) { uuid = microServiceAttributes.get("uuid").toString().replace("\"", ""); } if (microServiceAttributes.get("location") != null) { msLocation = microServiceAttributes.get("location").toString().replace("\"", ""); } if (microServiceAttributes.get("configName") != null) { configName = microServiceAttributes.get("configName").toString().replace("\"", ""); } if (microServiceAttributes.containsKey("description")) { policyDescription = microServiceAttributes.get("description").toString().replace("\"", ""); } if (microServiceAttributes.containsKey("priority")) { priority = microServiceAttributes.get("priority").toString().replace("\"", ""); } if (microServiceAttributes.containsKey("version")) { version = microServiceAttributes.get("version").toString().replace("\"", ""); } StdPAPPolicy newPAPPolicy = new StdPAPPolicy( StdPAPPolicyParams.builder().configPolicyType("Micro Service") .policyName(policyName) .description(policyDescription) .onapName(onapName) .configName(configName) .serviceType(microService) .uuid(uuid) .msLocation(msLocation) .jsonBody(microServiceAttributes.toString()) .priority(priority) .version(version) .editPolicy(updateFlag) .domain(policyScope) .highestVersion(0) .riskLevel(policyParameters.getRiskLevel()) .riskType(policyParameters.getRiskType()) .guard(String.valueOf(policyParameters.getGuard())) .ttlDate(date) .build()); response = (String) papServices.callPAP(newPAPPolicy, new String[]{"operation=" + operation, "apiflag=api", "policyType=Config"}, policyParameters.getRequestID(), "ConfigMS"); LOGGER.info("Policy MS created Response: " + response); return response; } }
MicroServicesPolicyService { public String getResult(boolean updateFlag) throws PolicyException { String response = null; String operation = null; if (updateFlag) { operation = "update"; } else { operation = "create"; } String uuid = null; String msLocation = null; String configName = null; String microService = null; String policyDescription = null; String priority = null; String version = null; if (microServiceAttributes.get("service") != null) { microService = microServiceAttributes.get("service").toString().replace("\"", ""); } if (microServiceAttributes.get("uuid") != null) { uuid = microServiceAttributes.get("uuid").toString().replace("\"", ""); } if (microServiceAttributes.get("location") != null) { msLocation = microServiceAttributes.get("location").toString().replace("\"", ""); } if (microServiceAttributes.get("configName") != null) { configName = microServiceAttributes.get("configName").toString().replace("\"", ""); } if (microServiceAttributes.containsKey("description")) { policyDescription = microServiceAttributes.get("description").toString().replace("\"", ""); } if (microServiceAttributes.containsKey("priority")) { priority = microServiceAttributes.get("priority").toString().replace("\"", ""); } if (microServiceAttributes.containsKey("version")) { version = microServiceAttributes.get("version").toString().replace("\"", ""); } StdPAPPolicy newPAPPolicy = new StdPAPPolicy( StdPAPPolicyParams.builder().configPolicyType("Micro Service") .policyName(policyName) .description(policyDescription) .onapName(onapName) .configName(configName) .serviceType(microService) .uuid(uuid) .msLocation(msLocation) .jsonBody(microServiceAttributes.toString()) .priority(priority) .version(version) .editPolicy(updateFlag) .domain(policyScope) .highestVersion(0) .riskLevel(policyParameters.getRiskLevel()) .riskType(policyParameters.getRiskType()) .guard(String.valueOf(policyParameters.getGuard())) .ttlDate(date) .build()); response = (String) papServices.callPAP(newPAPPolicy, new String[]{"operation=" + operation, "apiflag=api", "policyType=Config"}, policyParameters.getRequestID(), "ConfigMS"); LOGGER.info("Policy MS created Response: " + response); return response; } MicroServicesPolicyService(String policyName, String policyScope, PolicyParameters policyParameters,
                                      String date); }
MicroServicesPolicyService { public String getResult(boolean updateFlag) throws PolicyException { String response = null; String operation = null; if (updateFlag) { operation = "update"; } else { operation = "create"; } String uuid = null; String msLocation = null; String configName = null; String microService = null; String policyDescription = null; String priority = null; String version = null; if (microServiceAttributes.get("service") != null) { microService = microServiceAttributes.get("service").toString().replace("\"", ""); } if (microServiceAttributes.get("uuid") != null) { uuid = microServiceAttributes.get("uuid").toString().replace("\"", ""); } if (microServiceAttributes.get("location") != null) { msLocation = microServiceAttributes.get("location").toString().replace("\"", ""); } if (microServiceAttributes.get("configName") != null) { configName = microServiceAttributes.get("configName").toString().replace("\"", ""); } if (microServiceAttributes.containsKey("description")) { policyDescription = microServiceAttributes.get("description").toString().replace("\"", ""); } if (microServiceAttributes.containsKey("priority")) { priority = microServiceAttributes.get("priority").toString().replace("\"", ""); } if (microServiceAttributes.containsKey("version")) { version = microServiceAttributes.get("version").toString().replace("\"", ""); } StdPAPPolicy newPAPPolicy = new StdPAPPolicy( StdPAPPolicyParams.builder().configPolicyType("Micro Service") .policyName(policyName) .description(policyDescription) .onapName(onapName) .configName(configName) .serviceType(microService) .uuid(uuid) .msLocation(msLocation) .jsonBody(microServiceAttributes.toString()) .priority(priority) .version(version) .editPolicy(updateFlag) .domain(policyScope) .highestVersion(0) .riskLevel(policyParameters.getRiskLevel()) .riskType(policyParameters.getRiskType()) .guard(String.valueOf(policyParameters.getGuard())) .ttlDate(date) .build()); response = (String) papServices.callPAP(newPAPPolicy, new String[]{"operation=" + operation, "apiflag=api", "policyType=Config"}, policyParameters.getRequestID(), "ConfigMS"); LOGGER.info("Policy MS created Response: " + response); return response; } MicroServicesPolicyService(String policyName, String policyScope, PolicyParameters policyParameters,
                                      String date); Boolean getValidation(); String getMessage(); String getResult(boolean updateFlag); }
MicroServicesPolicyService { public String getResult(boolean updateFlag) throws PolicyException { String response = null; String operation = null; if (updateFlag) { operation = "update"; } else { operation = "create"; } String uuid = null; String msLocation = null; String configName = null; String microService = null; String policyDescription = null; String priority = null; String version = null; if (microServiceAttributes.get("service") != null) { microService = microServiceAttributes.get("service").toString().replace("\"", ""); } if (microServiceAttributes.get("uuid") != null) { uuid = microServiceAttributes.get("uuid").toString().replace("\"", ""); } if (microServiceAttributes.get("location") != null) { msLocation = microServiceAttributes.get("location").toString().replace("\"", ""); } if (microServiceAttributes.get("configName") != null) { configName = microServiceAttributes.get("configName").toString().replace("\"", ""); } if (microServiceAttributes.containsKey("description")) { policyDescription = microServiceAttributes.get("description").toString().replace("\"", ""); } if (microServiceAttributes.containsKey("priority")) { priority = microServiceAttributes.get("priority").toString().replace("\"", ""); } if (microServiceAttributes.containsKey("version")) { version = microServiceAttributes.get("version").toString().replace("\"", ""); } StdPAPPolicy newPAPPolicy = new StdPAPPolicy( StdPAPPolicyParams.builder().configPolicyType("Micro Service") .policyName(policyName) .description(policyDescription) .onapName(onapName) .configName(configName) .serviceType(microService) .uuid(uuid) .msLocation(msLocation) .jsonBody(microServiceAttributes.toString()) .priority(priority) .version(version) .editPolicy(updateFlag) .domain(policyScope) .highestVersion(0) .riskLevel(policyParameters.getRiskLevel()) .riskType(policyParameters.getRiskType()) .guard(String.valueOf(policyParameters.getGuard())) .ttlDate(date) .build()); response = (String) papServices.callPAP(newPAPPolicy, new String[]{"operation=" + operation, "apiflag=api", "policyType=Config"}, policyParameters.getRequestID(), "ConfigMS"); LOGGER.info("Policy MS created Response: " + response); return response; } MicroServicesPolicyService(String policyName, String policyScope, PolicyParameters policyParameters,
                                      String date); Boolean getValidation(); String getMessage(); String getResult(boolean updateFlag);  }