     let expectation = self.expectationWithDescription("fetch config")
 
     malformedResponseMock()
-    let client = MockClient(deviceKey: "some-key", endpointScheme: "", endpointUrl: "garbage", endpointPort: nil)
+    let client = MockClient(deviceKey: "some-key")
     client.connect() { error in
       XCTAssertNotNil(error)
       expectation.fulfill()

  func testInvalidEndpoint() {
    let expectation = self.expectationWithDescription("fetch config")

    let client = MockClient(deviceKey: "some-key", endpointScheme: "", endpointUrl: "garbage", endpointPort: nil)
    client.connect() { error in
      XCTAssertNotNil(error)
      expectation.fulfill()


  var expectedState = CocoaMQTTConnState.CONNECTED
  internal var didPublish = false
  internal var isSubscribed = false

  init(expectedState state: CocoaMQTTConnState) {
    expectedState = state
