### Question:
DatabaseConnectionService { @PreAuthorize("@gatekeeperRoleService.isApprover()") public List<String> forceRevokeAccessUsersOnDatabase(GatekeeperRDSInstance db, AWSEnvironment awsEnvironment, List<DbUser> users ) throws Exception { Account account = accountInformationService.getAccountByAlias(awsEnvironment.getAccount()); List<DbUser> nonGkUsers = users.stream() .filter(user -> !user.getUsername().toLowerCase().startsWith("gk_")) .collect(Collectors.toList()); if(!nonGkUsers.isEmpty()){ throw new GatekeeperException("Forced removal of non-gatekeeper users is not supported. The following unsupported users are: " + nonGkUsers.toString() ); } List<String> usersNotRemoved = new ArrayList<>(); for(DbUser user: users){ boolean outcome = databaseConnectionFactory.getConnection(db.getEngine()) .revokeAccess(new RdsRevokeAccessQuery(account.getAlias(), account.getAccountId(), awsEnvironment.getRegion(), awsEnvironment.getSdlc(), getAddress(db.getEndpoint(), db.getDbName()), db.getName()) .withUser(user.getUsername())); if(!outcome){ usersNotRemoved.add(user.getUsername()); } } return usersNotRemoved; } @Autowired  DatabaseConnectionService(DatabaseConnectionFactory databaseConnectionFactory, AccountInformationService accountInformationService); Boolean grantAccess(AWSRdsDatabase db, AWSEnvironment awsEnvironment, String user, RoleType roleType, String password, Integer timeDays); Boolean revokeAccess(AWSRdsDatabase db, AWSEnvironment awsEnvironment, RoleType roleType, String user); @PreAuthorize("@gatekeeperRoleService.isApprover()") List<String> forceRevokeAccessUsersOnDatabase(GatekeeperRDSInstance db, AWSEnvironment awsEnvironment, List<DbUser> users ); Map<RoleType, List<String>> getAvailableSchemasForDb(GatekeeperRDSInstance database, AWSEnvironment awsEnvironment); Map<RoleType, List<String>> getAvailableSchemasForDb(AWSRdsDatabase database, AWSEnvironment awsEnvironment); String checkDb(DBInstance db, AWSEnvironment awsEnvironment); String checkDb(DBCluster db, AWSEnvironment awsEnvironment); List<DbUser> getUsersForDb(GatekeeperRDSInstance db, AWSEnvironment awsEnvironment); List<String> getAvailableRolesForDb(DBInstance db, AWSEnvironment awsEnvironment); List<String> getAvailableRolesForDb(DBCluster db, AWSEnvironment awsEnvironment); List<String> checkUsersAndDbs(List<UserRole> roles, List<User> users, AWSRdsDatabase db, AWSEnvironment awsEnvironment);  }### Answer:
@Test(expected = GatekeeperException.class) public void testForceRevokeAccessNonGkUserIncluded() throws Exception { List<DbUser> userList = Arrays.asList(gkDbUser, gkDbUser2, nonGkDbUser); List<String> removedUsers = databaseConnectionService.forceRevokeAccessUsersOnDatabase(supportedGatekeeperRDSInstance, environment, userList); Assert.assertEquals(Collections.singletonList(gkDbUser2.getUsername()), removedUsers); }