@Test
public void testUpdatePolicy() throws UnsupportedEncodingException {

	// Arrange
	final byte[] policyBytes = POLICY_STRING1.getBytes("UTF-8");
	final PolicyContentDto updatePolicyRequestDto = mock(PolicyContentDto.class);
	final Policy policy = mock(Policy.class);
	when(updatePolicyRequestDto.getPolicy()).thenReturn(policyBytes);
	when(policyRepository.findOne(POLICY_ID1)).thenReturn(policy);
	final PolicyMetadataDto updatePolicyResponseDto = mock(PolicyMetadataDto.class);
	when(modelMapper.map(policy, PolicyMetadataDto.class)).thenReturn(
			updatePolicyResponseDto);
	// Act
	final PolicyMetadataDto response = sut.updatePolicy(
			updatePolicyRequestDto, POLICY_ID1);
	// Assert
	verify(policy, times(1)).setPolicy(policyBytes);
	verify(policy, times(1)).setValid(true);
	verify(policyRepository, times(1)).save(policy);
	assertEquals(updatePolicyResponseDto, response);
}