use of org.kie.kogito.persistence.mongodb.index.ProcessIndexEvent in project kogito-apps by kiegroup.
the class ProcessIndexObserverIT method testOnProcessIndexEvent.
@Test
void testOnProcessIndexEvent() {
String processId = "testProcess";
String processType = "testProcessType";
ProcessDescriptor processDescriptor = new ProcessDescriptor(processId, processType);
ProcessIndexEvent processIndexEvent = new ProcessIndexEvent(processDescriptor);
processIndexObserver.onProcessIndexEvent(processIndexEvent);
Storage<String, String> processIdStorage = new MongoStorage<>(mongoClientManager.getCollection(PROCESS_ID_MODEL_STORAGE, ProcessIdEntity.class), String.class.getName(), new ProcessIdEntityMapper());
assertTrue(processIdStorage.containsKey(processId));
assertEquals(processType, processIdStorage.get(processId));
mockIndexCreateOrUpdateEventListener.assertFire("testProcess_domain", processType);
}
Aggregations