     
     func stompClient(client: StompClient, didReceivedData data: NSData) {
         let json = try! NSJSONSerialization.JSONObjectWithData(data, options: .AllowFragments)
-        debugPrint(json)
-//        XCTAssert(json is [AnyObject], "Reveived data isn't an array.")
+        XCTAssertNotNil(json["accountId"], "Account Id is empty.")
+        XCTAssertEqual(json["accountId"]!, "shawn@nogle.com", "Account Id is wrong.")
         
         client.unsubscribe(destination)
         

        let session = NSURLSession.sharedSession()
        let loginURLString = host + "/trader/desktop/auth/login"
        let request = NSMutableURLRequest(URL: NSURL(string: loginURLString)!)
        let param = ["id" : "shawn@nogle.com", "pass" : "Shawn123"]
//        var parts = [String]()
//        for (key, value) in param {
//            let field = key + "=" + value
//            parts.append(field)
//        }
//        let string = parts.joinWithSeparator("&")
//        let stringData = string.dataUsingEncoding(NSUTF8StringEncoding)!
        let data = try! NSJSONSerialization.dataWithJSONObject(param, options: NSJSONWritingOptions(rawValue: 0))
        request.HTTPMethod = "POST"
//        request.addValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
        request.addValue("application/json", forHTTPHeaderField: "Content-Type")
        request.HTTPBody = data
        let task = session.dataTaskWithRequest(request) { (data, response, error) in
            let res = response as! NSHTTPURLResponse
            if res.statusCode == 200 {
                self.parseCookies(res)
                
                self.client.connect()
            } else {
                debugPrint(res)
                XCTAssert(false, "Status code isn't 200")
                delegate.expectation.fulfill()
            }
        }

    
    private var client: StompClient!
    private var socket: WebSocket!
    private let host = "http://10.1.10.113:8080"
    
    override func setUp() {
        super.setUp()
