From 753872c05ecc43c07d36eee96f86c6ee2ba38bad Mon Sep 17 00:00:00 2001 From: thcai Date: Mon, 14 Oct 2024 17:12:23 +0200 Subject: [PATCH] fix conflicts solving --- .../controller/SchemaControllerTest.java | 36 ++++++++----------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/src/test/java/com/michelin/ns4kafka/controller/SchemaControllerTest.java b/src/test/java/com/michelin/ns4kafka/controller/SchemaControllerTest.java index 9e77d5d6..607c9a1b 100644 --- a/src/test/java/com/michelin/ns4kafka/controller/SchemaControllerTest.java +++ b/src/test/java/com/michelin/ns4kafka/controller/SchemaControllerTest.java @@ -638,15 +638,14 @@ void shouldNotDeleteSchemaVersionInDryRunMode() { @Test void shouldBulkDeleteAllSchemaVersions() { Namespace namespace = buildNamespace(); - Schema schema1 = buildSchema(); - SchemaList schemaList = buildSchemaList(); + Schema schema = buildSchemaNameOnly(); when(namespaceService.findByName("myNamespace")) .thenReturn(Optional.of(namespace)); when(schemaService.findByWildcardName(namespace, "prefix.subject-value")) - .thenReturn(Flux.fromIterable(List.of(schemaList))); + .thenReturn(Flux.fromIterable(List.of(schema))); when(schemaService.getSubjectLatestVersion(namespace, "prefix.subject-value")) - .thenReturn(Mono.just(schema1)); + .thenReturn(Mono.just(schema)); when(schemaService.deleteAllVersions(namespace, "prefix.subject-value")) .thenReturn(Mono.just(new Integer[1])); @@ -660,13 +659,12 @@ void shouldBulkDeleteAllSchemaVersions() { @Test void shouldBulkDeleteSchemaVersion() { Namespace namespace = buildNamespace(); - Schema schema = buildSchema(); - SchemaList schemaList = buildSchemaList(); + Schema schema = buildSchemaNameOnly(); when(namespaceService.findByName("myNamespace")) .thenReturn(Optional.of(namespace)); when(schemaService.findByWildcardName(namespace, "prefix.subject-value")) - .thenReturn(Flux.fromIterable(List.of(schemaList))); + .thenReturn(Flux.fromIterable(List.of(schema))); when(schemaService.getSubjectByVersion(namespace, "prefix.subject-value", "1")) .thenReturn(Mono.just(schema)); when(schemaService.deleteVersion(namespace, "prefix.subject-value", "1")) @@ -715,14 +713,13 @@ void shouldNotBulkDeleteSchemaVersionWhenEmpty() { @Test void shouldNotBulkDeleteAllSchemaVersionsWhenVersionNotFound() { Namespace namespace = buildNamespace(); - Schema schema = buildSchema(); - SchemaList schemaList = buildSchemaList(); - SchemaList schemaList2 = buildSchemaList2(); + Schema schema = buildSchemaNameOnly(); + Schema schema2 = buildSchemaNameOnly2(); when(namespaceService.findByName("myNamespace")) .thenReturn(Optional.of(namespace)); when(schemaService.findByWildcardName(namespace, "prefix.subject*")) - .thenReturn(Flux.fromIterable(List.of(schemaList, schemaList2))); + .thenReturn(Flux.fromIterable(List.of(schema, schema2))); when(schemaService.getSubjectLatestVersion(namespace, "prefix.subject-value")) .thenReturn(Mono.just(schema)); when(schemaService.getSubjectLatestVersion(namespace, "prefix.subject2-value")) @@ -739,14 +736,13 @@ void shouldNotBulkDeleteAllSchemaVersionsWhenVersionNotFound() { @Test void shouldNotBulkDeleteSchemaVersionWhenVersionNotFound() { Namespace namespace = buildNamespace(); - Schema schema = buildSchema(); - SchemaList schemaList = buildSchemaList(); - SchemaList schemaList2 = buildSchemaList2(); + Schema schema = buildSchemaNameOnly(); + Schema schema2 = buildSchemaNameOnly2(); when(namespaceService.findByName("myNamespace")) .thenReturn(Optional.of(namespace)); when(schemaService.findByWildcardName(namespace, "prefix.subject*")) - .thenReturn(Flux.fromIterable(List.of(schemaList, schemaList2))); + .thenReturn(Flux.fromIterable(List.of(schema, schema2))); when(schemaService.getSubjectByVersion(namespace, "prefix.subject-value", "1")) .thenReturn(Mono.just(schema)); when(schemaService.getSubjectByVersion(namespace, "prefix.subject2-value", "1")) @@ -763,13 +759,12 @@ void shouldNotBulkDeleteSchemaVersionWhenVersionNotFound() { @Test void shouldNotBulkDeleteAllSchemaVersionsInDryRunMode() { Namespace namespace = buildNamespace(); - Schema schema = buildSchema(); - SchemaList schemaList = buildSchemaList(); + Schema schema = buildSchemaNameOnly(); when(namespaceService.findByName("myNamespace")) .thenReturn(Optional.of(namespace)); when(schemaService.findByWildcardName(namespace, "prefix.subject-value")) - .thenReturn(Flux.fromIterable(List.of(schemaList))); + .thenReturn(Flux.fromIterable(List.of(schema))); when(schemaService.getSubjectLatestVersion(namespace, "prefix.subject-value")) .thenReturn(Mono.just(schema)); @@ -783,13 +778,12 @@ void shouldNotBulkDeleteAllSchemaVersionsInDryRunMode() { @Test void shouldNotBulkDeleteSchemaVersionInDryRunMode() { Namespace namespace = buildNamespace(); - Schema schema = buildSchema(); - SchemaList schemaList = buildSchemaList(); + Schema schema = buildSchemaNameOnly(); when(namespaceService.findByName("myNamespace")) .thenReturn(Optional.of(namespace)); when(schemaService.findByWildcardName(namespace, "prefix.subject-value")) - .thenReturn(Flux.fromIterable(List.of(schemaList))); + .thenReturn(Flux.fromIterable(List.of(schema))); when(schemaService.getSubjectByVersion(namespace, "prefix.subject-value", "1")) .thenReturn(Mono.just(schema));