mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 08:25:44 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user