use of com.ibm.watson.discovery.v1.model.EventData in project alfresco-java-sdk by Alfresco.
the class PropertyChangedFilterTest 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 = propertyChangedFilter.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 PropertyChangedFilterTest method should_testTrue_when_propertyChangedEventIsSent.
@Test
public void should_testTrue_when_propertyChangedEventIsSent() {
final NodeResource nodeResource = NodeResource.builder().setProperties(Map.of(TEST_PROPERTY, TEST_VALUE)).build();
final NodeResource nodeBeforeResource = NodeResource.builder().setProperties(Map.of(TEST_PROPERTY, "other")).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 = propertyChangedFilter.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 PropertyChangedFilterTest method should_testFalse_when_eventWithoutPropertyChangedIsSent.
@Test
public void should_testFalse_when_eventWithoutPropertyChangedIsSent() {
final NodeResource nodeResource = NodeResource.builder().setProperties(Map.of(TEST_PROPERTY, TEST_VALUE)).build();
final NodeResource nodeBeforeResource = NodeResource.builder().setProperties(Map.of(TEST_PROPERTY, TEST_VALUE)).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 = propertyChangedFilter.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 ContentAddedFilterTest method should_testTrue_when_contentAddedEventIsSent.
@Test
public void should_testTrue_when_contentAddedEventIsSent() {
final NodeResource nodeResource = NodeResource.builder().build();
final NodeResource nodeBeforeResource = NodeResource.builder().setContent(new ContentInfo()).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).isTrue();
}
use of com.ibm.watson.discovery.v1.model.EventData in project alfresco-java-sdk by Alfresco.
the class ContentAddedFilterTest 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 = contentAddedFilter.test((RepoEvent<DataAttributes<Resource>>) repoEvent);
assertThat(result).isFalse();
}
Aggregations