Skip to content

Commit

Permalink
Bump Spring, Tomcat, Java, SnakeYaml, Jackson and various other depen…
Browse files Browse the repository at this point in the history
…dencies

Closes Ericsson#704, Ericsson#754
  • Loading branch information
jwaeab committed Nov 7, 2024
1 parent 90e3bd0 commit fe321b6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,20 @@
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.MockMakers;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;

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

@RunWith(MockitoJUnitRunner.class)
public class TestNoopStatementDecorator
{
@Mock(mockMaker = MockMakers.SUBCLASS)
private Statement mockStatement = Mockito.mock(Statement.class, Mockito.withSettings().mockMaker(MockMakers.SUBCLASS));
private Statement mockStatement;

@Test
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,41 +20,43 @@

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

@RunWith(MockitoJUnitRunner.class)
public class TestRetryPolicy {

@Mock(mockMaker = MockMakers.SUBCLASS)
RetryPolicy retryPolicy = Mockito.mock(RetryPolicy.class, Mockito.withSettings().mockMaker(MockMakers.SUBCLASS));
// 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 @@ -63,7 +65,8 @@ public void testMaxDelayDisabled() {
}

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

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

}
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<org.apache.commons.io.version>2.17.0</org.apache.commons.io.version>
<org.apache.felix.scr.version>2.2.12</org.apache.felix.scr.version>
<org.apache.httpcomponents.client.version>5.3.1</org.apache.httpcomponents.client.version>
<org.bouncycastle.bcpkix-jdk18on.version>1.78.1</org.bouncycastle.bcpkix-jdk18on.version>
<org.bouncycastle.bcpkix-jdk18on.version>1.79</org.bouncycastle.bcpkix-jdk18on.version>
<org.hdrhistogram.version>2.2.2</org.hdrhistogram.version>
<org.springframework.boot.version>3.3.5</org.springframework.boot.version>
<org.springframework.web.version>6.1.14</org.springframework.web.version>
Expand Down Expand Up @@ -798,7 +798,7 @@ limitations under the License.
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${org.apache.maven.plugins-maven-checkstyle-plugin.version}</version>
<configuration>
<encoding>UTF-8</encoding>
<inputEncoding>UTF-8</inputEncoding>
<consoleOutput>true</consoleOutput>
<configLocation>check_style.xml</configLocation>
<failOnViolation>true</failOnViolation>
Expand Down

0 comments on commit fe321b6

Please sign in to comment.