rspec/rules/S5831/java/rule.adoc

42 lines
1.0 KiB
Plaintext

== Why is this an issue?
A ``++org.assertj.core.configuration.Configuration++`` will be effective only once you call ``++Configuration.apply()++`` or ``++Configuration.applyAndDisplay()++``.
This rule raises an issue when configurations are set without the appropriate call to apply them.
=== Noncompliant code example
[source,java]
----
Configuration configuration = new Configuration(); // Noncompliant, this configuration will not be applied.
configuration.setComparingPrivateFields(true);
----
=== Compliant solution
[source,java]
----
Configuration configuration = new Configuration();
configuration.setComparingPrivateFields(true);
configuration.applyAndDisplay();
// Alternatively: configuration.apply();
----
== Resources
* https://assertj.github.io/doc/#assertj-configuration[AssertJ configuration documentation]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
include::highlighting.adoc[]
endif::env-github,rspecator-view[]