From a7b672a64a5106248c6438109f35e20a5aa4cc78 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Mon, 18 May 2015 19:45:46 +0200 Subject: [PATCH] DATAREST-549 - Added @JsonIgnore to RepositorySearchesResource.getDomainType(). --- .../data/rest/webmvc/RepositorySearchesResource.java | 3 +++ .../org/springframework/data/rest/webmvc/CommonWebTests.java | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositorySearchesResource.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositorySearchesResource.java index ad33a0f7c..0c352a49b 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositorySearchesResource.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositorySearchesResource.java @@ -19,6 +19,8 @@ import org.springframework.hateoas.ResourceProcessor; import org.springframework.hateoas.ResourceSupport; import org.springframework.util.Assert; +import com.fasterxml.jackson.annotation.JsonIgnore; + /** * A custom {@link ResourceSupport} type to be able to write custom {@link ResourceProcessor}s to add additional links * to ones automatically exposed for Spring Data repository query methods. @@ -45,6 +47,7 @@ public class RepositorySearchesResource extends ResourceSupport { * * @return */ + @JsonIgnore public Class getDomainType() { return domainType; } diff --git a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/CommonWebTests.java b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/CommonWebTests.java index 7ecf83a29..0cf6dfe5f 100644 --- a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/CommonWebTests.java +++ b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/CommonWebTests.java @@ -119,7 +119,9 @@ public abstract class CommonWebTests extends AbstractWebIntegrationTests { Link searchLink = client.getDiscoverer(response).findLinkWithRel("search", rootResourceRepresentation); if (searchLink != null) { - client.follow(searchLink).andExpect(client.hasLinkWithRel("self")); + client.follow(searchLink).// + andExpect(client.hasLinkWithRel("self")).// + andExpect(jsonPath("$.domainType", is(nullValue()))); // DATAREST-549 } } }