Skip to content

Fluent assertions for writing integration (remote unit) tests for Alfresco

License

Notifications You must be signed in to change notification settings

ixxus/alfresco-test-assertions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ixxus

Alfresco Test Assertions

License

Fluent assertions for writing integration (remote unit) tests for Alfresco.

Syntax

Using the com.ixxus.alfresco.NodeAssert, assertions on nodes can be written like this:

assertThat(nodeRef).exists().hasAspect(ContentModel.ASPECT_EMAILED).hasPropertyValue(ContentModel.PROP_NAME, "This is a node's name");
Condition<Serializable> startsWithTitle = new Condition<>(value -> ((String) value).startsWith("title"), "Should start with 'title'");
assertThat(nodeRef).exists().propertyValue(ContentModel.PROP_TITLE, startsWithTitle);

For more examples, check out com.ixxus.alfresco.NodeAssertTest.

There's also a custom assertion for testing:

How to include the library

We are still working on deploying to maven central. At the mean time, we suggest to clone the repository and build locally.

mvn clean install

Then include as a maven dependency

<dependency>
    <groupId>com.ixxus.alfresco</groupId>
    <artifactId>alfresco-test-assertions</artifactId>
    <version><PLEASE SEE POM.XML FOR VERSION></version>
    <scope>test</scope>
</dependency>

Change log

Unreleased

Added

  • AssertJ Conditions for NodeAssert
  • WorkflowAssert in the same style as NodeAssert/SiteAssert

[1] - 2017-06-05

Added

  • Node assertion
  • Site assertion