FirewallPolicyService { public Boolean getValidation() { if (policyParameters.getConfigBody() == null) { message = XACMLErrorConstants.ERROR_DATA_ISSUE + "No Config Body given."; return false; } try { firewallJson = PolicyApiUtils.stringToJsonObject(policyParameters.getConfigBody()); } catch (JsonException | IllegalStateException e) { message = XACMLErrorConstants.ERROR_DATA_ISSUE + " improper JSON object : " + policyParameters.getConfigBody(); LOGGER.error("Error while parsing JSON body for creating Firewall Policy ", e); return false; } if (firewallJson == null || firewallJson.isEmpty()) { message = XACMLErrorConstants.ERROR_DATA_ISSUE + "No Config-Body given."; return false; } boolean levelCheck = false; levelCheck = PolicyApiUtils.isNumeric(policyParameters.getRiskLevel()); if (!levelCheck) { message = XACMLErrorConstants.ERROR_DATA_ISSUE + "Incorrect Risk Level given."; return false; } return true; } FirewallPolicyService(String policyName, String policyScope,
                                 PolicyParameters policyParameters, String date); Boolean getValidation(); String getMessage(); String getResult(boolean updateFlag);  }
@Test public final void testGetValidation() { assertTrue(firewallPolicyService.getValidation()); }