use of io.cdap.cdap.proto.profile.Profile in project cdap by cdapio.
the class ProfileHttpHandlerTest method testPutAndGetProfileWithTotalCPUSImplementedProvisioner.
@Test
public void testPutAndGetProfileWithTotalCPUSImplementedProvisioner() throws Exception {
// put a profile with the mock provisioner with total cpus method implemented
Profile expected = new Profile("MyProfile", "label", "my profile for testing", new ProvisionerInfo(MockProvisionerWithCpus.NAME, PROPERTY_SUMMARIES));
ProfileId expectedProfileId = NamespaceId.DEFAULT.profile(expected.getName());
putProfile(expectedProfileId, expected, HttpURLConnection.HTTP_OK);
// get the profile
Profile actual = getProfile(expectedProfileId, HttpURLConnection.HTTP_OK).get();
expected.getProvisioner().setTotalProcessingCpusLabel(MockProvisionerWithCpus.TEST_LABEL);
Assert.assertEquals(expected, actual);
disableProfile(expectedProfileId, HttpURLConnection.HTTP_OK);
deleteProfile(expectedProfileId, HttpURLConnection.HTTP_OK);
}
Aggregations