TomcatUserManager extends BaseTomcatManager implements UserManager,
                                                                    ContextualManager { @Override public User update(User entity) throws SecurityManagementException { checkNotNull("entity", entity); MemoryUserDatabase userDatabase = getDatabase(); try { org.apache.catalina.User user = getUser(userDatabase, entity.getIdentifier()); String fName = entity.getProperty(ATTRIBUTE_USER_FULLNAME); user.setFullName(fName != null ? fName : ""); saveDatabase(userDatabase); return entity; } finally { closeDatabase(userDatabase); } } TomcatUserManager();  TomcatUserManager(final Map<String, String> gitPrefs);  TomcatUserManager(final ConfigProperties gitPrefs); @Override void initialize(final UserSystemManager userSystemManager); @Override void destroy(); @Override SearchResponse<User> search(SearchRequest request); @Override User get(String identifier); @Override List<User> getAll(); @Override User create(User entity); @Override User update(User entity); @Override void delete(String... identifiers); @Override UserManagerSettings getSettings(); @Override void assignGroups(String username,
                             Collection<String> groups); @Override void assignRoles(String username,
                            Collection<String> roles); @Override void changePassword(String username,
                               String newPassword);  }
@Test public void testUpdateUser() { User user = mock(User.class); when(user.getIdentifier()).thenReturn("user1"); Map<String, String> properties = new HashMap<String, String>(1); properties.put(BaseTomcatManager.ATTRIBUTE_USER_FULLNAME, "user1 Full Name"); when(user.getProperty(BaseTomcatManager.ATTRIBUTE_USER_FULLNAME)).thenReturn("user1 Full Name"); when(user.getProperties()).thenReturn(properties); User userUpdated = usersManager.update(user); assertNotNull(userUpdated); assertEquals("user1 Full Name", userUpdated.getProperty(BaseTomcatManager.ATTRIBUTE_USER_FULLNAME)); }