use of org.kie.kogito.explainability.handlers.LocalExplainerServiceHandlerRegistry in project kogito-apps by kiegroup.
the class ExplanationServiceImplTest method init.
@BeforeEach
@SuppressWarnings("unchecked")
void init() {
instance = mock(Instance.class);
limeExplainerMock = mock(LimeExplainer.class);
cfExplainerMock = mock(CounterfactualExplainer.class);
PredictionProviderFactory predictionProviderFactory = mock(PredictionProviderFactory.class);
explainerServiceHandlerRegistryMock = new LocalExplainerServiceHandlerRegistry(instance);
limeExplainerServiceHandlerMock = spy(new LimeExplainerServiceHandler(limeExplainerMock, predictionProviderFactory));
cfExplainerServiceHandlerMock = spy(new CounterfactualExplainerServiceHandler(cfExplainerMock, predictionProviderFactory, MAX_RUNNING_TIME_SECONDS));
predictionProviderMock = mock(PredictionProvider.class);
callbackMock = mock(Consumer.class);
explanationService = new ExplanationServiceImpl(explainerServiceHandlerRegistryMock);
when(predictionProviderFactory.createPredictionProvider(any(), any(), any())).thenReturn(predictionProviderMock);
}
use of org.kie.kogito.explainability.handlers.LocalExplainerServiceHandlerRegistry in project kogito-apps by kiegroup.
the class ExplainabilityMessagingHandlerTest method setup.
@BeforeEach
void setup() {
explanationService = mock(ExplanationService.class);
LocalExplainerServiceHandlerRegistry explainerServiceHandlerRegistry = mock(LocalExplainerServiceHandlerRegistry.class);
handler = new ExplainabilityMessagingHandler(explanationService, explainerServiceHandlerRegistry);
handler.objectMapper = MAPPER;
}
Aggregations