From 2bed28842d8eaed7e736bd5222e1c43b23f5d5ae Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Tue, 20 Sep 2016 07:46:10 +0200 Subject: [PATCH] DATAREST-902 - Fixed order depending DuplicateLinkListingTest. We now use the explicit identifier of the person just created, not a fixed 1 as other tests might have used that identifier already and that entity is not available anymore as a transaction rollback occured in those tests. --- .../data/rest/webmvc/DuplicateLinkListingTests.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/DuplicateLinkListingTests.java b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/DuplicateLinkListingTests.java index 8b81a48df..82bca4729 100644 --- a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/DuplicateLinkListingTests.java +++ b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/DuplicateLinkListingTests.java @@ -93,7 +93,8 @@ public class DuplicateLinkListingTests { @Test public void testBasics() throws Exception { - ResultActions frodoActions = testMvcClient.follow("/people/1"); + Person person = personRepository.findAll().iterator().next(); + ResultActions frodoActions = testMvcClient.follow("/people/" + person.getId()); frodoActions.andExpect(jsonPath("$.links").value(hasSize(4))); }