@Test(expected=InternalServerErrorException.class)
public void testCreateWhenUseridToCreateAccountCantBeFound() throws Exception {

    AdminUserResource resource = new AdminUserResource();
    // Inject OSGi services into the resource
    UserManagementServiceProvider useradmin = new UserManagementServiceProvider();
    DataSource authservicedatasource = mock(DataSource.class);
    Connection connection = mock(Connection.class);
    PreparedStatement statement = mock(PreparedStatement.class);
    ResultSet results = mock(ResultSet.class);
    when(statement.executeQuery()).thenReturn(results);
    when(connection.prepareStatement(anyString())).thenReturn(statement);
    when(authservicedatasource.getConnection()).thenReturn(connection);
    useradmin.setDataSource(authservicedatasource);
    resource.useradmin = useradmin;
    UkelonnService ukelonn = mock(UkelonnService.class);
    resource.ukelonn = ukelonn;
    MockLogService logservice = new MockLogService();
    resource.logservice = logservice;
    useradmin.setLogservice(logservice);
    // Create a user object
    String newUsername = "aragorn";
    String newEmailaddress = "strider@hotmail.com";
    String newFirstname = "Aragorn";
    String newLastname = "McArathorn";
    User user = new User(0, newUsername, newEmailaddress, newFirstname, newLastname);
    // Create a passwords object containing the user
    UserAndPasswords passwords = new UserAndPasswords(user, "zecret", "zecret", false);
    // Create a user
    List<User> updatedUsers = resource.create(passwords);
    // Should never get here
    assertThat(updatedUsers).isNotEmpty();
}