From f11518fa1e6e71237c53475edea2cf0f187f4a8d Mon Sep 17 00:00:00 2001 From: Adam Lowe Date: Thu, 10 May 2012 15:21:48 +0100 Subject: [PATCH] Adding requestLine check to ensure all HttpRequestComparisonTypes compare endpoints and methods --- .../jclouds/rest/internal/BaseRestClientExpectTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/test/java/org/jclouds/rest/internal/BaseRestClientExpectTest.java b/core/src/test/java/org/jclouds/rest/internal/BaseRestClientExpectTest.java index f4ab26c2c8..d90abf86fa 100644 --- a/core/src/test/java/org/jclouds/rest/internal/BaseRestClientExpectTest.java +++ b/core/src/test/java/org/jclouds/rest/internal/BaseRestClientExpectTest.java @@ -367,7 +367,8 @@ public abstract class BaseRestClientExpectTest { */ public boolean httpRequestsAreEqual(HttpRequest a, HttpRequest b) { try { - if (a == null || b == null) { + if (a == null || b == null || !Objects.equal(a.getRequestLine(), b.getRequestLine()) + || !Objects.equal(a.getHeaders(), b.getHeaders())) { return false; } if (a.getPayload() == null || b.getPayload() == null) { @@ -405,13 +406,13 @@ public abstract class BaseRestClientExpectTest { } }); - return diff.identical() && Objects.equal(a.getHeaders(), b.getHeaders()); + return diff.identical(); } case JSON: { JsonParser parser = new JsonParser(); JsonElement payloadA = parser.parse(Strings2.toStringAndClose(a.getPayload().getInput())); JsonElement payloadB = parser.parse(Strings2.toStringAndClose(b.getPayload().getInput())); - return Objects.equal(payloadA, payloadB) && Objects.equal(a.getHeaders(), b.getHeaders()); + return Objects.equal(payloadA, payloadB); } default: { return Objects.equal(a, b);