     ///
     func testResponseClosureAdapterError()
     {
-        XCTFail("Test not implemented!");
+        let baseUrl = "http://localhost"
+        let requestPath = "test/request/path"
+        let expectation = self.expectationWithDescription(self.name)
+        let body = "test".dataUsingEncoding(NSUTF8StringEncoding)
+        let alternateBody = "rest".dataUsingEncoding(NSUTF8StringEncoding)
+        
+        stub(isHost("localhost"), response: {
+            (request:NSURLRequest) in
+            
+            return OHHTTPStubsResponse(data: body!, statusCode: 200, headers: nil)
+        })
+        
+        let responseProcessor = ResponseProcessorClosureAdapter(closure: {
+            (response) in
+            let response = MutableResponse(response)
+            response.body = alternateBody
+            let error = NSError(domain: "JustApisSwiftSDK.ResponseProcessorClosureAdapter", code: -1, userInfo: nil)
+            return (request:response.request, response: response, error:error)
+        })
+        
+        let gateway:Gateway = CompositedGateway(baseUrl: NSURL(string: baseUrl)!, requestPreparer: nil, responseProcessor: responseProcessor)
+        gateway.get(requestPath, callback: { (result) in
+            XCTAssertNotNil(result.error)
+            XCTAssertNotNil(result.response)
+            XCTAssertEqual(result.response!.body as? NSData, alternateBody)
+            expectation.fulfill()
+        })
+        
+        self.waitForExpectationsWithTimeout(5, handler: nil)
     }
     
     ///

    ///
    func testResponseClosureAdapterModification()
    {
        XCTFail("Test not implemented!");
    }
    
    ///

    ///
    func testHeadersInResponse()
    {
        let baseUrl = "http://localhost"
        let requestPath = "test/request/path"
        let expectation = self.expectationWithDescription(self.name)
        let body = "test".dataUsingEncoding(NSUTF8StringEncoding)
        
        stub(isHost("localhost"), response: {
            (request:NSURLRequest) in
            
            return OHHTTPStubsResponse(data: body!, statusCode: 200, headers: nil)
        })
        
        let gateway:Gateway = CompositedGateway(baseUrl: NSURL(string: baseUrl)!)
        gateway.get(requestPath, callback: { (result) in
            XCTAssertNil(result.error)
            XCTAssertNotNil(result.response)
            XCTAssertEqual(result.response!.headers["Content-Length"], "4")
            expectation.fulfill()
        })
        
        self.waitForExpectationsWithTimeout(5, handler: nil)
    }
    
    ///
