DefaultUserServiceAdapter implements UserServiceAdapter { @Override public UserInfo findByLogin(String login) { return userCurator.findByLogin(login); } @Inject  DefaultUserServiceAdapter(UserCurator userCurator, RoleCurator roleCurator,
        PermissionBlueprintCurator permissionCurator, OwnerCurator ownerCurator,
        PermissionFactory permissionFactory); @Override UserInfo createUser(UserInfo user); @Override UserInfo updateUser(String username, UserInfo user); @Override List<? extends UserInfo> listUsers(); @Override boolean validateUser(String username, String password); @Override void deleteUser(String username); @Override UserInfo findByLogin(String login); @Override Collection<? extends OwnerInfo> getAccessibleOwners(String username); @Override RoleInfo createRole(RoleInfo role); @Override RoleInfo updateRole(String roleName, RoleInfo role); @Override RoleInfo addUserToRole(String roleName, String username); @Override RoleInfo removeUserFromRole(String roleName, String username); @Override RoleInfo addPermissionToRole(String roleName, PermissionBlueprintInfo permission); @Override RoleInfo removePermissionFromRole(String roleName, String permissionId); @Override void deleteRole(String role); @Override RoleInfo getRole(String roleName); @Override List<? extends RoleInfo> listRoles();  }
@Test public void findByLogin() { User u = mock(User.class); UserCurator curator = mock(UserCurator.class); RoleCurator roleCurator = mock(RoleCurator.class); UserServiceAdapter dusa = new DefaultUserServiceAdapter(curator, roleCurator, permissionCurator, ownerCurator, permissionFactory); when(curator.findByLogin(anyString())).thenReturn(u); UserInfo foo = dusa.findByLogin("foo"); assertNotNull(foo); assertEquals(foo, u); }