@Test void serializeWhenNoSerializer() throws Exception { when(this.userConfiguration.getStoreHint()).thenReturn("storehint"); when(this.componentManager.getInstance(new DefaultParameterizedType(null, UserReferenceSerializer.class, String.class), "storehint")).thenThrow(new ComponentLookupException("error")); Throwable exception = assertThrows(RuntimeException.class, () -> this.serializer.serialize(mock(UserReference.class))); assertEquals("Failed to find user reference serializer for role " + "[org.xwiki.user.UserReferenceSerializer<java.lang.String>] and hint [storehint]", exception.getMessage()); assertEquals("ComponentLookupException: error", ExceptionUtils.getRootCauseMessage(exception)); }
@Override public String serialize(UserReference userReference) { return resolveUserReferenceSerializer().serialize(userReference); }
ConfiguredStringUserReferenceSerializer implements UserReferenceSerializer<String> { @Override public String serialize(UserReference userReference) { return resolveUserReferenceSerializer().serialize(userReference); } }
ConfiguredStringUserReferenceSerializer implements UserReferenceSerializer<String> { @Override public String serialize(UserReference userReference) { return resolveUserReferenceSerializer().serialize(userReference); }  }
ConfiguredStringUserReferenceSerializer implements UserReferenceSerializer<String> { @Override public String serialize(UserReference userReference) { return resolveUserReferenceSerializer().serialize(userReference); }  @Override String serialize(UserReference userReference); }
ConfiguredStringUserReferenceSerializer implements UserReferenceSerializer<String> { @Override public String serialize(UserReference userReference) { return resolveUserReferenceSerializer().serialize(userReference); }  @Override String serialize(UserReference userReference);  }