Search in sources :

Example 1 with TrustyStorageService

use of org.kie.kogito.trusty.storage.common.TrustyStorageService in project kogito-apps by kiegroup.

the class ExplainerServiceHandlerRegistryTest method setup.

@BeforeEach
@SuppressWarnings("unchecked")
public void setup() {
    TrustyStorageService trustyStorage = mock(TrustyStorageService.class);
    limeExplainerServiceHandler = spy(new LIMEExplainerServiceHandler(trustyStorage));
    counterfactualExplainerServiceHandler = spy(new CounterfactualExplainerServiceHandler(trustyStorage, mock(CounterfactualExplainabilityResultsManagerSlidingWindow.class), mock(CounterfactualExplainabilityResultsManagerDuplicates.class)));
    Instance<ExplainerServiceHandler<?>> explanationHandlers = mock(Instance.class);
    when(explanationHandlers.stream()).thenReturn(Stream.of(limeExplainerServiceHandler, counterfactualExplainerServiceHandler));
    registry = new ExplainerServiceHandlerRegistry(explanationHandlers);
    storageLIME = mock(Storage.class);
    storageCounterfactual = mock(Storage.class);
    when(trustyStorage.getLIMEResultStorage()).thenReturn(storageLIME);
    when(trustyStorage.getCounterfactualResultStorage()).thenReturn(storageCounterfactual);
    decision = mock(Decision.class);
}
Also used : Storage(org.kie.kogito.persistence.api.Storage) TrustyStorageService(org.kie.kogito.trusty.storage.common.TrustyStorageService) Decision(org.kie.kogito.trusty.storage.api.model.decision.Decision) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

BeforeEach (org.junit.jupiter.api.BeforeEach)1 Storage (org.kie.kogito.persistence.api.Storage)1 Decision (org.kie.kogito.trusty.storage.api.model.decision.Decision)1 TrustyStorageService (org.kie.kogito.trusty.storage.common.TrustyStorageService)1