TierPodResourcePoolResolver implements PodResourcePoolResolver { @Override public List<ResourcePoolAssignment> resolve(Job<?> job) { ApplicationSLA capacityGroup = JobManagerUtil.getCapacityGroupDescriptor(job.getJobDescriptor(), capacityGroupService); if (capacityGroup == null || capacityGroup.getTier() != Tier.Critical) { return Collections.singletonList(ASSIGNMENT_ELASTIC); } return Collections.singletonList(ASSIGNMENT_RESERVED); } TierPodResourcePoolResolver(ApplicationSlaManagementService capacityGroupService); @Override List<ResourcePoolAssignment> resolve(Job<?> job);  }
@Test public void testFlex() { List<ResourcePoolAssignment> result = resolver.resolve(newJob("myFlex")); assertThat(result).hasSize(1); assertThat(result.get(0).getResourcePoolName()).isEqualTo(PodResourcePoolResolvers.RESOURCE_POOL_ELASTIC); }
@Test public void testCritical() { List<ResourcePoolAssignment> result = resolver.resolve(newJob("myCritical")); assertThat(result).hasSize(1); assertThat(result.get(0).getResourcePoolName()).isEqualTo(PodResourcePoolResolvers.RESOURCE_POOL_RESERVED); }