diff --git a/gwtp-core/gwtp-mvp-client/src/main/java/com/gwtplatform/mvp/client/proxy/PlaceRequest.java b/gwtp-core/gwtp-mvp-client/src/main/java/com/gwtplatform/mvp/client/proxy/PlaceRequest.java index cf2b6544a3..696a185a44 100644 --- a/gwtp-core/gwtp-mvp-client/src/main/java/com/gwtplatform/mvp/client/proxy/PlaceRequest.java +++ b/gwtp-core/gwtp-mvp-client/src/main/java/com/gwtplatform/mvp/client/proxy/PlaceRequest.java @@ -166,6 +166,11 @@ public int hashCode() { return 11 * (nameToken.hashCode() + (params == null ? 0 : params.hashCode())); } + @Override + public String toString() { + return "PlaceRequest(nameToken=" + nameToken + ", params=" + params + ")"; + } + /** * Checks if this place request has the same name token as the one passed in. * diff --git a/gwtp-core/gwtp-mvp-client/src/test/java/com/gwtplatform/mvp/client/proxy/PlaceRequestTest.java b/gwtp-core/gwtp-mvp-client/src/test/java/com/gwtplatform/mvp/client/proxy/PlaceRequestTest.java index 28eaa8bac4..5a7b23611b 100644 --- a/gwtp-core/gwtp-mvp-client/src/test/java/com/gwtplatform/mvp/client/proxy/PlaceRequestTest.java +++ b/gwtp-core/gwtp-mvp-client/src/test/java/com/gwtplatform/mvp/client/proxy/PlaceRequestTest.java @@ -75,4 +75,18 @@ public void shouldBuildRequestWithParameterMap() { assertEquals("value2", request.getParameter("name2", "")); assertEquals("value3", request.getParameter("name3", "")); } + + @Test + public void testToString() { + // when + PlaceRequest request = new PlaceRequest.Builder().nameToken("nameToken").with("name1", "value1") + .with("name2", "value2").build(); + + // then + assertNotNull(request); + assertNotNull(request.toString()); + assertEquals("PlaceRequest(nameToken=nameToken, params={name1=value1, name2=value2})", + request.toString()); + } } +