 
     func testGetToneJSON() {
         let expectation = self.expectation(description: "Get tone.")
-        toneAnalyzer.tone(toneInput: ToneInput(text: text), failure: failWithError) {
-            toneAnalysis in
+        toneAnalyzer.tone(toneContent: .toneInput(ToneInput(text: text))) {
+            response, error in
+            guard let toneAnalysis = response?.result else {
+                XCTFail("Positive test failed with error: \(error!)")
+                return
+            }
             XCTAssertNotNil(toneAnalysis.documentTone.tones)
             XCTAssertGreaterThan(toneAnalysis.documentTone.tones!.count, 0)
             XCTAssertNotNil(toneAnalysis.sentencesTone)


    func testToneChat() {
        let expectation = self.expectation(description: "Tone chat.")
        toneAnalyzer.toneChat(utterances: utterances, acceptLanguage: "en", failure: failWithError) { analyses in
            XCTAssert(!analyses.utterancesTone.isEmpty)
            expectation.fulfill()
        }

    func testGetToneCustom() {
        let expectation = self.expectation(description: "Get tone with custom parameters.")
        toneAnalyzer.tone(
            toneContent: .toneInput(ToneInput(text: text)),
            sentences: false,
            contentLanguage: "en",
            acceptLanguage: "en")
        {
            response, error in
            guard let toneAnalysis = response?.result else {
                XCTFail("Positive test failed with error: \(error!)")
                return
            }
            XCTAssertNotNil(toneAnalysis.documentTone.tones)
            XCTAssertGreaterThan(toneAnalysis.documentTone.tones!.count, 0)
            XCTAssertNil(toneAnalysis.sentencesTone)
