use of org.kie.kogito.trusty.service.common.handlers.CounterfactualExplainerServiceHandler in project kogito-apps by kiegroup.
the class TrustyServiceTest method setup.
@BeforeEach
@SuppressWarnings("unchecked")
void setup() {
explainabilityRequestProducerMock = mock(ExplainabilityRequestProducer.class);
trustyStorageServiceMock = mock(TrustyStorageService.class);
limeExplainerServiceHandler = new LIMEExplainerServiceHandler(trustyStorageServiceMock);
counterfactualExplainerServiceHandler = new CounterfactualExplainerServiceHandler(trustyStorageServiceMock, mock(CounterfactualExplainabilityResultsManagerSlidingWindow.class), mock(CounterfactualExplainabilityResultsManagerDuplicates.class));
explanationHandlers = mock(Instance.class);
when(explanationHandlers.stream()).thenReturn(Stream.of(limeExplainerServiceHandler, counterfactualExplainerServiceHandler));
trustyService = new TrustyServiceImpl(false, explainabilityRequestProducerMock, trustyStorageServiceMock, new ExplainerServiceHandlerRegistry(explanationHandlers), MAX_RUNNING_TIME_SECONDS);
}
use of org.kie.kogito.trusty.service.common.handlers.CounterfactualExplainerServiceHandler in project kogito-apps by kiegroup.
the class ExplainabilityResultConsumerTest method setup.
@BeforeEach
@SuppressWarnings("unchecked")
void setup() {
trustyService = mock(TrustyService.class);
storageExceptionsProvider = mock(StorageExceptionsProvider.class);
trustyStorage = mock(TrustyStorageService.class);
limeExplainerServiceHandler = new LIMEExplainerServiceHandler(trustyStorage);
counterfactualExplainerServiceHandler = new CounterfactualExplainerServiceHandler(trustyStorage, mock(CounterfactualExplainabilityResultsManagerSlidingWindow.class), mock(CounterfactualExplainabilityResultsManagerDuplicates.class));
explanationHandlers = mock(Instance.class);
when(explanationHandlers.stream()).thenReturn(Stream.of(limeExplainerServiceHandler, counterfactualExplainerServiceHandler));
explainerServiceHandlerRegistry = new ExplainerServiceHandlerRegistry(explanationHandlers);
consumer = new ExplainabilityResultConsumer(trustyService, explainerServiceHandlerRegistry, TrustyServiceTestUtils.MAPPER, storageExceptionsProvider, SmallRyeManagedExecutor.builder().build());
}
Aggregations