	@Test
	public void shouldLoadByUsernameWhenUserExists() {


		final User user = new User();

		when(repository.findOne(any())).thenReturn(user);
		UserDetails loaded = service.loadUserByUsername("name");

		assertEquals(user, loaded);
	}