Skip to content

Commit

Permalink
Bump Spring, Tomcat, Java, SnakeYaml, Jackson and other dependencies (E…
Browse files Browse the repository at this point in the history
  • Loading branch information
jwaeab authored Nov 11, 2024
1 parent dce6f7d commit ad1804f
Show file tree
Hide file tree
Showing 34 changed files with 369 additions and 300 deletions.
32 changes: 4 additions & 28 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,6 @@ jobs:
fail-fast: false
matrix:
include:
# Java 11 tests
- name: "Unit tests - Java 11"
java_version: 11
test_suite: 'test jacoco:report'
- name: "Style check - Java 11"
java_version: 11
test_suite: 'compile com.mycila:license-maven-plugin:check pmd:pmd pmd:cpd pmd:check pmd:cpd-check javadoc:jar'
- name: "Standalone integration 4.0 - Java 11"
java_version: 11
test_suite: 'verify -P docker-integration-test,standalone-integration-tests -DskipUTs'
artifacts_dir: "standalone-integration/target"
- name: "Standalone integration 4.1 - Java 11"
java_version: 11
test_suite: 'verify -P docker-integration-test,standalone-integration-tests -Dit.cassandra.version=4.1 -DskipUTs'
artifacts_dir: "standalone-integration/target"
- name: "Standalone integration 5.0- - Java 11"
java_version: 11
test_suite: 'verify -P docker-integration-test,standalone-integration-tests -Dit.cassandra.version=5.0 -DskipUTs'
artifacts_dir: "standalone-integration/target"
- name: "Python integration - Java 11"
java_version: 11
test_suite: 'verify -P docker-integration-test,python-integration-tests -DskipUTs'
artifacts_dir: "ecchronos-binary/target"

# Java 17 tests
- name: "Unit tests - Java 17"
java_version: 17
Expand All @@ -56,7 +32,7 @@ jobs:
test_suite: 'compile -Djava.version=17 com.mycila:license-maven-plugin:check pmd:pmd pmd:cpd pmd:check pmd:cpd-check javadoc:jar'
- name: "Standalone integration 4.0 - Java 17"
java_version: 17
test_suite: 'verify -P docker-integration-test,standalone-integration-tests -Djava.version=17 -DskipUTs'
test_suite: 'verify -P docker-integration-test,standalone-integration-tests -Dit.cassandra.version=4.0 -Djava.version=17 -DskipUTs'
artifacts_dir: "standalone-integration/target"
- name: "Standalone integration 4.1 - Java 17"
java_version: 17
Expand All @@ -68,7 +44,7 @@ jobs:
artifacts_dir: "standalone-integration/target"
- name: "Python integration - Java 17"
java_version: 17
test_suite: 'verify -P docker-integration-test,python-integration-tests -DskipUTs -Djava.version=17'
test_suite: 'verify -P docker-integration-test,python-integration-tests -Dit.cassandra.version=5.0 -Djava.version=17 -DskipUTs'
artifacts_dir: "ecchronos-binary/target"

# Java 21 tests
Expand All @@ -80,7 +56,7 @@ jobs:
test_suite: 'compile -Djava.version=21 com.mycila:license-maven-plugin:check pmd:pmd pmd:cpd pmd:check pmd:cpd-check javadoc:jar'
- name: "Standalone integration 4.0 - Java 21"
java_version: 21
test_suite: 'verify -P docker-integration-test,standalone-integration-tests -DskipUTs -Djava.version=21'
test_suite: 'verify -P docker-integration-test,standalone-integration-tests -Dit.cassandra.version=4.0 -Djava.version=21 -DskipUTs'
artifacts_dir: "standalone-integration/target"
- name: "Standalone integration 4.1 - Java 21"
java_version: 21
Expand All @@ -92,7 +68,7 @@ jobs:
artifacts_dir: "standalone-integration/target"
- name: "Python integration - Java 21"
java_version: 21
test_suite: 'verify -P docker-integration-test,python-integration-tests -Djava.version=21 -DskipUTs'
test_suite: 'verify -P docker-integration-test,python-integration-tests -Dit.cassandra.version=5.0 -Djava.version=21 -DskipUTs'
artifacts_dir: "ecchronos-binary/target"
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Version 6.0.0

* Bump Spring, Tomcat, Java, SnakeYaml, Jackson and various other dependencies - Issues #704, #754

## Version 5.0.5

* Update dependencies to C* 5.0 - Issue #734
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ More information on the REST interface of ecChronos is described in [REST.md](do

## Prerequisites

* JDK 11
* Python 3.8
* Java 17 / 21
* Python 3

### Installation

Expand Down
32 changes: 22 additions & 10 deletions application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,21 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<parent>
<groupId>com.ericsson.bss.cassandra.ecchronos</groupId>
<artifactId>parent</artifactId>
<version>6.0.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>

<artifactId>application</artifactId>
<description>Standalone application of ecChronos</description>
<name>EcChronos Application</name>

<dependencies>

<!-- Internal -->
<dependency>
<groupId>com.ericsson.bss.cassandra.ecchronos</groupId>
Expand Down Expand Up @@ -67,7 +70,7 @@

<!-- Cassandra driver -->
<dependency>
<groupId>com.datastax.oss</groupId>
<groupId>org.apache.cassandra</groupId>
<artifactId>java-driver-core</artifactId>
</dependency>

Expand Down Expand Up @@ -105,14 +108,25 @@

<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
</dependency>

<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
</dependency>

<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
</dependency>

<!-- metrics -->
<!-- Metrics -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>

<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-jmx</artifactId>
Expand Down Expand Up @@ -171,23 +185,21 @@
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.64</version>
<artifactId>bcpkix-jdk18on</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>
<!-- Exec Maven Plugin to run YamlToMarkdown during package -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLParameters;
import javax.net.ssl.TrustManagerFactory;
import javax.xml.bind.DatatypeConverter;
import jakarta.xml.bind.DatatypeConverter;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
import io.micrometer.jmx.JmxConfig;
import io.micrometer.jmx.JmxMeterRegistry;
import io.micrometer.prometheus.PrometheusConfig;
import io.micrometer.prometheus.PrometheusMeterRegistry;
import io.micrometer.prometheusmetrics.PrometheusConfig;
import io.micrometer.prometheusmetrics.PrometheusMeterRegistry;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;
import org.springframework.web.filter.OncePerRequestFilter;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.Filter;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;

@Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.ericsson.bss.cassandra.ecchronos.core.utils.NodeResolver;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -92,6 +93,7 @@ public RepairHistory repairHistory()
}

@Bean
@Primary
public RepairHistoryProvider repairHistoryProvider()
{
return repairHistoryProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.apache.catalina.connector.Connector;
import org.apache.coyote.http11.Http11NioProtocol;
import org.apache.tomcat.util.net.SSLHostConfig;
import org.apache.tomcat.util.net.SSLHostConfigCertificate;
import org.apache.tomcat.util.net.jsse.PEMFile;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -126,18 +127,21 @@ private SSLHostConfig getSslHostConfig(final Ssl ssl)

private void setCertificates(final SSLHostConfig sslHostConfig, final Ssl ssl)
{
SSLHostConfigCertificate sslHostConfigCertificate =
new SSLHostConfigCertificate(sslHostConfig, SSLHostConfigCertificate.Type.UNDEFINED);
sslHostConfig.addCertificate(sslHostConfigCertificate);
if (ssl.getCertificate() != null && ssl.getCertificatePrivateKey() != null)
{
sslHostConfig.setCertificateFile(getFilePath(ssl.getCertificate()));
sslHostConfig.setCertificateKeyFile(getFilePath(ssl.getCertificatePrivateKey()));
sslHostConfigCertificate.setCertificateFile(getFilePath(ssl.getCertificate()));
sslHostConfigCertificate.setCertificateKeyFile(getFilePath(ssl.getCertificatePrivateKey()));
}
else if (ssl.getKeyStore() != null)
{
sslHostConfig.setCertificateKeystoreFile(getFilePath(ssl.getKeyStore()));
sslHostConfig.setCertificateKeystorePassword(ssl.getKeyStorePassword());
sslHostConfig.setCertificateKeystoreType(ssl.getKeyStoreType());
sslHostConfig.setCertificateKeyAlias(ssl.getKeyAlias());
sslHostConfig.setCertificateKeyPassword(ssl.getKeyPassword());
sslHostConfigCertificate.setCertificateKeystoreFile(getFilePath(ssl.getKeyStore()));
sslHostConfigCertificate.setCertificateKeystorePassword(ssl.getKeyStorePassword());
sslHostConfigCertificate.setCertificateKeystoreType(ssl.getKeyStoreType());
sslHostConfigCertificate.setCertificateKeyAlias(ssl.getKeyAlias());
sslHostConfigCertificate.setCertificateKeyPassword(ssl.getKeyPassword());
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@
import com.ericsson.bss.cassandra.ecchronos.application.config.Config;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;

import static org.assertj.core.api.Assertions.assertThat;

@RunWith(MockitoJUnitRunner.class)
public class TestNoopStatementDecorator
{
@Mock
private Statement mockStatement;

@Test
Expand All @@ -35,4 +33,5 @@ public void testApplyPreservesStatement()
NoopStatementDecorator noopStatementDecorator = new NoopStatementDecorator(new Config());
assertThat(noopStatementDecorator.apply(mockStatement)).isEqualTo(mockStatement);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,38 +20,43 @@

import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.class)
public class TestRetryPolicy {

RetryPolicy retryPolicy = Mockito.mock(RetryPolicy.class);
// No '@Mock' since RetryPolicy is under test
private RetryPolicy retryPolicy = new RetryPolicy();

@Before
public void setup()
{
retryPolicy.setUnit("seconds");
retryPolicy.setDelay(5);
retryPolicy.setMaxAttempts(5);
retryPolicy.setMaxDelay(30);
retryPolicy.setMaxAttempts(5);
}

@Test
public void testDefaultCurrentDelay() {
public void testDefaultCurrentDelay()
{
long currentDelay = retryPolicy.currentDelay(1);

assertEquals(TimeUnit.SECONDS.toMillis(10), currentDelay);
}

@Test
public void testMaxDelay() {
public void testMaxDelay()
{
long currentDelay = retryPolicy.currentDelay(5);

assertEquals(TimeUnit.SECONDS.toMillis(30), currentDelay);
}

@Test
public void testMaxDelayDisabled() {

public void testMaxDelayDisabled()
{
retryPolicy.setMaxDelay(0);

long currentDelay = retryPolicy.currentDelay(5);
Expand All @@ -60,7 +65,8 @@ public void testMaxDelayDisabled() {
}

@Test
public void testDefaultConfigurationInMinutes() {
public void testDefaultConfigurationInMinutes()
{
retryPolicy.setUnit("minutes");
retryPolicy.setDelay(5);
retryPolicy.setMaxAttempts(5);
Expand All @@ -80,4 +86,5 @@ public void testDefaultConfigurationInMinutes() {

assertEquals(TimeUnit.MINUTES.toMillis(160), currentDelay);
}

}
Loading

0 comments on commit ad1804f

Please sign in to comment.