use of com.ibm.watson.discovery.v1.model.EventData in project alfresco-java-sdk by Alfresco.
the class AspectRemovedFilterTest method should_testFalse_when_eventWithoutAspectRemovedIsSent.
@Test
public void should_testFalse_when_eventWithoutAspectRemovedIsSent() {
final NodeResource nodeResource = NodeResource.builder().setAspectNames(Set.of("test:other")).build();
final NodeResource nodeResourceBefore = NodeResource.builder().setAspectNames(Set.of("test:other", "test:another")).build();
final EventData<NodeResource> eventData = EventData.<NodeResource>builder().setResource(nodeResource).setResourceBefore(nodeResourceBefore).build();
final RepoEvent<? extends DataAttributes<? extends Resource>> repoEvent = RepoEvent.<EventData<NodeResource>>builder().setData(eventData).build();
final boolean result = aspectRemovedFilter.test((RepoEvent<DataAttributes<Resource>>) repoEvent);
assertThat(result).isFalse();
}
use of com.ibm.watson.discovery.v1.model.EventData in project alfresco-java-sdk by Alfresco.
the class AspectRemovedFilterTest method should_testTrue_when_eventWithAspectRemovedIsSent.
@Test
public void should_testTrue_when_eventWithAspectRemovedIsSent() {
final NodeResource nodeResource = NodeResource.builder().setAspectNames(Set.of("test:other")).build();
final NodeResource nodeResourceBefore = NodeResource.builder().setAspectNames(Set.of(TEST_ASPECT, "test:other")).build();
final EventData<NodeResource> eventData = EventData.<NodeResource>builder().setResource(nodeResource).setResourceBefore(nodeResourceBefore).build();
final RepoEvent<? extends DataAttributes<? extends Resource>> repoEvent = RepoEvent.<EventData<NodeResource>>builder().setData(eventData).build();
final boolean result = aspectRemovedFilter.test((RepoEvent<DataAttributes<Resource>>) repoEvent);
assertThat(result).isTrue();
}
use of com.ibm.watson.discovery.v1.model.EventData in project alfresco-java-sdk by Alfresco.
the class AspectRemovedFilterTest method should_testFalse_when_eventWithoutAspectsIsSent.
@Test
public void should_testFalse_when_eventWithoutAspectsIsSent() {
final NodeResource nodeResource = NodeResource.builder().build();
final NodeResource nodeResourceBefore = NodeResource.builder().build();
final EventData<NodeResource> eventData = EventData.<NodeResource>builder().setResource(nodeResource).setResourceBefore(nodeResourceBefore).build();
final RepoEvent<? extends DataAttributes<? extends Resource>> repoEvent = RepoEvent.<EventData<NodeResource>>builder().setData(eventData).build();
final boolean result = aspectRemovedFilter.test((RepoEvent<DataAttributes<Resource>>) repoEvent);
assertThat(result).isFalse();
}
use of com.ibm.watson.discovery.v1.model.EventData in project alfresco-java-sdk by Alfresco.
the class AssocTypeFilterTest method should_testFalse_when_noAssocEventIsSent.
@Test
public void should_testFalse_when_noAssocEventIsSent() {
final NodeResource nodeResource = NodeResource.builder().build();
final EventData<NodeResource> eventData = EventData.<NodeResource>builder().setResource(nodeResource).build();
final RepoEvent<? extends DataAttributes<? extends Resource>> repoEvent = RepoEvent.<EventData<NodeResource>>builder().setData(eventData).build();
final boolean result = assocTypeFilter.test((RepoEvent<DataAttributes<Resource>>) repoEvent);
assertThat(result).isFalse();
}
use of com.ibm.watson.discovery.v1.model.EventData in project alfresco-java-sdk by Alfresco.
the class AssocTypeFilterTest method should_testFalse_when_assocEventWithNotCorrespondingAssocTypeIsSent.
@Test
public void should_testFalse_when_assocEventWithNotCorrespondingAssocTypeIsSent() {
final PeerAssociationResource peerAssociationResource = new PeerAssociationResource("source-id", "target-id", "test:other");
final EventData<PeerAssociationResource> eventData = EventData.<PeerAssociationResource>builder().setResource(peerAssociationResource).build();
final RepoEvent<? extends DataAttributes<? extends Resource>> repoEvent = RepoEvent.<EventData<PeerAssociationResource>>builder().setData(eventData).build();
final boolean result = assocTypeFilter.test((RepoEvent<DataAttributes<Resource>>) repoEvent);
assertThat(result).isFalse();
}
Aggregations