use of com.ibm.watson.discovery.v1.model.EventData in project alfresco-java-sdk by Alfresco.
the class NodeAspectFilterTest method should_testFalse_when_eventWithoutAcceptedAspectIsSent.
@Test
public void should_testFalse_when_eventWithoutAcceptedAspectIsSent() {
final NodeResource nodeResource = NodeResource.builder().setAspectNames(Set.of("test:other", "test:another")).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 = nodeAspectFilter.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 NodeAspectFilterTest method should_testFalse_when_eventWithoutAspectsIsSent.
@Test
public void should_testFalse_when_eventWithoutAspectsIsSent() {
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 = nodeAspectFilter.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 AspectAddedFilterTest method should_testFalse_when_eventWithAspectAlreadyAddedIsSent.
@Test
public void should_testFalse_when_eventWithAspectAlreadyAddedIsSent() {
final NodeResource nodeResource = NodeResource.builder().setAspectNames(Set.of(TEST_ASPECT, "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 = aspectAddedFilter.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 AspectAddedFilterTest method should_testFalse_when_eventWithoutAspectAddedIsSent.
@Test
public void should_testFalse_when_eventWithoutAspectAddedIsSent() {
final NodeResource nodeResource = NodeResource.builder().setAspectNames(Set.of("test:other", "test:another")).build();
final NodeResource nodeResourceBefore = NodeResource.builder().setAspectNames(Set.of("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 = aspectAddedFilter.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 AspectAddedFilterTest method should_testTrue_when_eventWithAspectAddedIsSent.
@Test
public void should_testTrue_when_eventWithAspectAddedIsSent() {
final NodeResource nodeResource = NodeResource.builder().setAspectNames(Set.of(TEST_ASPECT, "test:other")).build();
final NodeResource nodeResourceBefore = NodeResource.builder().setAspectNames(Set.of("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 = aspectAddedFilter.test((RepoEvent<DataAttributes<Resource>>) repoEvent);
assertThat(result).isTrue();
}
Aggregations