From 9edfa2bba9a9a8a46313579fc0f25b2eef86fba4 Mon Sep 17 00:00:00 2001 From: Neil Avery Date: Sat, 24 Feb 2024 10:43:41 +0000 Subject: [PATCH] new packages and exception check (#272) Co-authored-by: navery-max --- build.gradle.kts | 6 +++--- .../specmesh/cli/ProvisionFunctionalTest.java | 19 +++++++++++++++++++ kafka/build.gradle.kts | 2 +- .../java/io/specmesh/kafka/KafkaApiSpec.java | 2 +- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index da29536a..dbdc2439 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,11 +18,11 @@ plugins { java `maven-publish` signing - id("com.github.spotbugs") version "5.1.3" + id("com.github.spotbugs") version "6.0.7" id("com.diffplug.spotless") version "6.25.0" id("pl.allegro.tech.build.axion-release") version "1.16.1" id("io.github.gradle-nexus.publish-plugin") version "1.3.0" - id("com.bmuschko.docker-remote-api") version "9.3.6" apply false + id("com.bmuschko.docker-remote-api") version "9.4.0" apply false } project.version = scmVersion.version @@ -74,7 +74,7 @@ subprojects { set("medeiaValidatorVersion", "1.1.0") set("junitVersion", "5.10.1") set("mockitoVersion", "5.10.0") - set("junitPioneerVersion", "2.1.0") + set("junitPioneerVersion", "2.2.0") set("spotBugsVersion", "4.8.3") set("hamcrestVersion", "1.3") set("log4jVersion", "2.22.1") // https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core diff --git a/cli/src/test/java/io/specmesh/cli/ProvisionFunctionalTest.java b/cli/src/test/java/io/specmesh/cli/ProvisionFunctionalTest.java index 95658e92..cc6764a7 100644 --- a/cli/src/test/java/io/specmesh/cli/ProvisionFunctionalTest.java +++ b/cli/src/test/java/io/specmesh/cli/ProvisionFunctionalTest.java @@ -18,12 +18,15 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; import io.specmesh.kafka.DockerKafkaEnvironment; import io.specmesh.kafka.KafkaEnvironment; +import io.specmesh.kafka.provision.Status; import io.specmesh.kafka.provision.TopicProvisioner.Topic; +import java.util.List; import java.util.Set; import java.util.stream.Collectors; import org.apache.kafka.clients.admin.ListTopicsResult; @@ -50,6 +53,22 @@ void shouldProvisionCmdWithLombock() throws Exception { assertThat(provision.brokerUrl(), is("borker")); } + @Test + void shouldNotSwallowExceptions() throws Exception { + final var topic = Topic.builder().build(); + final var swallowed = + Status.builder() + .topics( + List.of( + topic.exception( + new RuntimeException( + new RuntimeException("swallowed"))))) + .build(); + assertThat( + swallowed.topics().iterator().next().exception().toString(), + containsString(".java:")); + } + /** * Provision all resources apart from schemas. note: Dont specify SR credentials to avoid schema * publishing diff --git a/kafka/build.gradle.kts b/kafka/build.gradle.kts index e9449c2a..6f49cb7a 100644 --- a/kafka/build.gradle.kts +++ b/kafka/build.gradle.kts @@ -41,7 +41,7 @@ dependencies { implementation("org.apache.kafka:kafka-streams:$kafkaVersion") implementation("org.apache.kafka:kafka-clients:$kafkaVersion") - implementation("commons-io:commons-io:2.15.0") + implementation("commons-io:commons-io:2.15.1") implementation("com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion") implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:$jacksonVersion") diff --git a/kafka/src/main/java/io/specmesh/kafka/KafkaApiSpec.java b/kafka/src/main/java/io/specmesh/kafka/KafkaApiSpec.java index 11b52fe9..2020b3d3 100644 --- a/kafka/src/main/java/io/specmesh/kafka/KafkaApiSpec.java +++ b/kafka/src/main/java/io/specmesh/kafka/KafkaApiSpec.java @@ -54,7 +54,7 @@ import org.apache.kafka.common.resource.ResourceType; /** Kafka entity mappings from the AsyncAPISpec */ -public class KafkaApiSpec { +public final class KafkaApiSpec { private static final String GRANT_ACCESS_TAG = "grant-access:";