use of com.ibm.watson.discovery.v1.model.EventData in project alfresco-java-sdk by Alfresco.
the class ContentAddedFilterTest method should_testFalse_when_eventWithContentDetailsIsSent.
@Test
public void should_testFalse_when_eventWithContentDetailsIsSent() {
final NodeResource nodeResource = NodeResource.builder().setContent(new ContentInfo("test/test", 1l, "UTF-8")).build();
final NodeResource nodeBeforeResource = NodeResource.builder().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 = contentAddedFilter.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 ContentChangedFilterTest method should_testFalse_when_eventWithoutContentIsSent.
@Test
public void should_testFalse_when_eventWithoutContentIsSent() {
final NodeResource nodeResource = NodeResource.builder().build();
final NodeResource nodeBeforeResource = NodeResource.builder().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 = contentChangedFilter.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 IsFileFilterTest method should_testTrue_when_fileEventIsSent.
@Test
public void should_testTrue_when_fileEventIsSent() {
final NodeResource nodeResource = NodeResource.builder().setIsFile(true).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 = isFileFilter.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 IsFolderFilterTest method should_testTrue_when_folderEventIsSent.
@Test
public void should_testTrue_when_folderEventIsSent() {
final NodeResource nodeResource = NodeResource.builder().setIsFolder(true).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 = isFolderFilter.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 NodeAspectFilterTest method should_testTrue_when_eventWithAcceptedAspectIsSent.
@Test
public void should_testTrue_when_eventWithAcceptedAspectIsSent() {
final NodeResource nodeResource = NodeResource.builder().setAspectNames(Set.of(TEST_ASPECT, "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 = nodeAspectFilter.test((RepoEvent<DataAttributes<Resource>>) repoEvent);
assertThat(result).isTrue();
}
Aggregations