 
     func testProfileWithShortText() {
         let expectation = self.expectation(description: "profile(text:)")
-        let failure = { (error: Error) in expectation.fulfill() }
-        personalityInsights.profile(text: short, failure: failure, success: failWithResult)
+        personalityInsights.profile(text: short) {
+            _, error in
+
+            if error == nil {
+                XCTFail("Expected error response")
+            }
+            expectation.fulfill()
+        }
         waitForExpectations()
     }
 }


    func testProfileHTML() {
        let expectation = self.expectation(description: "profile(html:)")
        personalityInsights.profile(html: html, failure: failWithError) { profile in
            for preference in profile.personality {
                XCTAssertNotNil(preference.name)
                break

            forward: false
        )
        let content = Content(contentItems: [contentItem])
        personalityInsights.profileAsCsv(content: content) {
            response, error in

            if let error = error {
                XCTFail("Unexpected error response from service: \(error)")
                return
            }
            guard let csv = response?.result else {
                XCTFail("Missing response value")
                return
            }

            XCTAssertGreaterThan(csv.count, 0)
            expectation.fulfill()
        }
