### Question:
PersonalUserManager implements EnterpriseUserManager { @Override public User newUser( String username, byte[] initialPassword, boolean requirePasswordChange ) throws IOException, InvalidArgumentsException, AuthorizationViolationException { try { assertUserManager(); User user = userManager.newUser( username, initialPassword, requirePasswordChange ); securityLog.info( subject, "created user `%s`%s", username, requirePasswordChange ? ", with password change required" : "" ); return user; } catch ( AuthorizationViolationException | IOException | InvalidArgumentsException e ) { securityLog.error( subject, "tried to create user `%s`: %s", username, e.getMessage() ); throw e; } } PersonalUserManager( EnterpriseUserManager userManager, AuthSubject subject, SecurityLog securityLog, boolean isUserManager ); @Override User newUser( String username, byte[] initialPassword, boolean requirePasswordChange ); @Override void suspendUser( String username ); @Override boolean deleteUser( String username ); @Override void activateUser( String username, boolean requirePasswordChange ); @Override User getUser( String username ); @Override User silentlyGetUser( String username ); @Override void newRole( String roleName, String... usernames ); @Override boolean deleteRole( String roleName ); @Override void setUserPassword( String username, byte[] password, boolean requirePasswordChange ); @Override Set<String> getAllUsernames(); @Override void assertRoleExists( String roleName ); @Override void addRoleToUser( String roleName, String username ); @Override void removeRoleFromUser( String roleName, String username ); @Override Set<String> getAllRoleNames(); @Override Set<String> getRoleNamesForUser( String username ); @Override Set<String> silentlyGetRoleNamesForUser( String username ); @Override Set<String> getUsernamesForRole( String roleName ); @Override Set<String> silentlyGetUsernamesForRole( String roleName );  }### Answer:
@Test public void shouldHandleFailureToCreateUser() throws Exception { evilUserManager.setFailNextCall(); expectedException.expect( IOException.class ); expectedException.expectMessage( "newUserException" ); userManager.newUser( "hewhoshallnotbenamed", password( "avada kedavra" ), false ); verify( log ).error( withSubject( SecurityContext.AUTH_DISABLED.subject(), "tried to create user `%s`: %s" ), "hewhoshallnotbenamed", "newUserException" ); }