Search in sources :

Example 1 with TrustyService

use of org.kie.kogito.trusty.service.common.TrustyService 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());
}
Also used : LIMEExplainerServiceHandler(org.kie.kogito.trusty.service.common.handlers.LIMEExplainerServiceHandler) Instance(javax.enterprise.inject.Instance) StorageExceptionsProvider(org.kie.kogito.trusty.storage.api.StorageExceptionsProvider) TrustyStorageService(org.kie.kogito.trusty.storage.common.TrustyStorageService) TrustyService(org.kie.kogito.trusty.service.common.TrustyService) CounterfactualExplainerServiceHandler(org.kie.kogito.trusty.service.common.handlers.CounterfactualExplainerServiceHandler) ExplainerServiceHandlerRegistry(org.kie.kogito.trusty.service.common.handlers.ExplainerServiceHandlerRegistry) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

Instance (javax.enterprise.inject.Instance)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 TrustyService (org.kie.kogito.trusty.service.common.TrustyService)1 CounterfactualExplainerServiceHandler (org.kie.kogito.trusty.service.common.handlers.CounterfactualExplainerServiceHandler)1 ExplainerServiceHandlerRegistry (org.kie.kogito.trusty.service.common.handlers.ExplainerServiceHandlerRegistry)1 LIMEExplainerServiceHandler (org.kie.kogito.trusty.service.common.handlers.LIMEExplainerServiceHandler)1 StorageExceptionsProvider (org.kie.kogito.trusty.storage.api.StorageExceptionsProvider)1 TrustyStorageService (org.kie.kogito.trusty.storage.common.TrustyStorageService)1