@Test
public void testGetUserCharset_CharsetIsNotSupported() {

    String notSupportedCharset = "notSupportedCharset";
    PropertyImpl propertyWithNotSupportedCharset = mock(PropertyImpl.class);
    when(propertyWithNotSupportedCharset.getStringValue()).thenReturn(notSupportedCharset);
    // property does not exist => return null
    when(propertyManagerMock.findProperty(identityMock, null, null, null, UserServiceImpl.CHARSET)).thenReturn(propertyWithNotSupportedCharset);
    String charsetValue = userServiceImpl.getUserCharset(identityMock);
    assertEquals("Wrong charset when charset is not supported, should return 'WebappHelper.getDefaultCharset()", charsetValue, WebappHelper.getDefaultCharset());
}