rspec/rules/S2858/java/rule.adoc

33 lines
746 B
Plaintext
Raw Permalink Normal View History

== Why is this an issue?
The use of ``++org.fest.assertions.Assertions.assertThat++`` by itself does nothing. You must combine it with another method that actually tests the value in use.
=== Noncompliant code example
2022-02-04 17:28:24 +01:00
[source,java]
----
assertThat(name); // Noncompliant
----
=== Compliant solution
2022-02-04 17:28:24 +01:00
[source,java]
----
assertThat(name).isNotNull();
----
ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)
=== duplicates: S2970
=== on 22 Apr 2015, 16:02:23 Nicolas Peru wrote:
\[~ann.campbell.2] This rule should precise that it checks for ``++org.fest.assertions.Assertions.assertThat++`` methods. As this is not applicable for junit ``++Assert.assertThat ++``
endif::env-github,rspecator-view[]