Skip to content

Commit d76c174

Browse files
Pin grgit to known-working and findable version with the versions of Nebula/Gradle/Java in place. Fix not-found imports in tests. (#1135)
1 parent c2163c6 commit d76c174

5 files changed

Lines changed: 26 additions & 11 deletions

File tree

build.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
buildscript {
2+
configurations.classpath {
3+
resolutionStrategy {
4+
force "org.ajoberstar.grgit:grgit-core:4.1.1"
5+
}
6+
}
7+
}
8+
19
plugins {
210
id 'nebula.netflixoss' version '9.1.0'
311
id 'com.github.sherter.google-java-format' version '0.8'

priam/src/test/java/com/netflix/priam/backup/TestBackupDynamicRateLimiter.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
import java.time.ZoneId;
1515
import java.util.Map;
1616
import java.util.concurrent.TimeUnit;
17-
import org.junit.Assert;
1817
import org.junit.Before;
1918
import org.junit.Test;
19+
import org.junit.jupiter.api.Assertions;
2020

2121
public class TestBackupDynamicRateLimiter {
2222
private static final Instant NOW = Instant.ofEpochMilli(1 << 16);
@@ -76,15 +76,15 @@ public void targetIsInThePast() {
7676
@Test
7777
public void noBackupThreads() {
7878
rateLimiter = getRateLimiter(ImmutableMap.of("Priam.backup.threads", 0), NOW, DIR_SIZE);
79-
Assert.assertThrows(
79+
Assertions.assertThrows(
8080
IllegalStateException.class,
8181
() -> timePermitAcquisition(getBackupPath(), LATER, 20));
8282
}
8383

8484
@Test
8585
public void negativeBackupThreads() {
8686
rateLimiter = getRateLimiter(ImmutableMap.of("Priam.backup.threads", -1), NOW, DIR_SIZE);
87-
Assert.assertThrows(
87+
Assertions.assertThrows(
8888
IllegalStateException.class,
8989
() -> timePermitAcquisition(getBackupPath(), LATER, 20));
9090
}
@@ -99,15 +99,15 @@ public void noData() {
9999
@Test
100100
public void noPermitsRequested() {
101101
rateLimiter = getRateLimiter(ImmutableMap.of("Priam.backup.threads", 1), NOW, DIR_SIZE);
102-
Assert.assertThrows(
102+
Assertions.assertThrows(
103103
IllegalArgumentException.class,
104104
() -> timePermitAcquisition(getBackupPath(), LATER, 0));
105105
}
106106

107107
@Test
108108
public void negativePermitsRequested() {
109109
rateLimiter = getRateLimiter(ImmutableMap.of("Priam.backup.threads", 1), NOW, DIR_SIZE);
110-
Assert.assertThrows(
110+
Assertions.assertThrows(
111111
IllegalArgumentException.class,
112112
() -> timePermitAcquisition(getBackupPath(), LATER, -1));
113113
}

priam/src/test/java/com/netflix/priam/identity/token/TokenRetrieverTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
import mockit.Mocked;
4242
import org.apache.commons.lang3.math.Fraction;
4343
import org.codehaus.jettison.json.JSONObject;
44-
import org.junit.Assert;
4544
import org.junit.Test;
4645
import org.junit.jupiter.api.Assertions;
4746

@@ -429,7 +428,7 @@ public void testRingPositionLast(@Mocked SystemUtils systemUtils) throws Excepti
429428
public void testThrowOnDuplicateTokenInSameRegion() {
430429
prepareTokenGenerationTest();
431430
create(1, instanceInfo.getInstanceId(), "host_0", "1.2.3.4", "us-east-1d", 1808575600 + "");
432-
Assert.assertThrows(
431+
Assertions.assertThrows(
433432
IllegalStateException.class, () -> getTokenRetriever().generateNewToken());
434433
}
435434

priam/src/test/java/com/netflix/priam/scheduler/TestSimpleTimer.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import java.time.Instant;
66
import java.time.temporal.ChronoUnit;
77
import java.util.Date;
8-
import org.junit.Assert;
98
import org.junit.Test;
9+
import org.junit.jupiter.api.Assertions;
1010
import org.quartz.Trigger;
1111

1212
public class TestSimpleTimer {
@@ -20,7 +20,7 @@ public void sunnyDay() throws ParseException {
2020

2121
@Test
2222
public void startBeforeEpoch() {
23-
Assert.assertThrows(
23+
Assertions.assertThrows(
2424
IllegalArgumentException.class,
2525
() -> new SimpleTimer("foo", PERIOD, Instant.EPOCH.minus(5, ChronoUnit.SECONDS)));
2626
}
@@ -38,13 +38,14 @@ public void startMoreThanOnePeriodAfterEpoch() throws ParseException {
3838

3939
@Test
4040
public void negativePeriod() {
41-
Assert.assertThrows(
41+
Assertions.assertThrows(
4242
IllegalArgumentException.class, () -> new SimpleTimer("foo", -PERIOD, START));
4343
}
4444

4545
@Test
4646
public void zeroPeriod() {
47-
Assert.assertThrows(IllegalArgumentException.class, () -> new SimpleTimer("foo", 0, START));
47+
Assertions.assertThrows(
48+
IllegalArgumentException.class, () -> new SimpleTimer("foo", 0, START));
4849
}
4950

5051
private void assertions(Trigger trigger, Instant start) {

settings.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1+
pluginManagement {
2+
repositories {
3+
gradlePluginPortal()
4+
mavenCentral()
5+
}
6+
}
7+
18
rootProject.name = 'Priam'
29
include 'priam','priam-web','priam-cass-extensions','priam-dse-extensions'

0 commit comments

Comments
 (0)