mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-20 20:59:07 +00:00
Enable SpringJUnit5 Checkstyle rule
See gh-36496 Closes gh-36496
This commit is contained in:
+1
-1
@@ -38,7 +38,7 @@ import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
public class SimpleClientHttpRequestFactoryTests extends AbstractHttpRequestFactoryTests {
|
||||
class SimpleClientHttpRequestFactoryTests extends AbstractHttpRequestFactoryTests {
|
||||
|
||||
@Override
|
||||
protected ClientHttpRequestFactory createRequestFactory() {
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ class ResourceHttpMessageWriterTests {
|
||||
|
||||
@Test
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void getWritableMediaTypes() {
|
||||
void getWritableMediaTypes() {
|
||||
assertThat((List) this.writer.getWritableMediaTypes())
|
||||
.containsExactlyInAnyOrder(MimeTypeUtils.APPLICATION_OCTET_STREAM, MimeTypeUtils.ALL);
|
||||
}
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ class CustomizedJackson2JsonEncoderTests extends AbstractEncoderTests<Jackson2Js
|
||||
|
||||
@Test
|
||||
@Override
|
||||
public void encode() throws Exception {
|
||||
protected void encode() throws Exception {
|
||||
Flux<MyCustomizedEncoderBean> input = Flux.just(
|
||||
new MyCustomizedEncoderBean(MyCustomEncoderEnum.VAL1),
|
||||
new MyCustomizedEncoderBean(MyCustomEncoderEnum.VAL2)
|
||||
|
||||
+2
-2
@@ -50,7 +50,7 @@ class CustomizedJacksonJsonDecoderTests extends AbstractDecoderTests<JacksonJson
|
||||
|
||||
@Test
|
||||
@Override
|
||||
public void decode() throws Exception {
|
||||
protected void decode() throws Exception {
|
||||
Flux<DataBuffer> input = Flux.concat(stringBuffer("{\"property\":\"Value1\"}"));
|
||||
|
||||
testDecodeAll(input, MyCustomizedDecoderBean.class, step -> step
|
||||
@@ -60,7 +60,7 @@ class CustomizedJacksonJsonDecoderTests extends AbstractDecoderTests<JacksonJson
|
||||
|
||||
@Test
|
||||
@Override
|
||||
public void decodeToMono() throws Exception {
|
||||
protected void decodeToMono() throws Exception {
|
||||
Mono<DataBuffer> input = stringBuffer("{\"property\":\"Value2\"}");
|
||||
|
||||
ResolvableType elementType = ResolvableType.forClass(MyCustomizedDecoderBean.class);
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ class CustomizedJacksonJsonEncoderTests extends AbstractEncoderTests<JacksonJson
|
||||
|
||||
@Test
|
||||
@Override
|
||||
public void encode() throws Exception {
|
||||
protected void encode() throws Exception {
|
||||
Flux<MyCustomizedEncoderBean> input = Flux.just(
|
||||
new MyCustomizedEncoderBean(MyCustomEncoderEnum.VAL1),
|
||||
new MyCustomizedEncoderBean(MyCustomEncoderEnum.VAL2)
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ class Jackson2JsonDecoderTests extends AbstractDecoderTests<Jackson2JsonDecoder>
|
||||
|
||||
@Override
|
||||
@Test
|
||||
public void canDecode() {
|
||||
protected void canDecode() {
|
||||
assertThat(decoder.canDecode(ResolvableType.forClass(Pojo.class), APPLICATION_JSON)).isTrue();
|
||||
assertThat(decoder.canDecode(ResolvableType.forClass(Pojo.class), APPLICATION_NDJSON)).isTrue();
|
||||
assertThat(decoder.canDecode(ResolvableType.forClass(Pojo.class), null)).isTrue();
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* Tests for {@link ProtobufJsonDecoder}.
|
||||
* @author Brian Clozel
|
||||
*/
|
||||
public class ProtobufJsonDecoderTests extends AbstractDecoderTests<ProtobufJsonDecoder> {
|
||||
class ProtobufJsonDecoderTests extends AbstractDecoderTests<ProtobufJsonDecoder> {
|
||||
|
||||
private Msg msg1 = Msg.newBuilder().setFoo("Foo").setBlah(SecondMsg.newBuilder().setBlah(123).build()).build();
|
||||
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
|
||||
* @author Sam Brannen
|
||||
*/
|
||||
@SuppressWarnings({"deprecation", "removal" })
|
||||
public class Jackson2ObjectMapperFactoryBeanTests {
|
||||
class Jackson2ObjectMapperFactoryBeanTests {
|
||||
|
||||
private static final String DATE_FORMAT = "yyyy-MM-dd";
|
||||
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
/**
|
||||
* Unit tests for {@link ServletRequestHeadersAdapter}.
|
||||
*/
|
||||
public class ServletRequestHeadersAdapterTests {
|
||||
class ServletRequestHeadersAdapterTests {
|
||||
|
||||
private final MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
* Unit tests for {@link DefaultApiVersionStrategy}.
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class DefaultApiVersionStrategiesTests {
|
||||
class DefaultApiVersionStrategiesTests {
|
||||
|
||||
private static final SemanticApiVersionParser parser = new SemanticApiVersionParser();
|
||||
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* Unit tests for {@link MediaTypeParamApiVersionResolver}.
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class MediaTypeParamApiVersionResolverTests {
|
||||
class MediaTypeParamApiVersionResolverTests {
|
||||
|
||||
private final MediaType mediaType = MediaType.parseMediaType("application/x.abc+json");
|
||||
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
* Unit tests for {@link PathApiVersionResolver}.
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class PathApiVersionResolverTests {
|
||||
class PathApiVersionResolverTests {
|
||||
|
||||
@Test
|
||||
void resolve() {
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* Unit tests for {@link QueryApiVersionResolver}.
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class QueryApiVersionResolverTests {
|
||||
class QueryApiVersionResolverTests {
|
||||
|
||||
private final String queryParamName = "api-version";
|
||||
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
||||
* Unit tests for {@link SemanticApiVersionParser}.
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class SemanticApiVersionParserTests {
|
||||
class SemanticApiVersionParserTests {
|
||||
|
||||
private final SemanticApiVersionParser parser = new SemanticApiVersionParser();
|
||||
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* Unit tests for {@link StandardApiVersionDeprecationHandler}.
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class StandardApiVersionDeprecationHandlerTests {
|
||||
class StandardApiVersionDeprecationHandlerTests {
|
||||
|
||||
private final MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ import static org.assertj.core.api.Assertions.fail;
|
||||
* @author Sebastien Deleuze
|
||||
* @author Nicklas Wiegandt
|
||||
*/
|
||||
public class RestClientBuilderTests {
|
||||
class RestClientBuilderTests {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
|
||||
@@ -36,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
||||
* {@link RestClient} tests for sending API versions.
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class RestClientVersionTests {
|
||||
class RestClientVersionTests {
|
||||
|
||||
private final MockWebServer server = new MockWebServer();
|
||||
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class RestClientProxyRegistryIntegrationTests {
|
||||
class RestClientProxyRegistryIntegrationTests {
|
||||
|
||||
private final MockWebServer server = new MockWebServer();
|
||||
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ import static org.mockito.Mockito.verifyNoInteractions;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class AsyncRequestNotUsableTests {
|
||||
class AsyncRequestNotUsableTests {
|
||||
|
||||
private final MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ class OncePerRequestFilterTests {
|
||||
|
||||
@BeforeEach
|
||||
@SuppressWarnings("serial")
|
||||
public void setup() throws Exception {
|
||||
void setup() throws Exception {
|
||||
this.request = new MockHttpServletRequest();
|
||||
this.request.setScheme("http");
|
||||
this.request.setServerName("localhost");
|
||||
|
||||
@@ -41,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class UrlHandlerFilterTests {
|
||||
class UrlHandlerFilterTests {
|
||||
|
||||
@Test
|
||||
void requestWrapping() throws Exception {
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ import static org.mockito.Mockito.mock;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class UrlHandlerFilterTests {
|
||||
class UrlHandlerFilterTests {
|
||||
|
||||
@Test
|
||||
void requestMutation() {
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ class ExpressionValueMethodArgumentResolverTests {
|
||||
private NativeWebRequest webRequest;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
void setUp() throws Exception {
|
||||
GenericWebApplicationContext context = new GenericWebApplicationContext();
|
||||
context.refresh();
|
||||
resolver = new ExpressionValueMethodArgumentResolver(context.getBeanFactory());
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ import static org.mockito.Mockito.mock;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class HttpServiceProxyFactoryTests {
|
||||
class HttpServiceProxyFactoryTests {
|
||||
|
||||
@Test
|
||||
void httpExchangeAdapterDecorator() {
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ import static org.springframework.web.service.registry.HttpServiceGroup.ClientTy
|
||||
* Unit tests for {@link HttpServiceProxyRegistryFactoryBean}.
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class HttpServiceProxyRegistryFactoryBeanTests {
|
||||
class HttpServiceProxyRegistryFactoryBeanTests {
|
||||
|
||||
@Test
|
||||
void twoGroups() {
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public class HttpServiceRegistrarTests {
|
||||
class HttpServiceRegistrarTests {
|
||||
|
||||
private static final String ECHO_GROUP = "echo";
|
||||
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
public class ImportHttpServiceRegistrarTests {
|
||||
class ImportHttpServiceRegistrarTests {
|
||||
|
||||
private static final String ECHO_GROUP = "echo";
|
||||
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* Unit tests for {@link DisconnectedClientHelper}.
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class DisconnectedClientHelperTests {
|
||||
class DisconnectedClientHelperTests {
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"broKen pipe", "connection reset By peer"})
|
||||
|
||||
Reference in New Issue
Block a user