@Test
public void testAddUser() throws UnknownHostException, AuthenticationException {

	final TestingRepositoryHandler repoHandler = new TestingRepositoryHandler();
	
	final AddUserTask addUser = new AddUserTask(repoHandler);
	final ImmutableMultimap.Builder<String, String> builder = new Builder<String, String>();
	builder.put(ServerAPI.USER_PARAM, "user");
	builder.put(ServerAPI.PASSWORD_PARAM, "password");
	Exception exception = null;
	
	try {
		addUser.execute(builder.build(), mock(PrintWriter.class));
	} catch (Exception e) {
		exception = e;
	}
	
	assertNull(exception);
	
	final DbCredential credential = repoHandler.getCredential("user");
	assertEquals("user", credential.getUser());
	assertEquals(GrapesAuthenticator.encrypt("password"), credential.getPassword());
	
}