    @Test
    public void getUsernameWhenUserExists() {


        final User user = new User();

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

        assertEquals(user, loaded);
    }