{
  "id": "java/mockito-doreturn-when-mismatch",
  "signature": "org.mockito.exceptions.misusing.UnfinishedStubbingException: Unfinished stubbing detected here: doReturn().when()",
  "signature_zh": "未完成的桩代码检测：doReturn().when() 未完成",
  "regex": "org\\.mockito\\.exceptions\\.misusing\\.UnfinishedStubbingException:\\ Unfinished\\ stubbing\\ detected\\ here:\\ doReturn\\(\\)\\.when\\(\\)",
  "domain": "java",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "doReturn().when() syntax is used incorrectly, such as missing method call or wrong order.",
  "root_cause_type": "generic",
  "root_cause_zh": "doReturn().when() 语法使用不正确，例如缺少方法调用或顺序错误。",
  "versions": [
    {
      "version": "8+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Switching to when().thenReturn() blindly",
      "why_fails": "May not work for void methods or spies.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "Adding extra doReturn calls",
      "why_fails": "Compounds the issue; still unfinished.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Complete the doReturn().when() chain correctly",
      "success_rate": 0.9,
      "how": "doReturn(\"value\").when(mock).method();",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use when().thenReturn() for non-void methods",
      "success_rate": 0.85,
      "how": "when(mock.method()).thenReturn(\"value\");",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-02-28",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}