use of io.cdap.cdap.internal.provision.MockProvisionerWithCpus in project cdap by caskdata.
the class ProvisionerHttpHandlerTest method testListAndGetProvisioners.
@Test
public void testListAndGetProvisioners() throws Exception {
// in unit test, we have the mock provisioners currently
ProvisionerSpecification spec = new MockProvisioner().getSpec();
ProvisionerDetail expected = new ProvisionerDetail(spec.getName(), spec.getLabel(), spec.getDescription(), new ArrayList<>(), null, null, false);
ProvisionerSpecification specWithCpus = new MockProvisionerWithCpus().getSpec();
ProvisionerDetail expectedWithCpus = new ProvisionerDetail(specWithCpus.getName(), specWithCpus.getLabel(), specWithCpus.getDescription(), new ArrayList<>(), null, null, false);
List<ProvisionerDetail> details = listProvisioners();
Assert.assertEquals(ImmutableList.of(expected, expectedWithCpus), details);
// get a non-existing provisioner should get a 404
getProvisioner("nonExisting", 404);
// get the mock provisioner
Assert.assertEquals(expected, getProvisioner(MockProvisioner.NAME, 200));
}
Aggregations