Fix assumption

Sonar says:
AssertJ assertions allMatch and doesNotContains on an empty list always
returns true whatever the content of the predicate. Despite being
correct, you should make explicit if you expect an empty list or not, by
adding isEmpty()/isNotEmpty() before calling the assertion. It will
justify the useless predicate to improve clarity or increase the
reliability of the test.
This commit is contained in:
René Pfeuffer
2020-07-03 10:18:25 +02:00
parent ef9abdaa6e
commit 48a3bfd416

View File

@@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package sonia.scm.api.v2.resources;
import com.github.sdorra.shiro.ShiroRule;
@@ -166,7 +166,7 @@ public class IndexResourceTest {
Assertions.assertThat(index.getLinks().getLinksBy("autocomplete"))
.extracting("name")
.doesNotContainSequence("users", "groups");
.isEmpty();
}
@Test