@Test public void testValidateAndReturn_Not_Valid() throws UnsupportedEncodingException { final PolicyDto policyDto = new PolicyDto(); policyDto.setId(POLICY_ID); policyDto.setPolicy(POLICY_STRING_NOT_VALID_XACML .getBytes(DOMUtils.DEFAULT_ENCODING)); policyDto.setValid(true); final PolicyDto response = PolicyValidationUtils .validateAndReturn(policyDto); assertEquals(false, response.isValid()); assertEquals(policyDto, response); assertEquals(policyDto.getPolicy(), response.getPolicy()); assertEquals(policyDto.getId(), response.getId()); }
public static PolicyDto validateAndReturn(PolicyDto policyDto) { policyDto.setValid(validate(policyDto.getPolicy())); return policyDto; }
PolicyValidationUtils { public static PolicyDto validateAndReturn(PolicyDto policyDto) { policyDto.setValid(validate(policyDto.getPolicy())); return policyDto; } }
PolicyValidationUtils { public static PolicyDto validateAndReturn(PolicyDto policyDto) { policyDto.setValid(validate(policyDto.getPolicy())); return policyDto; }  }
PolicyValidationUtils { public static PolicyDto validateAndReturn(PolicyDto policyDto) { policyDto.setValid(validate(policyDto.getPolicy())); return policyDto; }  static boolean validate(final byte[] policy); static PolicyDto validateAndReturn(PolicyDto policyDto); }
PolicyValidationUtils { public static PolicyDto validateAndReturn(PolicyDto policyDto) { policyDto.setValid(validate(policyDto.getPolicy())); return policyDto; }  static boolean validate(final byte[] policy); static PolicyDto validateAndReturn(PolicyDto policyDto);  }