From 883c459037e278d37c90084bc1491f0a6b8f11ac Mon Sep 17 00:00:00 2001 From: Henry Avetisyan Date: Thu, 16 Nov 2023 08:01:02 -0800 Subject: [PATCH] 1.10.x release - update dependencies + unit tests Signed-off-by: Henry Avetisyan --- clients/java/zts/core/pom.xml | 2 +- containers/jetty/pom.xml | 2 +- libs/java/server_common/pom.xml | 14 ++++----- .../log/jetty/JettyConnectionLoggerTest.java | 11 ++++--- .../impl/MetricNotificationServiceTest.java | 20 ++++++++----- pom.xml | 30 +++++++++---------- screwdriver/scripts/publish.sh | 24 ++++++++++----- 7 files changed, 61 insertions(+), 42 deletions(-) diff --git a/clients/java/zts/core/pom.xml b/clients/java/zts/core/pom.xml index d6d179fa574..46312d0760d 100644 --- a/clients/java/zts/core/pom.xml +++ b/clients/java/zts/core/pom.xml @@ -172,7 +172,7 @@ org.ehcache ehcache - 3.9.9 + 3.10.8 diff --git a/containers/jetty/pom.xml b/containers/jetty/pom.xml index 16fa1d55123..9e2ecd02d0b 100644 --- a/containers/jetty/pom.xml +++ b/containers/jetty/pom.xml @@ -158,7 +158,7 @@ com.gu kinesis-logback-appender - 2.1.0 + 2.1.1 software.amazon.awssdk diff --git a/libs/java/server_common/pom.xml b/libs/java/server_common/pom.xml index 1d6f798e48c..6c4ca1ce747 100644 --- a/libs/java/server_common/pom.xml +++ b/libs/java/server_common/pom.xml @@ -34,7 +34,7 @@ org.apache.pulsar pulsar-client - 2.10.2 + 3.1.1 org.bouncycastle @@ -61,7 +61,7 @@ com.fasterxml.uuid java-uuid-generator - 4.0.1 + 4.3.0 ${project.groupId} @@ -188,17 +188,17 @@ com.google.protobuf protobuf-java - 3.19.6 + 3.24.4 org.apache.commons commons-dbcp2 - 2.9.0 + 2.11.0 org.apache.commons commons-pool2 - 2.11.1 + 2.12.0 commons-logging @@ -253,7 +253,7 @@ uk.co.datumedge hamcrest-json - 0.2 + 0.3 test @@ -265,7 +265,7 @@ com.amazonaws.secretsmanager aws-secretsmanager-jdbc - 1.0.8 + 2.0.0 diff --git a/libs/java/server_common/src/test/java/com/yahoo/athenz/common/server/log/jetty/JettyConnectionLoggerTest.java b/libs/java/server_common/src/test/java/com/yahoo/athenz/common/server/log/jetty/JettyConnectionLoggerTest.java index d89d3520b24..1f16255f174 100644 --- a/libs/java/server_common/src/test/java/com/yahoo/athenz/common/server/log/jetty/JettyConnectionLoggerTest.java +++ b/libs/java/server_common/src/test/java/com/yahoo/athenz/common/server/log/jetty/JettyConnectionLoggerTest.java @@ -65,15 +65,18 @@ public void testStartStopConnectionFailedHandshake() throws Exception { when(mockConnection2.getEndPoint().isOpen()).thenReturn(false); jettyConnectionLogger.handshakeFailed(event, sslHandshakeException); - + Mockito.verify(connectionLog, Mockito.times(1)).log(connectionLogEntryArgumentCaptor.capture()); Mockito.verify(metric, Mockito.times(1)).increment(Mockito.eq(CONNECTION_LOGGER_METRIC_DEFAULT_NAME), metricArgumentCaptor.capture()); assertEquals("no cipher suites in common", connectionLogEntryArgumentCaptor.getValue().sslHandshakeFailureMessage().get()); assertFalse(connectionLogEntryArgumentCaptor.getValue().sslHandshakeFailureCause().isPresent()); List allMetricValues = metricArgumentCaptor.getAllValues(); - assertEquals(2, allMetricValues.size()); - assertEquals("failureType", allMetricValues.get(0)); - assertEquals("INCOMPATIBLE_CLIENT_CIPHER_SUITES", allMetricValues.get(1)); + assertEquals(allMetricValues.size(), 1); + String[] testValue = allMetricValues.get(0); + assertEquals(testValue.length, 2); + assertEquals("failureType", testValue[0]); + assertEquals("INCOMPATIBLE_CLIENT_CIPHER_SUITES", testValue[1]); + jettyConnectionLogger.doStop(); } @Test diff --git a/libs/java/server_common/src/test/java/com/yahoo/athenz/common/server/notification/impl/MetricNotificationServiceTest.java b/libs/java/server_common/src/test/java/com/yahoo/athenz/common/server/notification/impl/MetricNotificationServiceTest.java index 4403981fd37..cd1d81fd786 100644 --- a/libs/java/server_common/src/test/java/com/yahoo/athenz/common/server/notification/impl/MetricNotificationServiceTest.java +++ b/libs/java/server_common/src/test/java/com/yahoo/athenz/common/server/notification/impl/MetricNotificationServiceTest.java @@ -72,17 +72,23 @@ public void testNotify() { assertEquals("athenz_notification", captorMetric.getAllValues().get(1)); // Mockito captures all varargs arguments in a single array - assertEquals(12, captorAttributes.getAllValues().size()); - List expectedAttributes = new ArrayList(Arrays.asList( + assertEquals(2, captorAttributes.getAllValues().size()); + + String[] collectedAttributes1 = captorAttributes.getAllValues().get(0); + assertEquals(6, collectedAttributes1.length); + List expectedAttributes1 = Arrays.asList( "key1", "attribute11", "key2", "attribute12", - "key3", "attribute13", + "key3", "attribute13"); + assertEquals(expectedAttributes1, Arrays.asList(collectedAttributes1)); + + String[] collectedAttributes2 = captorAttributes.getAllValues().get(1); + assertEquals(6, collectedAttributes2.length); + List expectedAttributes2 = Arrays.asList( "key1", "attribute21", "key2", "attribute22", - "key3", "attribute23" - )); - - assertEquals(expectedAttributes, captorAttributes.getAllValues()); + "key3", "attribute23"); + assertEquals(expectedAttributes2, Arrays.asList(collectedAttributes2)); } } diff --git a/pom.xml b/pom.xml index 59094f96699..c6620d9f91e 100644 --- a/pom.xml +++ b/pom.xml @@ -71,27 +71,27 @@ - 9.4.49.v20220914 - 2.37 - 2.13.4 - 2.13.4.2 + 9.4.53.v20231009 + 2.41 + 2.14.3 + 2.14.3 1.5.4 - 1.75 - 1.12.325 - 2.17.294 - 31.1-jre + 1.77 + 1.12.590 + 2.21.24 + 32.1.3-jre 1.7.36 - 1.2.11 + 1.2.12 3.1.0 2.1.1 - 4.8.1 + 4.11.0 1.49 0.11.5 2.3.3 - 9.25.6 - 8.0.31 - 1.3.2 - 4.5.13 + 9.37.1 + 8.0.33 + 1.3.4 + 4.5.14 4.7.5.Final 3.0.0-M6 3.2.4 @@ -100,7 +100,7 @@ 3.8.1 1.1.1 0.8.5 - 2.2.4 + 2.2.19 2.2 UTF-8 UTF-8 diff --git a/screwdriver/scripts/publish.sh b/screwdriver/scripts/publish.sh index 85b885511bf..7eba52ef231 100755 --- a/screwdriver/scripts/publish.sh +++ b/screwdriver/scripts/publish.sh @@ -5,13 +5,23 @@ function deployProject () max_retry=3 counter=0 echo "Publishing package $1..." - until mvn -B deploy -P ossrh -Dmaven.test.skip=true --projects $1 --settings screwdriver/settings/settings-publish.xml - do - [[ counter -eq $max_retry ]] && echo "Failed to deploy package $1" && exit 1 - counter=$(( $counter + 1 )) - sleep 30 - echo "Re-trying to publish package (attempt #$counter)" - done + + # before publishing we need to make sure that the package + # is not being asked to be skipped since it was already + # published in a previous build + + if [[ $PUBLISH_SKIP_PACKAGES == *"$1"* ]] + then + echo "Package $1 already published. Skipping..." + else + until mvn -B deploy -P ossrh -Dmaven.test.skip=true --projects $1 --settings screwdriver/settings/settings-publish.xml + do + [[ counter -eq $max_retry ]] && echo "Failed to deploy package $1" && exit 1 + counter=$(( $counter + 1 )) + sleep 30 + echo "Re-trying to publish package (attempt #$counter)" + done + fi } # for openssl 1.1+ we need to add -pbkdf2 to remove the