@Test public void testBuild() throws Exception { String docId = "documentId"; String orgId = "organizationId"; float matchStrength = 0.9f; String provenance = "affmatch"; ActionBuilderModule<MatchedOrganizationWithProvenance, Relation> module = factory.instantiate(config); List<AtomicAction<Relation>> actions = module.build(buildMatchedOrganization(docId, orgId, matchStrength, provenance)); assertNotNull(actions); assertEquals(2, actions.size()); AtomicAction<Relation> action = actions.get(0); assertNotNull(action); assertEquals(Relation.class, action.getClazz()); Expectations expectations = new Expectations(docId, orgId, matchStrength, "resultOrganization", "affiliation", "hasAuthorInstitution"); assertOafRel(action.getPayload(), expectations); action = actions.get(1); assertNotNull(action); assertEquals(Relation.class, action.getClazz()); expectations.setSource(orgId); expectations.setTarget(docId); expectations.setRelationClass("isAuthorInstitutionOf"); assertOafRel(action.getPayload(), expectations); }
@Override public ActionBuilderModule<MatchedOrganizationWithProvenance, Relation> instantiate(Configuration config) { return new MatchedOrganizationActionBuilderModule(provideTrustLevelThreshold(config)); }
MatchedOrganizationActionBuilderModuleFactory extends AbstractActionBuilderFactory<MatchedOrganizationWithProvenance, Relation> { @Override public ActionBuilderModule<MatchedOrganizationWithProvenance, Relation> instantiate(Configuration config) { return new MatchedOrganizationActionBuilderModule(provideTrustLevelThreshold(config)); } }
MatchedOrganizationActionBuilderModuleFactory extends AbstractActionBuilderFactory<MatchedOrganizationWithProvenance, Relation> { @Override public ActionBuilderModule<MatchedOrganizationWithProvenance, Relation> instantiate(Configuration config) { return new MatchedOrganizationActionBuilderModule(provideTrustLevelThreshold(config)); } MatchedOrganizationActionBuilderModuleFactory(); }
MatchedOrganizationActionBuilderModuleFactory extends AbstractActionBuilderFactory<MatchedOrganizationWithProvenance, Relation> { @Override public ActionBuilderModule<MatchedOrganizationWithProvenance, Relation> instantiate(Configuration config) { return new MatchedOrganizationActionBuilderModule(provideTrustLevelThreshold(config)); } MatchedOrganizationActionBuilderModuleFactory(); @Override ActionBuilderModule<MatchedOrganizationWithProvenance, Relation> instantiate(Configuration config); }
MatchedOrganizationActionBuilderModuleFactory extends AbstractActionBuilderFactory<MatchedOrganizationWithProvenance, Relation> { @Override public ActionBuilderModule<MatchedOrganizationWithProvenance, Relation> instantiate(Configuration config) { return new MatchedOrganizationActionBuilderModule(provideTrustLevelThreshold(config)); } MatchedOrganizationActionBuilderModuleFactory(); @Override ActionBuilderModule<MatchedOrganizationWithProvenance, Relation> instantiate(Configuration config);  }