use of com.ibm.watson.discovery.v1.model.EventData in project alfresco-java-sdk by Alfresco.
the class NodeTypeChangedFilterTest method should_testFalse_when_eventWithoutNodeTypeChangeIsSent.
@Test
public void should_testFalse_when_eventWithoutNodeTypeChangeIsSent() {
final NodeResource nodeResource = NodeResource.builder().setNodeType("test:type").build();
final NodeResource nodeBeforeResource = NodeResource.builder().setNodeType("test:type").build();
final EventData<NodeResource> eventData = EventData.<NodeResource>builder().setResource(nodeResource).setResourceBefore(nodeBeforeResource).build();
final RepoEvent<? extends DataAttributes<? extends Resource>> repoEvent = RepoEvent.<EventData<NodeResource>>builder().setData(eventData).build();
final boolean result = nodeTypeChangedFilter.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 NodeTypeChangedFilterTest method should_testFalse_when_eventWithoutResourceBeforeIsSent.
@Test
public void should_testFalse_when_eventWithoutResourceBeforeIsSent() {
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 = nodeTypeChangedFilter.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 NodeTypeFilterTest method should_testFalse_when_eventWithNoAcceptedTypeIsSent.
@Test
public void should_testFalse_when_eventWithNoAcceptedTypeIsSent() {
final NodeResource nodeResource = NodeResource.builder().setNodeType("test:other").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 = nodeTypeFilter.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 NodeTypeFilterTest method should_testFalse_when_noNodeEventIsSent.
@Test
public void should_testFalse_when_noNodeEventIsSent() {
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 = nodeTypeFilter.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 PropertyAddedFilterTest method should_testTrue_when_propertyAddedEventIsSent.
@Test
public void should_testTrue_when_propertyAddedEventIsSent() {
final NodeResource nodeResource = NodeResource.builder().setProperties(Map.of(TEST_PROPERTY, TEST_VALUE)).build();
final NodeResource nodeBeforeResource = NodeResource.builder().setProperties(Collections.EMPTY_MAP).build();
final EventData<NodeResource> eventData = EventData.<NodeResource>builder().setResource(nodeResource).setResourceBefore(nodeBeforeResource).build();
final RepoEvent<? extends DataAttributes<? extends Resource>> repoEvent = RepoEvent.<EventData<NodeResource>>builder().setData(eventData).build();
final boolean result = propertyAddedFilter.test((RepoEvent<DataAttributes<Resource>>) repoEvent);
assertThat(result).isTrue();
}
Aggregations