use of com.sequenceiq.periscope.model.RejectedThread in project cloudbreak by hortonworks.
the class RejectedThreadServiceTest method testCreateWhenAutoscaleStackResponseAndRemove.
@Test
public void testCreateWhenAutoscaleStackResponseAndRemove() {
AutoscaleStackV4Response response = new AutoscaleStackV4Response();
response.setStackId(1L);
EvaluatorExecutor task = new TestEvaluatorExecutor(getContext(response));
underTest.create(task);
List<RejectedThread> allRejectedCluster = underTest.getAllRejectedCluster();
Assert.assertFalse(allRejectedCluster.isEmpty());
Assert.assertEquals(1L, allRejectedCluster.get(0).getId());
underTest.remove(response);
allRejectedCluster = underTest.getAllRejectedCluster();
Assert.assertTrue(allRejectedCluster.isEmpty());
}
use of com.sequenceiq.periscope.model.RejectedThread in project cloudbreak by hortonworks.
the class RejectedThreadServiceTest method testCreateWhenAutoscaleStackResponseCountEqualsTwo.
@Test
public void testCreateWhenAutoscaleStackResponseCountEqualsTwo() {
AutoscaleStackV4Response response = new AutoscaleStackV4Response();
response.setStackId(1L);
EvaluatorExecutor task = new TestEvaluatorExecutor(getContext(response));
underTest.create(task);
underTest.create(task);
List<RejectedThread> allRejectedCluster = underTest.getAllRejectedCluster();
Assert.assertFalse(allRejectedCluster.isEmpty());
Assert.assertEquals(1L, allRejectedCluster.get(0).getId());
Assert.assertEquals(2L, allRejectedCluster.get(0).getRejectedCount());
}
use of com.sequenceiq.periscope.model.RejectedThread in project cloudbreak by hortonworks.
the class RejectedThreadServiceTest method testCreateWhenClusterIdAndRemove.
@Test
public void testCreateWhenClusterIdAndRemove() {
Long data = 1L;
EvaluatorExecutor task = new TestEvaluatorExecutor(getContext(data));
underTest.create(task);
List<RejectedThread> allRejectedCluster = underTest.getAllRejectedCluster();
Assert.assertFalse(allRejectedCluster.isEmpty());
Assert.assertEquals(1L, allRejectedCluster.get(0).getId());
underTest.remove(data);
allRejectedCluster = underTest.getAllRejectedCluster();
Assert.assertTrue(allRejectedCluster.isEmpty());
}
use of com.sequenceiq.periscope.model.RejectedThread in project cloudbreak by hortonworks.
the class RejectedThreadMonitorTest method rejectedThread.
private RejectedThread rejectedThread(long count) {
RejectedThread rejectedThread = new RejectedThread();
rejectedThread.setRejectedCount(count);
return rejectedThread;
}
Aggregations