{"categories":["kotlin","mockito"],"published":"2022-04-03 01:49:23","title":"Kotlin\u3067mockStatic\u3092\u4f7f\u304a\u3046\u3068\u3057\u3066\u3061\u3087\u3063\u3068\u30cf\u30de\u3063\u305f\u8a71","author_url":"https://blog.hatena.ne.jp/atr0phy/","width":"100%","description":"kotlin \u66f8\u3044\u3066\u3066\u3001mockito-inline \u306e mockStatic \u3092\u4f7f\u304a\u3046\u3068\u3057\u3066 \u5c11\u3057\u6642\u9593\u7121\u99c4\u306b\u3057\u305f\u306e\u3067\u3001\u4ed6\u306e\u4eba\u304c\u540c\u3058\u3053\u3068\u3067\u6642\u9593\u3092\u7121\u99c4\u306b\u3057\u306a\u3044\u3088\u3046\u306b\u66f8\u3044\u3068\u304f tl;dr @JvmStatic \u306eAnnotation\u3092\u3064\u3051\u308b\u5fc5\u8981\u304c\u3042\u308b \u666e\u901a\u306b\u8003\u3048\u308c\u3070\u5f53\u305f\u308a\u524d\u306a\u3093\u3060\u3051\u3069\u3001\u3064\u3051\u5fd8\u308c\u3066\u305f\u6642\u306b\u30a8\u30e9\u30fc\u51fa\u3066\u306a\u3093\u3067\u3060\u3063\u3051\uff1f\u3063\u3066\u306a\u308b object ExampleObject { @JvmStatic //\u3053\u308c fun static(): String { return \"static\" } } \u306a\u305c\u304b \u3058\u3083\u306a\u3044\u3068\u30d0\u30a4\u30c8\u30b3\u30fc\u30c9\u306b\u306a\u3063\u305f\u6642\u306b static \u306b\u306a\u3089\u306a\u3044\u306e\u3067\u7d50\u679c\u3068\u3057\u3066mock\u51fa\u6765\u305a\u306b\u5931\u6557\u3059\u2026","blog_url":"https://www.hacktotech.net/","provider_url":"https://hatena.blog","author_name":"atr0phy","blog_title":"HackToTech","provider_name":"Hatena Blog","height":"190","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.hacktotech.net%2Fentry%2Fkotlin-mockito-mock-static\" title=\"Kotlin\u3067mockStatic\u3092\u4f7f\u304a\u3046\u3068\u3057\u3066\u3061\u3087\u3063\u3068\u30cf\u30de\u3063\u305f\u8a71 - HackToTech\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","type":"rich","image_url":"https://cdn-ak.f.st-hatena.com/images/fotolife/a/atr0phy/20220724/20220724155908.png","version":"1.0","url":"https://www.hacktotech.net/entry/kotlin-mockito-mock-static"}