Skip to content

Commit 5d19c9d

Browse files
committed
Start version 5.2.0
* Upgrade to Spring Boot `3.5.9` * Upgrade all the possible dependencies to the latest supported by the mentioned Spring Boot * Upgrade to Gradle `9.2.1` * Add `junit-platform-launcher` dependency as it looks like it is not supplied by the `spring-boot-starter-test` anymore * Add `org.eclipse.paho.client.mqttv3` dependency into `spring-mqtt-common` as it is optional in Spring Integration now * Fix `spring-computer-vision-function` for `djl-0.36.0` compatibility
1 parent 9b300c5 commit 5d19c9d

12 files changed

Lines changed: 31 additions & 21 deletions

File tree

build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77
id 'base'
88
id 'io.spring.dependency-management' version '1.1.7'
99
id 'io.spring.javaformat' version "${javaFormatVersion}"
10-
id 'com.github.spotbugs' version '6.1.13'
10+
id 'com.github.spotbugs' version '6.4.8'
1111
}
1212

1313
description = 'Spring Functions Catalog'
@@ -138,6 +138,8 @@ configure(javaProjects) { subproject ->
138138
testImplementation 'org.awaitility:awaitility'
139139
testImplementation 'org.testcontainers:junit-jupiter'
140140

141+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
142+
141143
// NOTE: We explicitly specify checkstyle dep before javaformat checkstyle due to antlr class mismatch
142144
checkstyle("com.puppycrawl.tools:checkstyle:${checkstyle.toolVersion}")
143145
checkstyle("io.spring.javaformat:spring-javaformat-checkstyle:${javaFormatVersion}")

common/spring-metadata-store-common/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ dependencies {
1717
optionalApi 'software.amazon.awssdk:dynamodb'
1818

1919
testImplementation 'org.hsqldb:hsqldb'
20-
testImplementation 'org.apache.curator:curator-test:5.7.1'
20+
testImplementation 'org.apache.curator:curator-test:5.9.0'
2121
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
dependencies {
22
api 'org.springframework.integration:spring-integration-mqtt'
3+
api 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5'
34
}

dependencies.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
ext {
2-
springBootVersion = '3.4.13'
3-
springCloudAwsVersion = '3.2.1'
2+
springBootVersion = '3.5.9'
3+
springCloudAwsVersion = '3.4.2'
44

5-
debeziumVersion = '3.0.8.Final'
6-
djlVersion = '0.26.0'
5+
debeziumVersion = '3.1.3.Final'
6+
djlVersion = '0.36.0'
77

88
springIntegrationAws = 'org.springframework.integration:spring-integration-aws:3.0.10'
99
ftpServerCore = 'org.apache.ftpserver:ftpserver-core:1.2.1'

function/spring-computer-vision-function/src/main/java/org/springframework/cloud/fn/computer/vision/JsonHelper.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.springframework.cloud.fn.computer.vision;
1818

1919
import java.lang.reflect.Type;
20+
import java.util.Arrays;
2021
import java.util.List;
2122

2223
import ai.djl.modality.Classifications;
@@ -39,6 +40,7 @@
3940
* {@link Classifications}, {@link CategoryMask} and {@link Joints} to/from JSON.
4041
*
4142
* @author Christian Tzolov
43+
* @author Artem Bilan
4244
*/
4345
public final class JsonHelper {
4446

@@ -68,7 +70,10 @@ public static String toJson(Classifications classifications) {
6870
}
6971

7072
public static Classifications toClassifications(String json) {
71-
return GSON.fromJson(json, Classifications.class);
73+
Classifications.Classification[] classifications = GSON.fromJson(json, Classifications.Classification[].class);
74+
return new Classifications(
75+
Arrays.stream(classifications).map(Classifications.Classification::getClassName).toList(),
76+
Arrays.stream(classifications).map(Classifications.Classification::getProbability).toList());
7277
}
7378

7479
private static final Gson GSON2 = JsonUtils.builder()
@@ -80,7 +85,11 @@ public static String toJson(DetectedObjects detectedObject) {
8085
}
8186

8287
public static DetectedObjects toDetectedObjects(String json) {
83-
return GSON2.fromJson(json, DetectedObjects.class);
88+
DetectedObjects.DetectedObject[] detectedObjects = GSON2.fromJson(json, DetectedObjects.DetectedObject[].class);
89+
return new DetectedObjects(
90+
Arrays.stream(detectedObjects).map(DetectedObjects.DetectedObject::getClassName).toList(),
91+
Arrays.stream(detectedObjects).map(DetectedObjects.DetectedObject::getProbability).toList(),
92+
Arrays.stream(detectedObjects).map(DetectedObjects.DetectedObject::getBoundingBox).toList());
8493
}
8594

8695
public record Mask(List<String> classes, int[][] mask) {

function/spring-computer-vision-function/src/test/java/org/springframework/cloud/fn/computer/vision/ComputerVisionFunctionConfigurationTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ public void tf2SavedModel() {
107107
}
108108

109109
@Test
110+
@DisabledOnOs(OS.WINDOWS)
110111
public void yolov8Detection() {
111112
applicationContextRunner.withPropertyValues(
112113
// @formatter:off

function/spring-computer-vision-function/src/test/java/org/springframework/cloud/fn/computer/vision/JsonHelperTests.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
/**
3030
* @author Christian Tzolov
31+
* @author Artem Bilan
3132
*/
3233
public class JsonHelperTests {
3334

@@ -58,8 +59,8 @@ public void classifications() {
5859

5960
var classifications2 = JsonHelper.toClassifications(json);
6061

61-
assertThat(classifications2.getClassNames()).isEqualTo(classifications.getClassNames());
62-
assertThat(classifications2.getProbabilities()).isEqualTo(classifications.getProbabilities());
62+
assertThat(classifications2.getClassNames()).containsAll(classifications.getClassNames());
63+
assertThat(classifications2.getProbabilities()).containsAll(classifications.getProbabilities());
6364
assertThat(classifications2.topK()).hasSize(3);
6465
}
6566

@@ -75,8 +76,8 @@ public void detectedObjects() {
7576

7677
var detectedObjects2 = JsonHelper.toDetectedObjects(json);
7778

78-
assertThat(detectedObjects2.getClassNames()).isEqualTo(detectedObjects.getClassNames());
79-
assertThat(detectedObjects2.getProbabilities()).isEqualTo(detectedObjects.getProbabilities());
79+
assertThat(detectedObjects2.getClassNames()).containsAll(detectedObjects.getClassNames());
80+
assertThat(detectedObjects2.getProbabilities()).containsAll(detectedObjects.getProbabilities());
8081
assertThat(detectedObjects2.topK()).hasSize(3);
8182

8283
assertThat(detectedObjects2.getNumberOfObjects()).isEqualTo(3);

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version=5.1.2-SNAPSHOT
1+
version=5.2.0-SNAPSHOT
22
org.gradle.jvmargs=-Xmx1536M -Dfile.encoding=UTF-8
33
org.gradle.caching=true
44
org.gradle.parallel=true

gradle/wrapper/gradle-wrapper.jar

1.83 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=7197a12f450794931532469d4ff21a59ea2c1cd59a3ec3f89c035c3c420a6999
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
3+
distributionSha256Sum=72f44c9f8ebcb1af43838f45ee5c4aa9c5444898b3468ab3f4af7b6076c5bc3f
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)