use of org.opensearch.ad.model.EntityState in project anomaly-detection by opensearch-project.
the class EntityProfileRunnerTests method stateTestTemplate.
public void stateTestTemplate(InittedEverResultStatus returnedState, EntityState expectedState) throws InterruptedException {
setUpExecuteEntityProfileAction(returnedState);
final CountDownLatch inProgressLatch = new CountDownLatch(1);
runner.profile(detectorId, entity, state, ActionListener.wrap(response -> {
assertEquals(expectedState, response.getState());
inProgressLatch.countDown();
}, exception -> {
assertTrue("Should not reach here", false);
inProgressLatch.countDown();
}));
assertTrue(inProgressLatch.await(100, TimeUnit.SECONDS));
}
Aggregations