Test cleanup in schema registry modules
- Remove the test name prefix from the test methods in the schema-registry releated modules Part of fixing https://github.com/spring-cloud/spring-cloud-stream/issues/2371.
This commit is contained in:
@@ -49,7 +49,7 @@ class AvroSchemaMessageConverterTests {
|
||||
static StubSchemaRegistryClient stubSchemaRegistryClient = new StubSchemaRegistryClient();
|
||||
|
||||
@Test
|
||||
public void testSendMessageWithLocation() throws Exception {
|
||||
public void sendMessageWithLocation() throws Exception {
|
||||
|
||||
try (ConfigurableApplicationContext context = new SpringApplicationBuilder(
|
||||
TestChannelBinderConfiguration.getCompleteConfiguration(AvroSourceApplication.class))
|
||||
@@ -96,7 +96,7 @@ class AvroSchemaMessageConverterTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSendMessageWithoutLocation() throws Exception {
|
||||
public void sendMessageWithoutLocation() throws Exception {
|
||||
try (ConfigurableApplicationContext context = new SpringApplicationBuilder(
|
||||
TestChannelBinderConfiguration.getCompleteConfiguration(AvroSourceApplication.class))
|
||||
.web(WebApplicationType.NONE).run("--server.port=0",
|
||||
|
||||
@@ -56,7 +56,7 @@ class AvroSchemaServiceManagerTests {
|
||||
private final Log logger = LogFactory.getLog(AvroSchemaServiceManagerTests.class);
|
||||
|
||||
@Test
|
||||
public void testWithDefaultImplementation() throws IOException {
|
||||
public void withDefaultImplementation() throws IOException {
|
||||
assertThatThrownBy(() -> {
|
||||
|
||||
AvroSchemaServiceManager defaultServiceManager = new AvroSchemaServiceManagerImpl();
|
||||
@@ -91,7 +91,7 @@ class AvroSchemaServiceManagerTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWithCustomImplementation() throws IOException {
|
||||
public void withCustomImplementation() throws IOException {
|
||||
AvroSchemaServiceManager manager = new AvroSchemaServiceManager() {
|
||||
@Override
|
||||
public Schema getSchema(Class<?> clazz) {
|
||||
@@ -152,7 +152,7 @@ class AvroSchemaServiceManagerTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAvroSchemaMessageConverter() {
|
||||
public void avroSchemaMessageConverter() {
|
||||
AvroSchemaMessageConverter converter = new AvroSchemaMessageConverter();
|
||||
MimeType mimeType = new MimeType("application", "avro");
|
||||
assertThat(mimeType).isEqualTo(converter.getSupportedMimeTypes().get(0));
|
||||
@@ -177,7 +177,7 @@ class AvroSchemaServiceManagerTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAvroSchemaMessageConverterException() {
|
||||
public void avroSchemaMessageConverterException() {
|
||||
assertThatThrownBy(() -> {
|
||||
MimeType mimeType = new MimeType("application", "avro");
|
||||
AvroSchemaServiceManager manager = new AvroSchemaServiceManagerImpl();
|
||||
|
||||
@@ -50,7 +50,7 @@ class SubjectNamingStrategyTest {
|
||||
private static StubSchemaRegistryClient stubSchemaRegistryClient = new StubSchemaRegistryClient();
|
||||
|
||||
@Test
|
||||
public void testQualifiedSubjectNamingStrategy() throws Exception {
|
||||
public void qualifiedSubjectNamingStrategy() throws Exception {
|
||||
try (ConfigurableApplicationContext context = new SpringApplicationBuilder(
|
||||
TestChannelBinderConfiguration.getCompleteConfiguration(AvroSourceApplication.class))
|
||||
.web(WebApplicationType.NONE).run("--server.port=0",
|
||||
|
||||
@@ -126,7 +126,7 @@ class AvroMessageConverterSerializationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSchemaImport() throws Exception {
|
||||
public void schemaImport() throws Exception {
|
||||
SchemaRegistryClient client = new DefaultSchemaRegistryClient(restTemplateBuilder);
|
||||
AvroSchemaServiceManager manager = new AvroSchemaServiceManagerImpl();
|
||||
AvroSchemaRegistryClientMessageConverter converter = new AvroSchemaRegistryClientMessageConverter(
|
||||
|
||||
@@ -90,7 +90,7 @@ class AvroSchemaRegistryClientMessageConverterTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSendMessage() throws Exception {
|
||||
public void sendMessage() throws Exception {
|
||||
try (ConfigurableApplicationContext context = new SpringApplicationBuilder(
|
||||
TestChannelBinderConfiguration.getCompleteConfiguration(AvroSourceApplication.class))
|
||||
.web(WebApplicationType.NONE).run("--server.port=0",
|
||||
@@ -118,7 +118,7 @@ class AvroSchemaRegistryClientMessageConverterTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSchemaImportConfiguration() throws Exception {
|
||||
public void schemaImportConfiguration() throws Exception {
|
||||
|
||||
try (ConfigurableApplicationContext context = new SpringApplicationBuilder(
|
||||
TestChannelBinderConfiguration.getCompleteConfiguration(AvroSourceApplication.class))
|
||||
@@ -146,7 +146,7 @@ class AvroSchemaRegistryClientMessageConverterTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNoCacheConfiguration() {
|
||||
public void noCacheConfiguration() {
|
||||
ConfigurableApplicationContext sourceContext = SpringApplication
|
||||
.run(NoCacheConfiguration.class, "--spring.main.web-environment=false");
|
||||
AvroSchemaRegistryClientMessageConverter converter = sourceContext
|
||||
@@ -157,7 +157,7 @@ class AvroSchemaRegistryClientMessageConverterTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNamedCacheIsRequested() {
|
||||
public void namedCacheIsRequested() {
|
||||
CacheManager mockCache = Mockito.mock(CacheManager.class);
|
||||
when(mockCache.getCache(any())).thenReturn(new NoOpCache(""));
|
||||
AvroSchemaServiceManager manager = new AvroSchemaServiceManagerImpl();
|
||||
|
||||
@@ -29,9 +29,6 @@ import org.springframework.web.context.WebApplicationContext;
|
||||
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @author Christian Tzolov
|
||||
*/
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.context.ConfigurableApplicationContext;
|
||||
class EntityScanningTests {
|
||||
|
||||
@Test
|
||||
public void testApplicationWithEmbeddedSchemaRegistryServerOutsideOfRootPackage()
|
||||
public void applicationWithEmbeddedSchemaRegistryServerOutsideOfRootPackage()
|
||||
throws Exception {
|
||||
final ConfigurableApplicationContext context = SpringApplication
|
||||
.run(CustomApplicationEmbeddingSchemaServer.class, "--server.port=0");
|
||||
|
||||
@@ -142,7 +142,7 @@ class SchemaRegistryServerAvroTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnsupportedFormat() {
|
||||
public void unsupportedFormat() {
|
||||
Schema schema = toSchema("spring", "boot", null);
|
||||
try {
|
||||
this.client.postForEntity(this.serverControllerUri, schema, Schema.class);
|
||||
@@ -155,7 +155,7 @@ class SchemaRegistryServerAvroTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidSchema() {
|
||||
public void invalidSchema() {
|
||||
Schema schema = toSchema("boot", AVRO_FORMAT_NAME, "{}");
|
||||
try {
|
||||
this.client.postForEntity(this.serverControllerUri, schema, Schema.class);
|
||||
@@ -168,7 +168,7 @@ class SchemaRegistryServerAvroTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidSchemaGh22() {
|
||||
public void invalidSchemaGh22() {
|
||||
Schema schema = toSchema("boot", AVRO_FORMAT_NAME,
|
||||
resourceToString("classpath:/invalid_schema.json"));
|
||||
try {
|
||||
@@ -183,7 +183,7 @@ class SchemaRegistryServerAvroTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRegister1AvroSchema() {
|
||||
public void register1AvroSchema() {
|
||||
Schema schema = toSchema("org.springframework.cloud.stream.schema.User", AVRO_FORMAT_NAME,
|
||||
resourceToString("classpath:/avro_user_definition_schema_v1.json"));
|
||||
registerSchemaAndAssertSuccess(schema, 1, 1);
|
||||
@@ -191,7 +191,7 @@ class SchemaRegistryServerAvroTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFindByIdFound() {
|
||||
public void findByIdFound() {
|
||||
|
||||
ResponseEntity<Schema> registerSchemaReponse = registerSchemaAndAssertSuccess(
|
||||
AVRO_USER_REGISTRY_SCHEMA_V1, 1, 1);
|
||||
@@ -210,7 +210,7 @@ class SchemaRegistryServerAvroTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFindByIdNotFound() {
|
||||
public void findByIdNotFound() {
|
||||
|
||||
registerSchemaAndAssertSuccess(AVRO_USER_REGISTRY_SCHEMA_V1, 1, 1);
|
||||
|
||||
@@ -226,12 +226,12 @@ class SchemaRegistryServerAvroTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUserSchemaV2() {
|
||||
public void userSchemaV2() {
|
||||
registerSchemasAndAssertSuccess(AVRO_USER_REGISTRY_SCHEMA_V1, AVRO_USER_REGISTRY_SCHEMA_V2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIdempotentRegistration() {
|
||||
public void idempotentRegistration() {
|
||||
|
||||
registerSchemaAndAssertSuccess(AVRO_USER_REGISTRY_SCHEMA_V1, 1, 1);
|
||||
|
||||
@@ -245,7 +245,7 @@ class SchemaRegistryServerAvroTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSchemaDeletionBySubjectFormatVersion() {
|
||||
public void schemaDeletionBySubjectFormatVersion() {
|
||||
|
||||
ResponseEntity<Schema> registerSchemaAndAssertSuccess = registerSchemaAndAssertSuccess(
|
||||
AVRO_USER_REGISTRY_SCHEMA_V1, 1, 1);
|
||||
@@ -273,7 +273,7 @@ class SchemaRegistryServerAvroTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSchemaDeletionBySubjectFormatVersionNotFound() {
|
||||
public void schemaDeletionBySubjectFormatVersionNotFound() {
|
||||
|
||||
ResponseEntity<Schema> registerSchemaAndAssertSuccess = registerSchemaAndAssertSuccess(
|
||||
AVRO_USER_REGISTRY_SCHEMA_V1, 1, 1);
|
||||
@@ -295,7 +295,7 @@ class SchemaRegistryServerAvroTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSchemaDeletionBySubjectFormatVersionNotAllowed() {
|
||||
public void schemaDeletionBySubjectFormatVersionNotAllowed() {
|
||||
|
||||
ResponseEntity<Schema> registerSchemaAndAssertSuccess = registerSchemaAndAssertSuccess(
|
||||
AVRO_USER_REGISTRY_SCHEMA_V1, 1, 1);
|
||||
@@ -313,7 +313,7 @@ class SchemaRegistryServerAvroTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSchemaDeletionById() {
|
||||
public void schemaDeletionById() {
|
||||
|
||||
ResponseEntity<Schema> registerSchemaAndAssertSuccess = registerSchemaAndAssertSuccess(
|
||||
AVRO_USER_REGISTRY_SCHEMA_V1, 1, 1);
|
||||
@@ -334,7 +334,7 @@ class SchemaRegistryServerAvroTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSchemaDeletionByIdNotFound() {
|
||||
public void schemaDeletionByIdNotFound() {
|
||||
|
||||
registerSchemaAndAssertSuccess(AVRO_USER_REGISTRY_SCHEMA_V1, 1, 1);
|
||||
|
||||
@@ -352,7 +352,7 @@ class SchemaRegistryServerAvroTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSchemaDeletionByIdNotAllowed() {
|
||||
public void schemaDeletionByIdNotAllowed() {
|
||||
|
||||
ResponseEntity<Schema> registerSchemaAndAssertSuccess = registerSchemaAndAssertSuccess(
|
||||
AVRO_USER_REGISTRY_SCHEMA_V1, 1, 1);
|
||||
@@ -372,7 +372,7 @@ class SchemaRegistryServerAvroTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSchemaDeletionBySubject() {
|
||||
public void schemaDeletionBySubject() {
|
||||
Map<String, Map<String, List<ResponseEntity<Schema>>>> registerSchemaResponsesByFormatBySubject = registerSchemasAndAssertSuccess(
|
||||
AVRO_USER_REGISTRY_SCHEMA_V1,
|
||||
AVRO_USER_REGISTRY_SCHEMA_V2, AAVRO_USER_REGISTRY_SCHEMA_V1_WITH_QUAL_SUBJECT);
|
||||
@@ -409,7 +409,7 @@ class SchemaRegistryServerAvroTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSchemaDeletionBySubjectNotFound() {
|
||||
public void schemaDeletionBySubjectNotFound() {
|
||||
|
||||
registerSchemaAndAssertSuccess(AVRO_USER_REGISTRY_SCHEMA_V1, 1, 1);
|
||||
|
||||
@@ -423,7 +423,7 @@ class SchemaRegistryServerAvroTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSchemaDeletionBySubjectNotAllowed() {
|
||||
public void schemaDeletionBySubjectNotAllowed() {
|
||||
|
||||
ResponseEntity<Schema> registerSchemaAndAssertSuccess = registerSchemaAndAssertSuccess(
|
||||
AVRO_USER_REGISTRY_SCHEMA_V1, 1, 1);
|
||||
@@ -443,7 +443,7 @@ class SchemaRegistryServerAvroTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFindSchemasBySubjectAndVersion() {
|
||||
public void findSchemasBySubjectAndVersion() {
|
||||
|
||||
Map<String, Map<String, List<ResponseEntity<Schema>>>> registerSchemaResponsesByFormatBySubject = registerSchemasAndAssertSuccess(
|
||||
AVRO_USER_REGISTRY_SCHEMA_V1,
|
||||
@@ -471,7 +471,7 @@ class SchemaRegistryServerAvroTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFindBySubjectAndFormatOrderByVersionAscNoMatch() {
|
||||
public void findBySubjectAndFormatOrderByVersionAscNoMatch() {
|
||||
String subject = "test";
|
||||
|
||||
String format = AVRO_FORMAT_NAME;
|
||||
@@ -484,7 +484,7 @@ class SchemaRegistryServerAvroTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFindSchemasBySubjectAndFormat() {
|
||||
public void findSchemasBySubjectAndFormat() {
|
||||
|
||||
Map<String, Map<String, List<ResponseEntity<Schema>>>> registerSchemaResponsesByFormatBySubject = registerSchemasAndAssertSuccess(
|
||||
AVRO_USER_REGISTRY_SCHEMA_V1,
|
||||
|
||||
Reference in New Issue
Block a user