@Test void testSimpleEvent() { final IRI resource = rdf.createIRI(identifier); final Instant time = now(); final Event event = new SimpleEvent(identifier, agent, asList(PROV.Activity, AS.Create), asList(LDP.RDFSource, SKOS.Concept)); assertFalse(time.isAfter(event.getCreated()), "Non-sequential events!"); assertTrue(event.getIdentifier().getIRIString().startsWith("urn:uuid:"), "Incorrect ID prefix for event!"); assertEquals(of(resource), event.getObject(), "Incorrect target resource!"); assertEquals(1L, event.getAgents().size(), "Incorrect agent count!"); assertTrue(event.getAgents().contains(agent), "Incorrect agent value!"); final Collection<IRI> targetTypes = event.getObjectTypes(); assertEquals(2L, targetTypes.size(), "Incorrect target type size!"); assertTrue(targetTypes.contains(LDP.RDFSource), "Missing ldp:RDFSource type!"); assertTrue(targetTypes.contains(SKOS.Concept), "Missing skos:Concept type!"); final Collection<IRI> eventTypes = event.getTypes(); assertEquals(2L, eventTypes.size(), "Incorrect event type size!"); assertTrue(eventTypes.contains(AS.Create), "Missing as:Create from event type!"); assertTrue(eventTypes.contains(PROV.Activity), "Missing prov:Activity from event type!"); assertFalse(event.getInbox().isPresent()); }
public SimpleEvent(final String object, final IRI agent, final List<IRI> activityTypes, final List<IRI> objectTypes) { this.object = rdf.createIRI(object); this.identifier = rdf.createIRI("urn:uuid:" + randomUUID()); this.agent = agent; this.activityTypes = activityTypes; this.created = now(); this.objectTypes = objectTypes; }
SimpleEvent implements Event { public SimpleEvent(final String object, final IRI agent, final List<IRI> activityTypes, final List<IRI> objectTypes) { this.object = rdf.createIRI(object); this.identifier = rdf.createIRI("urn:uuid:" + randomUUID()); this.agent = agent; this.activityTypes = activityTypes; this.created = now(); this.objectTypes = objectTypes; } }
SimpleEvent implements Event { public SimpleEvent(final String object, final IRI agent, final List<IRI> activityTypes, final List<IRI> objectTypes) { this.object = rdf.createIRI(object); this.identifier = rdf.createIRI("urn:uuid:" + randomUUID()); this.agent = agent; this.activityTypes = activityTypes; this.created = now(); this.objectTypes = objectTypes; } SimpleEvent(final String object, final IRI agent, final List<IRI> activityTypes,
            final List<IRI> objectTypes); }
SimpleEvent implements Event { public SimpleEvent(final String object, final IRI agent, final List<IRI> activityTypes, final List<IRI> objectTypes) { this.object = rdf.createIRI(object); this.identifier = rdf.createIRI("urn:uuid:" + randomUUID()); this.agent = agent; this.activityTypes = activityTypes; this.created = now(); this.objectTypes = objectTypes; } SimpleEvent(final String object, final IRI agent, final List<IRI> activityTypes,
            final List<IRI> objectTypes); @Override IRI getIdentifier(); @Override Collection<IRI> getAgents(); @Override Optional<IRI> getObject(); @Override Collection<IRI> getTypes(); @Override Collection<IRI> getObjectTypes(); @Override Instant getCreated(); @Override Optional<IRI> getInbox(); }
SimpleEvent implements Event { public SimpleEvent(final String object, final IRI agent, final List<IRI> activityTypes, final List<IRI> objectTypes) { this.object = rdf.createIRI(object); this.identifier = rdf.createIRI("urn:uuid:" + randomUUID()); this.agent = agent; this.activityTypes = activityTypes; this.created = now(); this.objectTypes = objectTypes; } SimpleEvent(final String object, final IRI agent, final List<IRI> activityTypes,
            final List<IRI> objectTypes); @Override IRI getIdentifier(); @Override Collection<IRI> getAgents(); @Override Optional<IRI> getObject(); @Override Collection<IRI> getTypes(); @Override Collection<IRI> getObjectTypes(); @Override Instant getCreated(); @Override Optional<IRI> getInbox();  }