@Test
public void testSubmitAccountRequest() throws QuadrigaStorageException {	

	
	String result = requestAccountController.submitAccountRequest(model, principleNoUsername);
	assertEquals(result, "requests/error");
	
	// first time the user doesn't exist yet
	Mockito.when(userManager.addAccountRequest(Mockito.anyString())).thenReturn(1);
	result = requestAccountController.submitAccountRequest(model, principalUsername);
	assertEquals(result, "requests/accountRequested");
	assertEquals(model.get("requestStatus"), 1);
	assertEquals(model.get("username"), "jdoe");
	
	// now it should exist, so Mockito has to return 0
	Mockito.when(userManager.addAccountRequest(Mockito.anyString())).thenReturn(0);
	result = requestAccountController.submitAccountRequest(model, principalUsername);
	assertEquals(result, "requests/accountRequested");
	assertEquals(model.get("requestStatus"), 0);
	assertEquals(model.get("username"), "jdoe");
}