<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>tagomoris</author_name>
  <author_url>https://blog.hatena.ne.jp/tagomoris/</author_url>
  <blog_title>たごもりすメモ</blog_title>
  <blog_url>https://tagomoris.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>Javaでミドルウェアなど書いていると必然的に内部でタイマーを作ったりすることになってその制御に System.nanoTime() とかを使うことになると思うんだけど、じゃあテストどうしよっかと思うと、テストでは、まあ好きなタイミングで時間を進めたり好きなところで時間を止めたりってことが普通したいじゃないですか。どうすんのという話。 JMockitを使う とりあえずJMockitを使っとけという話っぽい。static methodをモックできるのはこれしかない*1。JMockitは理想的なモックフレームワーク - じゅんいち☆かとうの技術日誌ちょいちょい調べると例が見付かるので真似る。 im…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftagomoris.hatenablog.com%2Fentry%2F2017%2F07%2F27%2F132230&quot; title=&quot;System.nanoTime() をJMockitで乗っ取る - たごもりすメモ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-07-27 13:22:30</published>
  <title>System.nanoTime() をJMockitで乗っ取る</title>
  <type>rich</type>
  <url>https://tagomoris.hatenablog.com/entry/2017/07/27/132230</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
