         let future = peripheralManager.addServices(services)
         peripheralManager.error = TestFailure.error
         future.onSuccess {
+            expectation.fulfill()
             XCTFail("onSuccess called")
         }
         future.onFailure {error in

            expectation.fulfill()
        }
        future.onFailure {error in
            XCTFail("onFailure called")
        }
        mock.state = .PoweredOn

            expectation.fulfill()
        }
        future.onFailure {error in
            expectation.fulfill()
            XCTFail("onFailure called")
        }
        waitForExpectationsWithTimeout(2) {error in
