ExplicitJobPodResourcePoolResolver implements PodResourcePoolResolver { @Override public List<ResourcePoolAssignment> resolve(Job<?> job) { List<String> resourcePoolNames = StringExt.splitByComma( job.getJobDescriptor().getAttributes().get(JobAttributes.JOB_PARAMETER_RESOURCE_POOLS) ); if (resourcePoolNames.isEmpty()) { return Collections.emptyList(); } String rule = "Job requested placement in resource pools: " + resourcePoolNames; return resourcePoolNames.stream().map(name -> ResourcePoolAssignment.newBuilder().withResourcePoolName(name).withRule(rule).build() ).collect(Collectors.toList()); }  @Override List<ResourcePoolAssignment> resolve(Job<?> job);  }
@Test public void testAssignment() { List<ResourcePoolAssignment> result = resolver.resolve(newJob("myResourcePool")); assertThat(result).hasSize(1); assertThat(result.get(0).getResourcePoolName()).isEqualTo("myResourcePool"); }