use of com.mesosphere.sdk.offer.CreateOfferRecommendation in project dcos-commons by mesosphere.
the class UninstallRecorderTest method testHandlingOfUnexpectedOfferRecommendation.
@Test
public void testHandlingOfUnexpectedOfferRecommendation() throws Exception {
Protos.Resource resource = ResourceTestUtils.getUnreservedCpus(1.0);
OfferRecommendation unsupportedOfferRecommendation = new CreateOfferRecommendation(null, resource);
StateStore mockStateStore = mock(StateStore.class);
OperationRecorder operationRecorder = new UninstallRecorder(mockStateStore, null);
// should just return without error
operationRecorder.record(unsupportedOfferRecommendation);
}
use of com.mesosphere.sdk.offer.CreateOfferRecommendation in project dcos-commons by mesosphere.
the class ResourceCleanupStepTest method testMixedUpdateOfferStatus.
@Test
public void testMixedUpdateOfferStatus() throws Exception {
OfferRecommendation rec1 = new CreateOfferRecommendation(null, ResourceTestUtils.getReservedRootVolume(999.0));
OfferRecommendation rec2 = new UnreserveOfferRecommendation(null, ResourceTestUtils.getReservedCpus(1.0, TestConstants.RESOURCE_ID));
resourceCleanupStep.start();
resourceCleanupStep.updateOfferStatus(Arrays.asList(rec1, rec2));
assert resourceCleanupStep.getStatus().equals(Status.COMPLETE);
}
Aggregations