Use idiomatic AssertJ assertions for true, false, and null
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2022 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.
|
||||
@@ -323,7 +323,7 @@ class ServletWebRequestHttpMethodsTests {
|
||||
|
||||
assertThat(request.checkNotModified(oneMinuteAgo)).isFalse();
|
||||
assertThat(servletResponse.getStatus()).isEqualTo(200);
|
||||
assertThat(servletResponse.getHeader("Last-Modified")).isEqualTo(null);
|
||||
assertThat(servletResponse.getHeader("Last-Modified")).isNull();
|
||||
}
|
||||
|
||||
@ParameterizedHttpMethodTest
|
||||
@@ -337,7 +337,7 @@ class ServletWebRequestHttpMethodsTests {
|
||||
|
||||
assertThat(request.checkNotModified(currentEpoch)).isTrue();
|
||||
assertThat(servletResponse.getStatus()).isEqualTo(412);
|
||||
assertThat(servletResponse.getHeader("Last-Modified")).isEqualTo(null);
|
||||
assertThat(servletResponse.getHeader("Last-Modified")).isNull();
|
||||
}
|
||||
|
||||
private void setUpRequest(String method) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2022 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.
|
||||
@@ -287,8 +287,8 @@ public class CommonsMultipartResolverTests {
|
||||
MultipartHttpServletRequest request) throws UnsupportedEncodingException {
|
||||
|
||||
MultipartTestBean1 mtb1 = new MultipartTestBean1();
|
||||
assertThat(mtb1.getField1()).isEqualTo(null);
|
||||
assertThat(mtb1.getField2()).isEqualTo(null);
|
||||
assertThat(mtb1.getField1()).isNull();
|
||||
assertThat(mtb1.getField2()).isNull();
|
||||
ServletRequestDataBinder binder = new ServletRequestDataBinder(mtb1, "mybean");
|
||||
binder.registerCustomEditor(byte[].class, new ByteArrayMultipartFileEditor());
|
||||
binder.bind(request);
|
||||
@@ -301,8 +301,8 @@ public class CommonsMultipartResolverTests {
|
||||
assertThat(new String(mtb1.getField2())).isEqualTo(new String(file2.getBytes()));
|
||||
|
||||
MultipartTestBean2 mtb2 = new MultipartTestBean2();
|
||||
assertThat(mtb2.getField1()).isEqualTo(null);
|
||||
assertThat(mtb2.getField2()).isEqualTo(null);
|
||||
assertThat(mtb2.getField1()).isNull();
|
||||
assertThat(mtb2.getField2()).isNull();
|
||||
binder = new ServletRequestDataBinder(mtb2, "mybean");
|
||||
binder.registerCustomEditor(String.class, "field1", new StringMultipartFileEditor());
|
||||
binder.registerCustomEditor(String.class, "field2", new StringMultipartFileEditor("UTF-16"));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2022 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.
|
||||
@@ -1066,7 +1066,7 @@ class UriComponentsBuilderTests {
|
||||
assertThat(result1.getPath()).isEqualTo("/p1/%s/%s", vars.get("ps1"), vars.get("ps2"));
|
||||
assertThat(result1.getQuery()).isEqualTo("q1");
|
||||
assertThat(result1.getFragment()).isEqualTo("f1");
|
||||
assertThat(result1.getSchemeSpecificPart()).isEqualTo(null);
|
||||
assertThat(result1.getSchemeSpecificPart()).isNull();
|
||||
|
||||
UriComponents result2 = builder2.build();
|
||||
assertThat(result2.getScheme()).isEqualTo("http");
|
||||
@@ -1075,7 +1075,7 @@ class UriComponentsBuilderTests {
|
||||
assertThat(result2.getPath()).isEqualTo("/p1/%s/%s", vars.get("ps1"), vars.get("ps2"));
|
||||
assertThat(result2.getQuery()).isEqualTo("q1");
|
||||
assertThat(result2.getFragment()).isEqualTo("f1");
|
||||
assertThat(result1.getSchemeSpecificPart()).isEqualTo(null);
|
||||
assertThat(result1.getSchemeSpecificPart()).isNull();
|
||||
}
|
||||
|
||||
@Test // gh-26466
|
||||
|
||||
Reference in New Issue
Block a user