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:
Yanming Zhou
2023-12-06 09:34:06 +08:00
committed by Brian Clozel
parent 7b16ef90f1
commit afcd03bddc
55 changed files with 135 additions and 134 deletions

View File

@@ -97,7 +97,7 @@ public class HandlersBeanDefinitionParserTests {
assertThat(handshakeHandler).isNotNull();
boolean condition1 = handshakeHandler instanceof DefaultHandshakeHandler;
assertThat(condition1).isTrue();
assertThat(handler.getHandshakeInterceptors().isEmpty()).isFalse();
assertThat(handler.getHandshakeInterceptors()).isNotEmpty();
boolean condition = handler.getHandshakeInterceptors().get(0) instanceof OriginHandshakeInterceptor;
assertThat(condition).isTrue();
}
@@ -110,7 +110,7 @@ public class HandlersBeanDefinitionParserTests {
assertThat(handshakeHandler).isNotNull();
boolean condition1 = handshakeHandler instanceof DefaultHandshakeHandler;
assertThat(condition1).isTrue();
assertThat(handler.getHandshakeInterceptors().isEmpty()).isFalse();
assertThat(handler.getHandshakeInterceptors()).isNotEmpty();
boolean condition = handler.getHandshakeInterceptors().get(0) instanceof OriginHandshakeInterceptor;
assertThat(condition).isTrue();
}

View File

@@ -192,7 +192,7 @@ class SockJsServiceTests extends AbstractHttpRequestTests {
this.servletRequest.addHeader(HttpHeaders.ACCESS_CONTROL_REQUEST_HEADERS, "Last-Modified");
resetResponseAndHandleRequest("OPTIONS", "/echo/info", HttpStatus.FORBIDDEN);
CorsConfiguration corsConfiguration = this.service.getCorsConfiguration(this.servletRequest);
assertThat(corsConfiguration.getAllowedOrigins().isEmpty()).isTrue();
assertThat(corsConfiguration.getAllowedOrigins()).isEmpty();
this.service.setAllowedOrigins(Collections.singletonList("https://mydomain1.example"));
resetResponseAndHandleRequest("OPTIONS", "/echo/info", HttpStatus.FORBIDDEN);