         callback(expectation.fulfill)
         waitForExpectationsWithTimeout(timeout, handler: nil)
    }
+}
+
+// What a hack to get toJson() only on Dictionary<String, String> :(
+
+extension String : NSStringConvertible {
+    public var nsString: NSString {
+        return NSString(string: self)
+    }
+}
+
+extension Dictionary where Key: NSStringConvertible, Value: NSStringConvertible {
+    func toJSONString() -> String {
+        var dict: [NSString : NSString] = [:]
+        for (name, value) in self {
+            dict[name.nsString] = value.nsString
+        }
+        let data = try! NSJSONSerialization.dataWithJSONObject(dict, options: NSJSONWritingOptions(rawValue: 0))
+        return NSString(data: data, encoding: NSUTF8StringEncoding) as! String
+    }
 }
    
    func testClientCredentialsSuccessfulAuth() {
        let url = "http://nonexistent.com/authorization"
        let processor = processorForResponse(200, url: url, body: ["access_token" : accessToken].toJson())
        
        let request = ClientCredentialsRequest(url: url , clientId: clientId, clientSecret: clientSecret)!
        var response: Response!

    }
}

protocol NSStringConvertible {
    var nsString : NSString { get }
}

typealias OAuthRequestCompleted = () -> Void
