Fix for incompatible method call regarding IDEA <2018.2.

Heavy refactoring regarding quick fixes (using more extensions).
Even more refactoring.
Fixed/extended AssertThatGuavaOptionalInspection regarding static.
imports and wrong reference to core assertThat() where Guava assertThat() actually was necessary.
This commit is contained in:
2019-04-13 18:35:49 +02:00
parent 4e6d53b3dc
commit b58d8cfd2f
27 changed files with 425 additions and 290 deletions
@@ -0,0 +1,27 @@
import com.google.common.base.Optional;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.guava.api.Assertions.assertThat;
public class AssertThatGuavaOptional {
private void assertThatGuavaOptional() {
Optional<String> opt = Optional.absent();
assertThat(opt).contains("foo");
assertThat(opt).contains("foo");
assertThat(opt).isNotEqualTo(Optional.of("foo"));
assertThat(opt).isNotEqualTo(Optional.fromNullable("foo"));
assertThat(opt).isPresent();
assertThat(opt).isAbsent();
assertThat(opt).contains("foo");
assertThat(opt.get()).isSameAs("foo");
assertThat(opt.get()).isNotEqualTo("foo");
assertThat(opt.get()).isNotSameAs("foo");
assertThat(opt).isAbsent();
assertThat(opt).isPresent();
}
}