use of org.alfresco.event.sdk.model.v1.model.EventData in project alfresco-java-sdk by Alfresco.
the class PropertyCurrentValueFilterTest method should_testFalse_when_eventWithoutPropertiesIsSent.
@Test
public void should_testFalse_when_eventWithoutPropertiesIsSent() {
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 = propertyCurrentValueFilter.test((RepoEvent<DataAttributes<Resource>>) repoEvent);
assertThat(result).isFalse();
}
use of org.alfresco.event.sdk.model.v1.model.EventData in project alfresco-java-sdk by Alfresco.
the class PropertyCurrentValueFilterTest method should_testFalse_when_eventWithCorrespondingPropertyWithNotAcceptedValueIsSent.
@Test
public void should_testFalse_when_eventWithCorrespondingPropertyWithNotAcceptedValueIsSent() {
final Map<String, Serializable> properties = new HashMap<>();
properties.put(TEST_PROPERTY, "other");
final NodeResource nodeResource = NodeResource.builder().setProperties(properties).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 = propertyCurrentValueFilter.test((RepoEvent<DataAttributes<Resource>>) repoEvent);
assertThat(result).isFalse();
}
use of org.alfresco.event.sdk.model.v1.model.EventData in project alfresco-java-sdk by Alfresco.
the class PropertyCurrentValueFilterTest method should_testTrue_when_eventWithCorrespondingPropertyAndValueIsSent.
@Test
public void should_testTrue_when_eventWithCorrespondingPropertyAndValueIsSent() {
final Map<String, Serializable> properties = new HashMap<>();
properties.put(TEST_PROPERTY, TEST_VALUE);
final NodeResource nodeResource = NodeResource.builder().setProperties(properties).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 = propertyCurrentValueFilter.test((RepoEvent<DataAttributes<Resource>>) repoEvent);
assertThat(result).isTrue();
}
use of org.alfresco.event.sdk.model.v1.model.EventData in project alfresco-java-sdk by Alfresco.
the class PropertyCurrentValueFilterTest method should_testFalse_when_eventWithoutCorrespondingPropertyIsSent.
@Test
public void should_testFalse_when_eventWithoutCorrespondingPropertyIsSent() {
final Map<String, Serializable> properties = new HashMap<>();
properties.put("test:other", TEST_VALUE);
final NodeResource nodeResource = NodeResource.builder().setProperties(properties).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 = propertyCurrentValueFilter.test((RepoEvent<DataAttributes<Resource>>) repoEvent);
assertThat(result).isFalse();
}
use of org.alfresco.event.sdk.model.v1.model.EventData in project alfresco-java-sdk by Alfresco.
the class PropertyPreviousValueFilterTest method should_testTrue_when_eventWithCorrespondingPropertyAndPreviousValueIsSent.
@Test
public void should_testTrue_when_eventWithCorrespondingPropertyAndPreviousValueIsSent() {
final Map<String, Serializable> properties = new HashMap<>();
properties.put(TEST_PROPERTY, TEST_VALUE);
final NodeResource nodeResourceBefore = NodeResource.builder().setProperties(properties).build();
final NodeResource nodeResource = NodeResource.builder().build();
final EventData<NodeResource> eventData = EventData.<NodeResource>builder().setResourceBefore(nodeResourceBefore).setResource(nodeResource).build();
final RepoEvent<? extends DataAttributes<? extends Resource>> repoEvent = RepoEvent.<EventData<NodeResource>>builder().setData(eventData).build();
final boolean result = propertyPreviousValueFilter.test((RepoEvent<DataAttributes<Resource>>) repoEvent);
assertThat(result).isTrue();
}
Aggregations