From 903534085cfa1ff2d91dde69aac6290c613482e8 Mon Sep 17 00:00:00 2001 From: Soby Chacko Date: Wed, 1 Nov 2023 14:50:12 -0400 Subject: [PATCH] Test cleanup: schema registry tests - Remove the superfluous ExtendWith for SpringExtension --- .../registry/entityScanning/ServerControllerTest.java | 6 ++---- .../registry/server/SchemaRegistryServerAvroTests.java | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/schema-registry/spring-cloud-stream-schema-registry-core/src/test/java/org/springframework/cloud/stream/schema/registry/entityScanning/ServerControllerTest.java b/schema-registry/spring-cloud-stream-schema-registry-core/src/test/java/org/springframework/cloud/stream/schema/registry/entityScanning/ServerControllerTest.java index 9e60c5932..46da2cf71 100644 --- a/schema-registry/spring-cloud-stream-schema-registry-core/src/test/java/org/springframework/cloud/stream/schema/registry/entityScanning/ServerControllerTest.java +++ b/schema-registry/spring-cloud-stream-schema-registry-core/src/test/java/org/springframework/cloud/stream/schema/registry/entityScanning/ServerControllerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2019 the original author or authors. + * Copyright 2019-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. @@ -17,7 +17,6 @@ package org.springframework.cloud.stream.schema.registry.entityScanning; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase; @@ -26,7 +25,6 @@ import org.springframework.cloud.stream.schema.registry.config.SchemaServerConfi import org.springframework.http.MediaType; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit.jupiter.SpringExtension; import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.containsString; @@ -36,8 +34,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. /** * @author Christian Tzolov + * @author Soby Chacko */ -@ExtendWith(SpringExtension.class) @SpringBootTest(classes = { SchemaServerConfiguration.class }) @DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD) @AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.ANY) diff --git a/schema-registry/spring-cloud-stream-schema-registry-server/src/test/java/org/springframework/cloud/stream/schema/registry/server/SchemaRegistryServerAvroTests.java b/schema-registry/spring-cloud-stream-schema-registry-server/src/test/java/org/springframework/cloud/stream/schema/registry/server/SchemaRegistryServerAvroTests.java index 7f4fea27d..56bf6d276 100644 --- a/schema-registry/spring-cloud-stream-schema-registry-server/src/test/java/org/springframework/cloud/stream/schema/registry/server/SchemaRegistryServerAvroTests.java +++ b/schema-registry/spring-cloud-stream-schema-registry-server/src/test/java/org/springframework/cloud/stream/schema/registry/server/SchemaRegistryServerAvroTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 the original author or authors. + * Copyright 2016-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. @@ -31,7 +31,6 @@ import java.util.stream.Stream; import org.apache.avro.Schema.Parser; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.web.ServerProperties; @@ -52,7 +51,6 @@ import org.springframework.http.ResponseEntity; import org.springframework.lang.NonNull; import org.springframework.lang.Nullable; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.util.StreamUtils; import org.springframework.web.client.DefaultResponseErrorHandler; import org.springframework.web.client.HttpClientErrorException; @@ -68,8 +66,8 @@ import static org.springframework.test.annotation.DirtiesContext.ClassMode.AFTER * @author Vinicius Carvalho * @author Ilayaperumal Gopinathan * @author Christian Tzolov + * @author Soby Chacko */ -@ExtendWith(SpringExtension.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT, properties = "spring.main.allow-bean-definition-overriding=true") @DirtiesContext(classMode = AFTER_EACH_TEST_METHOD) public class SchemaRegistryServerAvroTests {