Refactor AssertJ assertions into more idiomatic ones
This commit refactors some AssertJ assertions into more idiomatic and readable ones. Using the dedicated assertion instead of a generic one will produce more meaningful error messages. For instance, consider collection size: ``` // expected: 5 but was: 2 assertThat(collection.size()).equals(5); // Expected size: 5 but was: 2 in: [1, 2] assertThat(collection).hasSize(5); ``` Closes gh-30104
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -222,7 +222,7 @@ class CandidateComponentsIndexerTests {
|
||||
for (Class<?> c : classes) {
|
||||
assertThat(metadata).has(Metadata.of(c, Component.class));
|
||||
}
|
||||
assertThat(metadata.getItems()).hasSize(classes.length);
|
||||
assertThat(metadata.getItems()).hasSameSizeAs(classes);
|
||||
}
|
||||
|
||||
private void testSingleComponent(Class<?> target, Class<?>... stereotypes) {
|
||||
|
||||
Reference in New Issue
Block a user