@Test
public void testGetUserCharset_CharsetIsSupported() {

    String supportedCharset = "UTF-8";
    PropertyImpl propertyWithSupportedCharset = mock(PropertyImpl.class);
    when(propertyWithSupportedCharset.getStringValue()).thenReturn(supportedCharset);
    // property does not exist => return null
    when(propertyManagerMock.findProperty(identityMock, null, null, null, UserServiceImpl.CHARSET)).thenReturn(propertyWithSupportedCharset);
    String charsetValue = userServiceImpl.getUserCharset(identityMock);
    assertEquals("Wrong charset when charset is supported, should return this value", charsetValue, supportedCharset);
}