@Test
public void testGetAllPolicyMetadata() throws UnsupportedEncodingException {

	// Arrange
	final Policy p1 = new Policy();
	p1.setId(POLICY_ID1);
	p1.setPolicy(POLICY_STRING1.getBytes("UTF-8"));
	p1.setValid(true);
	final Policy p2 = new Policy();
	p2.setId(POLICY_ID2);
	p2.setPolicy(POLICY_STRING2.getBytes("UTF-8"));
	p2.setValid(false);
	final List<Policy> policyList = Arrays.asList(p1, p2);
	final PolicyMetadataDto m1 = new PolicyMetadataDto();
	final PolicyMetadataDto m2 = new PolicyMetadataDto();
	m1.setId(p1.getId());
	m1.setValid(p1.isValid());
	m2.setId(p2.getId());
	m2.setValid(p2.isValid());
	when(policyRepository.findAll()).thenReturn(policyList);
	when(modelMapper.map(p1, PolicyMetadataDto.class)).thenReturn(m1);
	when(modelMapper.map(p2, PolicyMetadataDto.class)).thenReturn(m2);
	// Act
	final PolicyMetadataContainerDto response = sut.getAllPolicyMetadata();
	// Assert
	assertEquals(policyList.size(), response.getPolicies().size());
	assertEquals(p1.getId(), response.getPolicies().get(0).getId());
	assertEquals(p1.isValid(), response.getPolicies().get(0).isValid());
	assertEquals(p2.getId(), response.getPolicies().get(1).getId());
	assertEquals(p2.isValid(), response.getPolicies().get(1).isValid());
}