Skip to content

Commit

Permalink
chore(deps): update project.http.version to v1.35.0 (#1522)
Browse files Browse the repository at this point in the history
* chore(deps): update project.http.version to v1.35.0

* test: stop asserting on full error message

Co-authored-by: Jeff Ching <chingor@google.com>
  • Loading branch information
renovate-bot and chingor13 committed Jul 8, 2020
1 parent 1961398 commit 47d0018
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -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 {
Expand All @@ -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 {
Expand All @@ -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("<foo>"));
}

public void testFrom_errorNoContentButWithJsonContentType() throws Exception {
Expand All @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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"));
}
}
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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"));
}
}

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -449,7 +449,7 @@
</build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.http.version>1.34.2</project.http.version>
<project.http.version>1.35.0</project.http.version>
<project.oauth.version>1.31.0</project.oauth.version>
<project.jsr305.version>3.0.2</project.jsr305.version>
<project.gson.version>2.8.6</project.gson.version>
Expand Down

0 comments on commit 47d0018

Please sign in to comment.