From d8521fde9e42c65b1e9347580e06380c578a6fff Mon Sep 17 00:00:00 2001 From: Benjamin Gamard Date: Tue, 16 Apr 2019 14:47:22 +0200 Subject: [PATCH] mock repository query --- CHANGELOG.md | 2 ++ README.md | 2 +- app/helpers/api/nuxeo/mock/MockRepository.java | 5 +++++ conf/dependencies.yml | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bdba63a..f5b791a 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/README.md b/README.md index 4863d0f..f9bab54 100755 --- a/README.md +++ b/README.md @@ -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: diff --git a/app/helpers/api/nuxeo/mock/MockRepository.java b/app/helpers/api/nuxeo/mock/MockRepository.java index 66f604d..f728e4d 100755 --- a/app/helpers/api/nuxeo/mock/MockRepository.java +++ b/app/helpers/api/nuxeo/mock/MockRepository.java @@ -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; @@ -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; } } diff --git a/conf/dependencies.yml b/conf/dependencies.yml index 606a3b5..b9a4ebe 100755 --- a/conf/dependencies.yml +++ b/conf/dependencies.yml @@ -1,4 +1,4 @@ -self: play -> nuxeo 1.1.0 +self: play -> nuxeo 1.1.1 configurations: - provided: