diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/json/GoogleJsonResponseExceptionTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/json/GoogleJsonResponseExceptionTest.java index e61b421fb..2ac373126 100644 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/json/GoogleJsonResponseExceptionTest.java +++ b/google-api-client/src/test/java/com/google/api/client/googleapis/json/GoogleJsonResponseExceptionTest.java @@ -42,7 +42,7 @@ public void testFrom_noDetails() throws Exception { GoogleJsonResponseException ge = GoogleJsonResponseException.from(GoogleJsonErrorTest.FACTORY, response); assertNull(ge.getDetails()); - assertEquals("200", ge.getMessage()); + assertTrue(ge.getMessage().startsWith("200")); } public void testFrom_withDetails() throws Exception { @@ -54,8 +54,7 @@ public void testFrom_withDetails() throws Exception { GoogleJsonResponseException ge = GoogleJsonResponseException.from(GoogleJsonErrorTest.FACTORY, response); assertEquals(GoogleJsonErrorTest.ERROR, GoogleJsonErrorTest.FACTORY.toString(ge.getDetails())); - assertTrue( - ge.getMessage(), ge.getMessage().startsWith("403" + StringUtils.LINE_SEPARATOR + "{")); + assertTrue(ge.getMessage().startsWith("403")); } public void testFrom_detailsMissingContent() throws Exception { @@ -67,7 +66,7 @@ public void testFrom_detailsMissingContent() throws Exception { GoogleJsonResponseException ge = GoogleJsonResponseException.from(GoogleJsonErrorTest.FACTORY, response); assertNull(ge.getDetails()); - assertEquals("403", ge.getMessage()); + assertTrue(ge.getMessage().startsWith("403")); } public void testFrom_detailsArbitraryJsonContent() throws Exception { @@ -79,7 +78,7 @@ public void testFrom_detailsArbitraryJsonContent() throws Exception { GoogleJsonResponseException ge = GoogleJsonResponseException.from(GoogleJsonErrorTest.FACTORY, response); assertNull(ge.getDetails()); - assertEquals("403", ge.getMessage()); + assertTrue(ge.getMessage().startsWith("403")); } public void testFrom_detailsArbitraryXmlContent() throws Exception { @@ -91,8 +90,8 @@ public void testFrom_detailsArbitraryXmlContent() throws Exception { GoogleJsonResponseException ge = GoogleJsonResponseException.from(GoogleJsonErrorTest.FACTORY, response); assertNull(ge.getDetails()); - assertTrue( - ge.getMessage(), ge.getMessage().startsWith("403" + StringUtils.LINE_SEPARATOR + "<")); + assertTrue(ge.getMessage().startsWith("403")); + assertTrue(ge.getMessage().contains("")); } public void testFrom_errorNoContentButWithJsonContentType() throws Exception { @@ -104,7 +103,7 @@ public void testFrom_errorNoContentButWithJsonContentType() throws Exception { GoogleJsonResponseException ge = GoogleJsonResponseException.from(GoogleJsonErrorTest.FACTORY, response); assertNull(ge.getDetails()); - assertEquals("403", ge.getMessage()); + assertTrue(ge.getMessage().startsWith("403")); } public void testFrom_errorEmptyContentButWithJsonContentType() throws Exception { @@ -116,7 +115,7 @@ public void testFrom_errorEmptyContentButWithJsonContentType() throws Exception GoogleJsonResponseException ge = GoogleJsonResponseException.from(GoogleJsonErrorTest.FACTORY, response); assertNull(ge.getDetails()); - assertEquals("403", ge.getMessage()); + assertTrue(ge.getMessage().startsWith("403")); } public void testFrom_detailsErrorObject() throws Exception { @@ -154,6 +153,6 @@ public void testFrom_detailsNoErrorField() throws Exception { GoogleJsonResponseException ge = GoogleJsonResponseException.from(GoogleJsonErrorTest.FACTORY, response); assertNull(ge.getDetails()); - assertEquals("403", ge.getMessage()); + assertTrue(ge.getMessage().startsWith("403")); } } diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/services/AbstractGoogleClientRequestTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/services/AbstractGoogleClientRequestTest.java index 3a87c4279..748e02f44 100644 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/services/AbstractGoogleClientRequestTest.java +++ b/google-api-client/src/test/java/com/google/api/client/googleapis/services/AbstractGoogleClientRequestTest.java @@ -31,13 +31,11 @@ import com.google.api.client.testing.http.MockHttpTransport; import com.google.api.client.testing.http.MockLowLevelHttpRequest; import com.google.api.client.testing.http.MockLowLevelHttpResponse; -import com.google.api.client.util.StringUtils; import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Arrays; -import java.util.zip.GZIPInputStream; import junit.framework.TestCase; /** @@ -106,7 +104,7 @@ public LowLevelHttpResponse execute() { fail("expected " + HttpResponseException.class); } catch (HttpResponseException e) { // expected - assertEquals("401" + StringUtils.LINE_SEPARATOR + ERROR_CONTENT, e.getMessage()); + assertTrue(e.getMessage().startsWith("401")); } } diff --git a/pom.xml b/pom.xml index 323d93dd4..d3975eb45 100644 --- a/pom.xml +++ b/pom.xml @@ -449,7 +449,7 @@ UTF-8 - 1.34.2 + 1.35.0 1.31.0 3.0.2 2.8.6