Use isTrue() and isFalse() for AssertJ

Closes gh-12170
pull/12170/merge
Johnny Lim 7 years ago committed by Stephane Nicoll
parent 865775e955
commit 2fe86da95b

@ -33,7 +33,7 @@ public class ManagementServerPropertiesTests {
ManagementServerProperties properties = new ManagementServerProperties();
assertThat(properties.getPort()).isNull();
assertThat(properties.getServlet().getContextPath()).isEqualTo("");
assertThat(properties.getAddApplicationContextHeader()).isEqualTo(false);
assertThat(properties.getAddApplicationContextHeader()).isFalse();
}
@Test

@ -175,7 +175,7 @@ public class GroovyTemplateAutoConfigurationTests {
registerAndRefreshContext(
"spring.groovy.template.configuration.auto-indent:true");
assertThat(this.context.getBean(GroovyMarkupConfigurer.class).isAutoIndent())
.isEqualTo(true);
.isTrue();
}
private void registerAndRefreshContext(String... env) {

@ -137,7 +137,7 @@ public class DataSourceAutoConfigurationTests {
public void commonsDbcp2ValidatesConnectionByDefault() {
assertDataSource(org.apache.commons.dbcp2.BasicDataSource.class,
Arrays.asList("com.zaxxer.hikari", "org.apache.tomcat"), (dataSource) -> {
assertThat(dataSource.getTestOnBorrow()).isEqualTo(true);
assertThat(dataSource.getTestOnBorrow()).isTrue();
assertThat(dataSource.getValidationQuery()).isNull(); // Use
// Connection#isValid()
});

@ -114,7 +114,7 @@ public class ActiveMQAutoConfigurationTests {
assertThat(connectionFactory.getPassword()).isEqualTo("bar");
assertThat(connectionFactory.getCloseTimeout()).isEqualTo(500);
assertThat(connectionFactory.isNonBlockingRedelivery())
.isEqualTo(true);
.isTrue();
assertThat(connectionFactory.getSendTimeout()).isEqualTo(1000);
assertThat(connectionFactory.isTrustAllPackages()).isFalse();
assertThat(connectionFactory.getTrustedPackages())
@ -178,22 +178,22 @@ public class ActiveMQAutoConfigurationTests {
PooledConnectionFactory connectionFactory = context
.getBean(PooledConnectionFactory.class);
assertThat(connectionFactory.isBlockIfSessionPoolIsFull())
.isEqualTo(false);
.isFalse();
assertThat(connectionFactory.getBlockIfSessionPoolIsFullTimeout())
.isEqualTo(64);
assertThat(connectionFactory.isCreateConnectionOnStartup())
.isEqualTo(false);
.isFalse();
assertThat(connectionFactory.getExpiryTimeout()).isEqualTo(4096);
assertThat(connectionFactory.getIdleTimeout()).isEqualTo(512);
assertThat(connectionFactory.getMaxConnections()).isEqualTo(256);
assertThat(connectionFactory.getMaximumActiveSessionPerConnection())
.isEqualTo(1024);
assertThat(connectionFactory.isReconnectOnException())
.isEqualTo(false);
.isFalse();
assertThat(connectionFactory.getTimeBetweenExpirationCheckMillis())
.isEqualTo(2048);
assertThat(connectionFactory.isUseAnonymousProducers())
.isEqualTo(false);
.isFalse();
});
}

@ -71,7 +71,7 @@ public class ActiveMQPropertiesTests {
this.properties.getPackages().setTrustAll(true);
assertThat(createFactory(this.properties)
.createConnectionFactory(ActiveMQConnectionFactory.class)
.isTrustAllPackages()).isEqualTo(true);
.isTrustAllPackages()).isTrue();
}
@Test
@ -80,7 +80,7 @@ public class ActiveMQPropertiesTests {
this.properties.getPackages().getTrusted().add("trusted.package");
ActiveMQConnectionFactory factory = createFactory(this.properties)
.createConnectionFactory(ActiveMQConnectionFactory.class);
assertThat(factory.isTrustAllPackages()).isEqualTo(false);
assertThat(factory.isTrustAllPackages()).isFalse();
assertThat(factory.getTrustedPackages().size()).isEqualTo(1);
assertThat(factory.getTrustedPackages().get(0)).isEqualTo("trusted.package");
}

@ -175,11 +175,11 @@ public class ServerPropertiesTests {
map.put("server.jetty.accesslog.append", "true");
bind(map);
ServerProperties.Jetty jetty = this.properties.getJetty();
assertThat(jetty.getAccesslog().isEnabled()).isEqualTo(true);
assertThat(jetty.getAccesslog().isEnabled()).isTrue();
assertThat(jetty.getAccesslog().getFilename()).isEqualTo("foo.txt");
assertThat(jetty.getAccesslog().getFileDateFormat()).isEqualTo("yyyymmdd");
assertThat(jetty.getAccesslog().getRetentionPeriod()).isEqualTo(4);
assertThat(jetty.getAccesslog().isAppend()).isEqualTo(true);
assertThat(jetty.getAccesslog().isAppend()).isTrue();
}
private void bind(String name, String value) {

@ -77,7 +77,7 @@ public class TomcatServletWebServerFactoryCustomizerTests {
public void redirectContextRootCanBeConfigured() {
bind("server.tomcat.redirect-context-root=false");
ServerProperties.Tomcat tomcat = this.serverProperties.getTomcat();
assertThat(tomcat.getRedirectContextRoot()).isEqualTo(false);
assertThat(tomcat.getRedirectContextRoot()).isFalse();
TomcatWebServer server = customizeAndGetServer();
Context context = (Context) server.getTomcat().getHost().findChildren()[0];
assertThat(context.getMapperContextRootRedirectEnabled()).isFalse();

@ -246,7 +246,7 @@ public class LocalDevToolsAutoConfigurationTests {
StandardWrapper jspServletWrapper = (StandardWrapper) context.findChild("jsp");
EmbeddedServletOptions options = (EmbeddedServletOptions) ReflectionTestUtils
.getField(jspServletWrapper.getServlet(), "options");
assertThat(options.getDevelopment()).isEqualTo(true);
assertThat(options.getDevelopment()).isTrue();
}
private ConfigurableApplicationContext initializeAndRun(Class<?> config,

@ -73,7 +73,7 @@ public class DefinitionsParserTests {
assertThat(definition.getExtraInterfaces())
.containsExactly(ExampleExtraInterface.class);
assertThat(definition.getAnswer()).isEqualTo(Answers.RETURNS_SMART_NULLS);
assertThat(definition.isSerializable()).isEqualTo(true);
assertThat(definition.isSerializable()).isTrue();
assertThat(definition.getReset()).isEqualTo(MockReset.NONE);
assertThat(definition.getQualifier()).isNull();
}

@ -91,7 +91,7 @@ public class DelegatingFilterProxyRegistrationBeanTests
assertThat(mockFilterInitialized.get()).isNull();
filter.doFilter(new MockHttpServletRequest(), new MockHttpServletResponse(),
new MockFilterChain());
assertThat(mockFilterInitialized.get()).isEqualTo(true);
assertThat(mockFilterInitialized.get()).isTrue();
}
@Test

@ -982,7 +982,7 @@ public abstract class AbstractServletWebServerFactoryTests {
JspServlet jspServlet = getJspServlet();
EmbeddedServletOptions options = (EmbeddedServletOptions) ReflectionTestUtils
.getField(jspServlet, "options");
assertThat(options.getDevelopment()).isEqualTo(false);
assertThat(options.getDevelopment()).isFalse();
}
@Test

Loading…
Cancel
Save