use of org.kie.kogito.explainability.local.counterfactual.entities.URIEntity in project kogito-apps by kiegroup.
the class CounterfactualEntityFactoryTest method testURIFactory.
@Test
void testURIFactory() throws URISyntaxException {
final URI value = URI.create("./");
Feature feature = FeatureFactory.newURIFeature("uri-feature", value);
CounterfactualEntity counterfactualEntity = CounterfactualEntityFactory.from(feature);
assertTrue(counterfactualEntity instanceof FixedURIEntity);
assertEquals(Type.URI, counterfactualEntity.asFeature().getType());
FeatureDomain domain = URIFeatureDomain.create(new URI("./"), new URI("../"), new URI("https://example.com"));
feature = FeatureFactory.newURIFeature("uri-feature", value, domain);
counterfactualEntity = CounterfactualEntityFactory.from(feature);
assertTrue(counterfactualEntity instanceof URIEntity);
assertEquals(value, counterfactualEntity.asFeature().getValue().getUnderlyingObject());
domain = URIFeatureDomain.create(List.of(new URI("./"), new URI("../"), new URI("https://example.com")));
feature = FeatureFactory.newURIFeature("uri-feature", value, domain);
counterfactualEntity = CounterfactualEntityFactory.from(feature);
assertTrue(counterfactualEntity instanceof URIEntity);
assertEquals(value, counterfactualEntity.asFeature().getValue().getUnderlyingObject());
domain = URIFeatureDomain.create(Set.of(new URI("./"), new URI("../"), new URI("https://example.com")));
feature = FeatureFactory.newURIFeature("uri-feature", value, domain);
counterfactualEntity = CounterfactualEntityFactory.from(feature);
assertTrue(counterfactualEntity instanceof URIEntity);
assertEquals(value, counterfactualEntity.asFeature().getValue().getUnderlyingObject());
}
Aggregations