File tree Expand file tree Collapse file tree
main/java/com/ibm/cloud/cloudant/internal
test/java/com/ibm/cloud/cloudant/internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public Response intercept(Chain chain) throws IOException {
3232 // Don't modify the request, but get the response
3333 Response response = chain .proceed (chain .request ());
3434 if (!response .isSuccessful () // skip successful responses
35- && response .body () != null // skip cases with no body
35+ && response .body () != null && ! ResponseBody . EMPTY . equals ( response . body ()) // skip cases with no body
3636 && response .body ().contentType () != null // skip cases with no content type
3737 && "application" .equals (response .body ().contentType ().type ())
3838 && "json" .equals (response .body ().contentType ().subtype ()) // we only want to work with application/json
Original file line number Diff line number Diff line change 3737import com .google .gson .JsonObject ;
3838import com .ibm .cloud .sdk .core .security .NoAuthAuthenticator ;
3939import com .ibm .cloud .sdk .core .util .GsonSingleton ;
40- import static org .junit .Assert .assertNull ;
4140import static org .testng .Assert .assertEquals ;
4241import static org .testng .Assert .assertFalse ;
4342import static org .testng .Assert .assertTrue ;
@@ -340,7 +339,7 @@ void runTest(Interceptor interceptor) throws IOException {
340339 } else {
341340 // If we aren't asserting a specific part of augment check the body is unchanged
342341 if ("HEAD" == r .request ().method ()) {
343- assertNull (r .body ());
342+ assertEquals (r .body (), ResponseBody . EMPTY );
344343 } else {
345344 assertEquals (r .body ().string (), responseBody );
346345 }
You can’t perform that action at this time.
0 commit comments