Blog

assertj 3.12.0 の breaking change がエグい

Iterator<Foo> fooIterable = getFooIterable();
assertThat(fooIterable)
    .extracting(Foo::getId)
    .isEqualTo(List.of(1,2))

みたいな書き方だったのが

Iterator<Foo> fooIterable = getFooIterable();
assertThat(fooIterable)
    .toIterable()
    .extracting(Foo::getId)
    .isEqualTo(List.of(1,2))

と書かなくてはいけなくなった。

該当のコミットはこれ。

https://github.com/joel-costigliola/assertj-core/commit/acafa142aa903afd611de812576e6e80e12e7964#diff-71630712302645dfc9a55762045740e6

もとのメソッドを Deprecated にして一旦置いといても良かったように思うのだが。。