Replace assertThat(x.isEmpty()).isTrue() with assertThat(x).isEmpty()
Search for : assertThat\((.+).isEmpty\(\)\).isTrue\(\) Replace with : assertThat($1).isEmpty() Search for : assertThat\((.+).isEmpty\(\)\).isFalse\(\) Replace with : assertThat($1).isNotEmpty() Closes gh-31758
This commit is contained in:
committed by
Brian Clozel
parent
7b16ef90f1
commit
afcd03bddc
@@ -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.
|
||||
@@ -40,7 +40,7 @@ class ClassFilesTests {
|
||||
void noneReturnsNone() {
|
||||
ClassFiles none = ClassFiles.none();
|
||||
assertThat(none).isNotNull();
|
||||
assertThat(none.isEmpty()).isTrue();
|
||||
assertThat(none).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -83,13 +83,13 @@ class ClassFilesTests {
|
||||
@Test
|
||||
void isEmptyWhenEmptyReturnsTrue() {
|
||||
ClassFiles classFiles = ClassFiles.of();
|
||||
assertThat(classFiles.isEmpty()).isTrue();
|
||||
assertThat(classFiles).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
void isEmptyWhenNotEmptyReturnsFalse() {
|
||||
ClassFiles classFiles = ClassFiles.of(CLASS_FILE_1);
|
||||
assertThat(classFiles.isEmpty()).isFalse();
|
||||
assertThat(classFiles).isNotEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -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.
|
||||
@@ -41,7 +41,7 @@ class ResourceFilesTests {
|
||||
void noneReturnsNone() {
|
||||
ResourceFiles none = ResourceFiles.none();
|
||||
assertThat(none).isNotNull();
|
||||
assertThat(none.isEmpty()).isTrue();
|
||||
assertThat(none).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -85,13 +85,13 @@ class ResourceFilesTests {
|
||||
@Test
|
||||
void isEmptyWhenEmptyReturnsTrue() {
|
||||
ResourceFiles resourceFiles = ResourceFiles.of();
|
||||
assertThat(resourceFiles.isEmpty()).isTrue();
|
||||
assertThat(resourceFiles).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
void isEmptyWhenNotEmptyReturnsFalse() {
|
||||
ResourceFiles resourceFiles = ResourceFiles.of(RESOURCE_FILE_1);
|
||||
assertThat(resourceFiles.isEmpty()).isFalse();
|
||||
assertThat(resourceFiles).isNotEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -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.
|
||||
@@ -41,7 +41,7 @@ class SourceFilesTests {
|
||||
void noneReturnsNone() {
|
||||
SourceFiles none = SourceFiles.none();
|
||||
assertThat(none).isNotNull();
|
||||
assertThat(none.isEmpty()).isTrue();
|
||||
assertThat(none).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -84,13 +84,13 @@ class SourceFilesTests {
|
||||
@Test
|
||||
void isEmptyWhenEmptyReturnsTrue() {
|
||||
SourceFiles sourceFiles = SourceFiles.of();
|
||||
assertThat(sourceFiles.isEmpty()).isTrue();
|
||||
assertThat(sourceFiles).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
void isEmptyWhenNotEmptyReturnsFalse() {
|
||||
SourceFiles sourceFiles = SourceFiles.of(SOURCE_FILE_1);
|
||||
assertThat(sourceFiles.isEmpty()).isFalse();
|
||||
assertThat(sourceFiles).isNotEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user