Search in sources :

Example 6 with UnreserveOfferRecommendation

use of com.mesosphere.sdk.offer.UnreserveOfferRecommendation in project dcos-commons by mesosphere.

the class DecommissionRecorderTest method testUnreserve.

@Test
public void testUnreserve() throws Exception {
    when(mockStateStore.fetchGoalOverrideStatus(TestConstants.TASK_NAME)).thenReturn(DecommissionPlanFactory.DECOMMISSIONING_STATUS);
    recorder.record(new UnreserveOfferRecommendation(null, taskResource));
    verify(mockStateStore).storeTasks(Arrays.asList(emptyTaskA, emptyTaskB));
}
Also used : UnreserveOfferRecommendation(com.mesosphere.sdk.offer.UnreserveOfferRecommendation) Test(org.junit.Test)

Example 7 with UnreserveOfferRecommendation

use of com.mesosphere.sdk.offer.UnreserveOfferRecommendation in project dcos-commons by mesosphere.

the class DecommissionRecorderTest method testUnreserveNotDecommissioning.

@Test
public void testUnreserveNotDecommissioning() throws Exception {
    when(mockStateStore.fetchGoalOverrideStatus(TestConstants.TASK_NAME)).thenReturn(GoalStateOverride.Status.INACTIVE);
    recorder.record(new UnreserveOfferRecommendation(null, taskResource));
    verify(mockStateStore, times(0)).storeTasks(any());
}
Also used : UnreserveOfferRecommendation(com.mesosphere.sdk.offer.UnreserveOfferRecommendation) Test(org.junit.Test)

Aggregations

UnreserveOfferRecommendation (com.mesosphere.sdk.offer.UnreserveOfferRecommendation)7 Test (org.junit.Test)6 OfferRecommendation (com.mesosphere.sdk.offer.OfferRecommendation)4 CreateOfferRecommendation (com.mesosphere.sdk.offer.CreateOfferRecommendation)3 ReserveOfferRecommendation (com.mesosphere.sdk.offer.ReserveOfferRecommendation)1 ReserveEvaluationOutcome (com.mesosphere.sdk.offer.evaluate.OfferEvaluationUtils.ReserveEvaluationOutcome)1 DefaultResourceSpec (com.mesosphere.sdk.specification.DefaultResourceSpec)1 ResourceSpec (com.mesosphere.sdk.specification.ResourceSpec)1 Protos (org.apache.mesos.Protos)1