@Test public void testDeleteMultiple() { Set<String> crnSet = new HashSet<>(); crnSet.add(DB_CRN); crnSet.add(DB_CRN + "2"); Set<DatabaseConfig> dbSet = new HashSet<>(); dbSet.add(db); dbSet.add(db2); when(service.deleteMultipleByCrn(crnSet)).thenReturn(dbSet); Set<DatabaseV4Response> responseSet = new HashSet<>(); responseSet.add(response); responseSet.add(response2); when(converterUtil.convertAllAsSet(dbSet, DatabaseV4Response.class)).thenReturn(responseSet); DatabaseV4Responses responses = underTest.deleteMultiple(crnSet); assertEquals(2, responses.getResponses().size()); }
@Override @CheckPermissionByResourceCrnList(action = AuthorizationResourceAction.DELETE_DATABASE) public DatabaseV4Responses deleteMultiple(@ResourceCrnList Set<String> crns) { return new DatabaseV4Responses(converterUtil.convertAllAsSet(databaseConfigService.deleteMultipleByCrn(crns), DatabaseV4Response.class)); }
DatabaseV4Controller implements DatabaseV4Endpoint { @Override @CheckPermissionByResourceCrnList(action = AuthorizationResourceAction.DELETE_DATABASE) public DatabaseV4Responses deleteMultiple(@ResourceCrnList Set<String> crns) { return new DatabaseV4Responses(converterUtil.convertAllAsSet(databaseConfigService.deleteMultipleByCrn(crns), DatabaseV4Response.class)); } }
DatabaseV4Controller implements DatabaseV4Endpoint { @Override @CheckPermissionByResourceCrnList(action = AuthorizationResourceAction.DELETE_DATABASE) public DatabaseV4Responses deleteMultiple(@ResourceCrnList Set<String> crns) { return new DatabaseV4Responses(converterUtil.convertAllAsSet(databaseConfigService.deleteMultipleByCrn(crns), DatabaseV4Response.class)); }  }
DatabaseV4Controller implements DatabaseV4Endpoint { @Override @CheckPermissionByResourceCrnList(action = AuthorizationResourceAction.DELETE_DATABASE) public DatabaseV4Responses deleteMultiple(@ResourceCrnList Set<String> crns) { return new DatabaseV4Responses(converterUtil.convertAllAsSet(databaseConfigService.deleteMultipleByCrn(crns), DatabaseV4Response.class)); }  @Override @DisableCheckPermissions DatabaseV4Responses list(String environmentCrn); @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.REGISTER_DATABASE) DatabaseV4Response register(@Valid DatabaseV4Request request); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DESCRIBE_DATABASE) DatabaseV4Response getByCrn(@ResourceCrn String crn); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.DESCRIBE_DATABASE) DatabaseV4Response getByName(String environmentCrn, @ResourceName String name); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DELETE_DATABASE) DatabaseV4Response deleteByCrn(@ResourceCrn String crn); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.DELETE_DATABASE) DatabaseV4Response deleteByName(String environmentCrn, @ResourceName String name); @Override @CheckPermissionByResourceCrnList(action = AuthorizationResourceAction.DELETE_DATABASE) DatabaseV4Responses deleteMultiple(@ResourceCrnList Set<String> crns); @Override @DisableCheckPermissions DatabaseTestV4Response test(@Valid DatabaseTestV4Request databaseTestV4Request); }
DatabaseV4Controller implements DatabaseV4Endpoint { @Override @CheckPermissionByResourceCrnList(action = AuthorizationResourceAction.DELETE_DATABASE) public DatabaseV4Responses deleteMultiple(@ResourceCrnList Set<String> crns) { return new DatabaseV4Responses(converterUtil.convertAllAsSet(databaseConfigService.deleteMultipleByCrn(crns), DatabaseV4Response.class)); }  @Override @DisableCheckPermissions DatabaseV4Responses list(String environmentCrn); @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.REGISTER_DATABASE) DatabaseV4Response register(@Valid DatabaseV4Request request); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DESCRIBE_DATABASE) DatabaseV4Response getByCrn(@ResourceCrn String crn); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.DESCRIBE_DATABASE) DatabaseV4Response getByName(String environmentCrn, @ResourceName String name); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DELETE_DATABASE) DatabaseV4Response deleteByCrn(@ResourceCrn String crn); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.DELETE_DATABASE) DatabaseV4Response deleteByName(String environmentCrn, @ResourceName String name); @Override @CheckPermissionByResourceCrnList(action = AuthorizationResourceAction.DELETE_DATABASE) DatabaseV4Responses deleteMultiple(@ResourceCrnList Set<String> crns); @Override @DisableCheckPermissions DatabaseTestV4Response test(@Valid DatabaseTestV4Request databaseTestV4Request);  }