Skip to content

Commit

Permalink
mock repository query
Browse files Browse the repository at this point in the history
  • Loading branch information
jendib committed Apr 16, 2019
1 parent 37ba8af commit d8521fd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## Change Log
### Version 1.1.1 (2019-04-16)
- Mock repository query
### Version 1.1.0 (2019-04-15)
- Automate build
### Version 1.0.1 (2019-03-04)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This plugin adds [Nuxeo](https://www.nuxeo.com/) support to Play! Framework 1 ap

```
require:
- nuxeo -> nuxeo 1.1.0
- nuxeo -> nuxeo 1.1.1
repositories:
- sismicsNexusRaw:
Expand Down
5 changes: 5 additions & 0 deletions app/helpers/api/nuxeo/mock/MockRepository.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package helpers.api.nuxeo.mock;

import com.google.common.collect.Lists;
import com.sismics.sapparot.reflection.ReflectionUtil;
import org.nuxeo.client.objects.Document;
import org.nuxeo.client.objects.Documents;
import org.nuxeo.client.objects.Repository;
import play.libs.Codec;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
Expand Down Expand Up @@ -55,6 +58,8 @@ public static Repository create() {
return documentByPathMap.get(path);
});

when(repository.query(any(String.class))).thenAnswer(i -> new Documents(Lists.newArrayList(Document.createWithId(UUID.randomUUID().toString(), "Document"))));

return repository;
}
}
2 changes: 1 addition & 1 deletion conf/dependencies.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
self: play -> nuxeo 1.1.0
self: play -> nuxeo 1.1.1

configurations:
- provided:
Expand Down

0 comments on commit d8521fd

Please sign in to comment.