Пример #1
0
  private void assertTestRelationship(Relationship relationship) {
    assertEquals("relationship", relationship.getId());
    assertNotNull(relationship.getSources());
    assertEquals(1, relationship.getSources().size());
    assertEquals(
        URI.create("urn:sourceDescription1"), relationship.getSources().get(0).getDescriptionRef());

    assertEquals(RelationshipType.Couple, relationship.getKnownType());

    assertEquals(URI.create("urn:person1"), relationship.getPerson1().getResource());
    assertEquals(URI.create("urn:person2"), relationship.getPerson2().getResource());

    assertNotNull(relationship.getFacts());
    assertEquals(2, relationship.getFacts().size());
    assertEquals("fact", relationship.getFacts().get(0).getId());
    assertEquals("event", relationship.getFacts().get(1).getId());

    assertNotNull(relationship.getIdentifiers());
    assertEquals(1, relationship.getIdentifiers().size());
    assertEquals(URI.create("urn:identifierType"), relationship.getIdentifiers().get(0).getType());
    assertEquals(
        URI.create("urn:identifierValue"), relationship.getIdentifiers().get(0).getValue());

    assertEquals("explanation", relationship.getAttribution().getChangeMessage());
  }
Пример #2
0
  private Relationship createTestRelationship() {
    Relationship relationship = new Relationship();

    relationship.setId("relationship");
    relationship.addSource(new SourceReference());
    relationship.getSources().get(0).setDescriptionRef(URI.create("urn:sourceDescription1"));

    relationship.setKnownType(RelationshipType.Couple);

    relationship.setPerson1(new ResourceReference(URI.create("urn:person1")));
    relationship.setPerson2(new ResourceReference(URI.create("urn:person2")));

    relationship.addFact(new Fact());
    relationship.getFacts().get(0).setId("fact");
    relationship.addFact(new Fact());
    relationship.getFacts().get(1).setId("event");

    relationship.setIdentifiers(Arrays.asList(new Identifier()));
    relationship.getIdentifiers().get(0).setType(URI.create("urn:identifierType"));
    relationship.getIdentifiers().get(0).setValue(URI.create("urn:identifierValue"));

    relationship.setAttribution(new Attribution());
    relationship.getAttribution().setChangeMessage("explanation");

    return relationship;
  }