Browse Source

Bump dependencies (#1664)

* Bump dependencies

Signed-off-by: Roman Zabaluev <rzabaluev@provectus.com>

* Fix tests

Signed-off-by: Roman Zabaluev <rzabaluev@provectus.com>
Roman Zabaluev 3 years ago
parent
commit
ea9a145583

+ 2 - 3
kafka-ui-api/src/main/java/com/provectus/kafka/ui/exception/GlobalErrorWebExceptionHandler.java

@@ -10,7 +10,7 @@ import java.util.Objects;
 import java.util.Set;
 import java.util.Set;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import java.util.stream.Stream;
-import org.springframework.boot.autoconfigure.web.ResourceProperties;
+import org.springframework.boot.autoconfigure.web.WebProperties;
 import org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler;
 import org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler;
 import org.springframework.boot.web.reactive.error.ErrorAttributes;
 import org.springframework.boot.web.reactive.error.ErrorAttributes;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ApplicationContext;
@@ -36,10 +36,9 @@ import reactor.core.publisher.Mono;
 public class GlobalErrorWebExceptionHandler extends AbstractErrorWebExceptionHandler {
 public class GlobalErrorWebExceptionHandler extends AbstractErrorWebExceptionHandler {
 
 
   public GlobalErrorWebExceptionHandler(ErrorAttributes errorAttributes,
   public GlobalErrorWebExceptionHandler(ErrorAttributes errorAttributes,
-                                        ResourceProperties resourceProperties,
                                         ApplicationContext applicationContext,
                                         ApplicationContext applicationContext,
                                         ServerCodecConfigurer codecConfigurer) {
                                         ServerCodecConfigurer codecConfigurer) {
-    super(errorAttributes, resourceProperties, applicationContext);
+    super(errorAttributes, new WebProperties.Resources(), applicationContext);
     this.setMessageWriters(codecConfigurer.getWriters());
     this.setMessageWriters(codecConfigurer.getWriters());
   }
   }
 
 

+ 16 - 7
kafka-ui-api/src/test/java/com/provectus/kafka/ui/serde/schemaregistry/SchemaRegistryAwareRecordSerDeTest.java

@@ -60,6 +60,7 @@ class SchemaRegistryAwareRecordSerDeTest {
 
 
       int schemaId = 1234;
       int schemaId = 1234;
       when(registryClient.getSchemaById(schemaId)).thenReturn(schema);
       when(registryClient.getSchemaById(schemaId)).thenReturn(schema);
+      when(registryClient.getSchemaBySubjectAndId(null, schemaId)).thenReturn(schema);
 
 
       var result = serde.deserialize(
       var result = serde.deserialize(
           new ConsumerRecord<>(
           new ConsumerRecord<>(
@@ -71,8 +72,10 @@ class SchemaRegistryAwareRecordSerDeTest {
           )
           )
       );
       );
 
 
-      // called twice: once by serde code, once by formatter (will be cached)
-      verify(registryClient, times(2)).getSchemaById(schemaId);
+      // called once by serde code
+      verify(registryClient, times(1)).getSchemaById(schemaId);
+      //called once by formatter (will be cached)
+      verify(registryClient, times(1)).getSchemaBySubjectAndId(null, schemaId);
 
 
       assertThat(result.getKeySchemaId()).isNull();
       assertThat(result.getKeySchemaId()).isNull();
       assertThat(result.getKeyFormat()).isEqualTo(MessageFormat.UNKNOWN);
       assertThat(result.getKeyFormat()).isEqualTo(MessageFormat.UNKNOWN);
@@ -115,23 +118,29 @@ class SchemaRegistryAwareRecordSerDeTest {
     @Test
     @Test
     void fallsBackToStringFormatterIfMagicByteAndSchemaIdFoundButFormatterFailed() throws Exception {
     void fallsBackToStringFormatterIfMagicByteAndSchemaIdFoundButFormatterFailed() throws Exception {
       int schemaId = 1234;
       int schemaId = 1234;
+
+      final var schema = new AvroSchema("{ \"type\": \"string\" }");
+
       when(registryClient.getSchemaById(schemaId))
       when(registryClient.getSchemaById(schemaId))
-          .thenReturn(new AvroSchema("{ \"type\": \"string\" }"));
+          .thenReturn(schema);
+      when(registryClient.getSchemaBySubjectAndId(null, schemaId)).thenReturn(schema);
 
 
       // will cause exception in avro deserializer
       // will cause exception in avro deserializer
-      Bytes nonAvroValue =  bytesWithMagicByteAndSchemaId(schemaId, "123".getBytes());
+      Bytes nonAvroValue = bytesWithMagicByteAndSchemaId(schemaId, "123".getBytes());
       var result = serde.deserialize(
       var result = serde.deserialize(
           new ConsumerRecord<>(
           new ConsumerRecord<>(
               "test-topic",
               "test-topic",
               1,
               1,
               100,
               100,
               Bytes.wrap("key".getBytes()),
               Bytes.wrap("key".getBytes()),
-             nonAvroValue
+              nonAvroValue
           )
           )
       );
       );
 
 
-      // called twice: once by serde code, once by formatter (will be cached)
-      verify(registryClient, times(2)).getSchemaById(schemaId);
+      // called once by serde code
+      verify(registryClient, times(1)).getSchemaById(schemaId);
+      //called once by formatter (will be cached)
+      verify(registryClient, times(1)).getSchemaBySubjectAndId(null, schemaId);
 
 
       assertThat(result.getKeySchemaId()).isNull();
       assertThat(result.getKeySchemaId()).isNull();
       assertThat(result.getKeyFormat()).isEqualTo(MessageFormat.UNKNOWN);
       assertThat(result.getKeyFormat()).isEqualTo(MessageFormat.UNKNOWN);

+ 2 - 2
pom.xml

@@ -14,7 +14,7 @@
         <maven.compiler.target>13</maven.compiler.target>
         <maven.compiler.target>13</maven.compiler.target>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 
 
-        <spring-boot.version>2.5.6</spring-boot.version>
+        <spring-boot.version>2.6.3</spring-boot.version>
         <jackson-databind-nullable.version>0.2.2</jackson-databind-nullable.version>
         <jackson-databind-nullable.version>0.2.2</jackson-databind-nullable.version>
         <org.mapstruct.version>1.4.2.Final</org.mapstruct.version>
         <org.mapstruct.version>1.4.2.Final</org.mapstruct.version>
         <org.projectlombok.version>1.18.20</org.projectlombok.version>
         <org.projectlombok.version>1.18.20</org.projectlombok.version>
@@ -33,7 +33,7 @@
         <swagger-annotations.version>1.6.0</swagger-annotations.version>
         <swagger-annotations.version>1.6.0</swagger-annotations.version>
         <springdoc-openapi-webflux-ui.version>1.2.32</springdoc-openapi-webflux-ui.version>
         <springdoc-openapi-webflux-ui.version>1.2.32</springdoc-openapi-webflux-ui.version>
         <avro.version>1.11.0</avro.version>
         <avro.version>1.11.0</avro.version>
-        <confluent.version>5.5.1</confluent.version>
+        <confluent.version>7.0.1</confluent.version>
         <apache.commons.version>2.2</apache.commons.version>
         <apache.commons.version>2.2</apache.commons.version>
         <test.containers.version>1.16.2</test.containers.version>
         <test.containers.version>1.16.2</test.containers.version>
         <junit-jupiter-engine.version>5.7.2</junit-jupiter-engine.version>
         <junit-jupiter-engine.version>5.7.2</junit-jupiter-engine.version>