Add expected embedded in the search test

This commit is contained in:
Andrea Bollini
2020-03-20 18:28:30 +01:00
parent f0210c5a46
commit 59b7716725

View File

@@ -381,6 +381,12 @@ public class AuthorizationRestRepositoryIT extends AbstractControllerIntegration
.andExpect(jsonPath("$._embedded.authorizations", Matchers.everyItem(
Matchers.anyOf(
JsonPathMatchers.hasJsonPath("$.type", is("authorization")),
JsonPathMatchers.hasJsonPath("$._embedded.feature",
Matchers.allOf(
is(alwaysTrue.getName()),
is(trueForAdmins.getName()),
is(trueForLoggedUsers.getName())
)),
JsonPathMatchers.hasJsonPath("$._embedded.feature",
Matchers.not(Matchers.anyOf(
is(alwaysFalse.getName()),
@@ -414,6 +420,11 @@ public class AuthorizationRestRepositoryIT extends AbstractControllerIntegration
.andExpect(jsonPath("$._embedded.authorizations", Matchers.everyItem(
Matchers.anyOf(
JsonPathMatchers.hasJsonPath("$.type", is("authorization")),
JsonPathMatchers.hasJsonPath("$._embedded.feature",
Matchers.allOf(
is(alwaysTrue.getName()),
is(trueForLoggedUsers.getName())
)),
JsonPathMatchers.hasJsonPath("$._embedded.feature",
Matchers.not(Matchers.anyOf(
is(alwaysFalse.getName()),
@@ -447,6 +458,11 @@ public class AuthorizationRestRepositoryIT extends AbstractControllerIntegration
.andExpect(jsonPath("$._embedded.authorizations", Matchers.everyItem(
Matchers.anyOf(
JsonPathMatchers.hasJsonPath("$.type", is("authorization")),
JsonPathMatchers.hasJsonPath("$._embedded.feature",
Matchers.allOf(
is(alwaysTrue.getName()),
is(trueForLoggedUsers.getName())
)),
JsonPathMatchers.hasJsonPath("$._embedded.feature",
Matchers.not(Matchers.anyOf(
is(alwaysFalse.getName()),
@@ -482,6 +498,10 @@ public class AuthorizationRestRepositoryIT extends AbstractControllerIntegration
.andExpect(jsonPath("$._embedded.authorizations", Matchers.everyItem(
Matchers.anyOf(
JsonPathMatchers.hasJsonPath("$.type", is("authorization")),
JsonPathMatchers.hasJsonPath("$._embedded.feature",
Matchers.allOf(
is(alwaysTrue.getName())
)),
JsonPathMatchers.hasJsonPath("$._embedded.feature",
Matchers.not(Matchers.anyOf(
is(alwaysFalse.getName()),