Skip to content

Commit 3292791

Browse files
Merge pull request #155 from SpineEventEngine/upgrade-deps
Bring `gcloud-java` up-to-date
2 parents 665937f + df88a91 commit 3292791

File tree

19 files changed

+401
-406
lines changed

19 files changed

+401
-406
lines changed

buildSrc/src/main/kotlin/io/spine/gradle/internal/deps.kt

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -67,41 +67,41 @@ object Repos {
6767
}
6868

6969
object Versions {
70-
val checkerFramework = "3.3.0"
71-
val errorProne = "2.3.4"
70+
val checkerFramework = "3.7.1"
71+
val errorProne = "2.4.0"
7272
val errorProneJavac = "9+181-r4173-1" // taken from here: https://github.com/tbroyer/gradle-errorprone-plugin/blob/v0.8/build.gradle.kts
73-
val errorPronePlugin = "1.2.1"
73+
val errorPronePlugin = "1.3.0"
7474
val pmd = "6.24.0"
7575
val checkstyle = "8.29"
76-
val protobufPlugin = "0.8.12"
77-
val appengineApi = "1.9.79"
76+
val protobufPlugin = "0.8.13"
77+
val appengineApi = "1.9.82"
7878
val appenginePlugin = "2.2.0"
7979
val findBugs = "3.0.2"
80-
val guava = "29.0-jre"
81-
val protobuf = "3.11.4"
80+
val guava = "30.0-jre"
81+
val protobuf = "3.13.0"
8282
val grpc = "1.28.1"
8383
val flogger = "0.5.1"
84-
val junit4 = "4.12"
85-
val junit5 = "5.6.2"
86-
val junitPlatform = "1.6.2"
87-
val junitPioneer = "0.4.2"
88-
val truth = "1.0.1"
84+
val junit4 = "4.13.1"
85+
val junit5 = "5.7.0"
86+
val junitPlatform = "1.7.0"
87+
val junitPioneer = "1.0.0"
88+
val truth = "1.1"
8989
val httpClient = "1.34.2"
9090
val apacheHttpClient = "2.1.2"
9191
val firebaseAdmin = "6.12.2"
9292
val roaster = "2.21.2.Final"
9393
val licensePlugin = "1.13"
94-
val javaPoet = "1.12.1"
95-
val autoService = "1.0-rc6"
94+
val javaPoet = "1.13.0"
95+
val autoService = "1.0-rc7"
9696
val autoCommon = "0.10"
9797
val jackson = "2.9.10.5"
98-
val animalSniffer = "1.18"
98+
val animalSniffer = "1.19"
9999
val apiguardian = "1.1.0"
100100
val javaxAnnotation = "1.3.2"
101101
val klaxon = "5.4"
102-
val ouathJwt = "3.10.3"
102+
val ouathJwt = "3.11.0"
103103
val bouncyCastlePkcs = "1.66"
104-
val assertK = "0.22"
104+
val assertK = "0.23"
105105

106106
/**
107107
* Version of the SLF4J library.
@@ -113,7 +113,7 @@ object Versions {
113113
* this version and force it via [forceConfiguration(..)][DependencyResolution.forceConfiguration].
114114
*/
115115
@Deprecated("Use Flogger over SLF4J.", replaceWith = ReplaceWith("flogger"))
116-
val slf4j = "1.7.29"
116+
val slf4j = "1.7.30"
117117
}
118118

119119
object GradlePlugins {
@@ -312,6 +312,9 @@ object DependencyResolution {
312312
Deps.test.junit4,
313313

314314
// Transitive dependencies of 3rd party components that we don't use directly.
315+
"org.junit.platform:junit-platform-commons:${Versions.junitPlatform}",
316+
"com.google.auto.value:auto-value-annotations:1.7.4",
317+
"com.google.auto.service:auto-service-annotations:1.0-rc7",
315318
"com.google.code.gson:gson:2.8.6",
316319
"com.google.j2objc:j2objc-annotations:1.3",
317320
"org.codehaus.plexus:plexus-utils:3.3.0",

datastore/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ val spineCoreVersion: String by extra
2828

2929
dependencies {
3030
// Google Cloud Datastore
31-
api("com.google.cloud:google-cloud-datastore:1.105.0") {
31+
api("com.google.cloud:google-cloud-datastore:1.105.1") {
3232
exclude(group = "com.google.protobuf")
3333
exclude(group = "com.google.guava")
3434
}

datastore/src/main/java/io/spine/server/storage/datastore/DsRecordStorage.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
import java.util.Collection;
4444
import java.util.Iterator;
4545
import java.util.Map;
46-
import java.util.Map.Entry;
4746
import java.util.Optional;
4847
import java.util.function.Predicate;
4948

@@ -88,16 +87,19 @@ public static <I> Builder<I> newBuilder() {
8887
* Creates new instance by the passed builder.
8988
*/
9089
protected DsRecordStorage(
91-
RecordStorageBuilder<I, ? extends RecordStorage, ? extends RecordStorageBuilder> b) {
90+
RecordStorageBuilder<I,
91+
? extends RecordStorage<I>,
92+
? extends RecordStorageBuilder<I, ? extends RecordStorage<I>, ?>> b
93+
) {
9294
super(b.getEntityClass(), b.isMultitenant());
9395
this.typeUrl = TypeUrl.from(b.getDescriptor());
9496
this.idClass = checkNotNull(b.getIdClass());
9597
this.datastore = b.getDatastore();
9698
this.columnMapping = checkNotNull(b.getColumnMapping());
9799
this.columnFilterAdapter = FilterAdapter.of(this.columnMapping);
98100
this.idLookup = new DsLookupByIds<>(this.datastore, this.typeUrl);
99-
this.queryLookup = new DsLookupByQueries(this.datastore, this.typeUrl,
100-
this.columnFilterAdapter);
101+
this.queryLookup =
102+
new DsLookupByQueries(this.datastore, this.typeUrl, this.columnFilterAdapter);
101103
}
102104

103105
private Key keyOf(I id) {
@@ -288,7 +290,7 @@ protected void writeRecords(Map<I, EntityRecordWithColumns> records) {
288290
checkNotNull(records);
289291

290292
Collection<Entity> entitiesToWrite = new ArrayList<>(records.size());
291-
for (Entry<I, EntityRecordWithColumns> record : records.entrySet()) {
293+
for (Map.Entry<I, EntityRecordWithColumns> record : records.entrySet()) {
292294
Entity entity = entityRecordToEntity(record.getKey(), record.getValue());
293295
entitiesToWrite.add(entity);
294296
}

datastore/src/main/java/io/spine/server/storage/datastore/DsSessionStorage.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ Optional<ShardSessionRecord> read(ShardIndex index) {
8080
* {@inheritDoc}
8181
*
8282
* <p>Executes the write operation in a new transaction.
83-
*
84-
* @param message
8583
*/
8684
@Override
8785
public void write(ShardSessionRecord message) {

datastore/src/test/java/io/spine/server/storage/datastore/DsAggregateStorageTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ class DynamicSnapshotTrigger {
238238

239239
@BeforeEach
240240
void setUp() {
241-
ServerEnvironment.instance()
242-
.use(datastoreFactory, Tests.class);
241+
ServerEnvironment.when(Tests.class)
242+
.use(datastoreFactory);
243243
repository = new ProjectAggregateRepository();
244244
BoundedContext.singleTenant(DsAggregateStorageTest.class.getName())
245245
.add(repository)

datastore/src/test/java/io/spine/server/storage/datastore/DsAggregateStorageTruncationTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929
import org.junit.jupiter.api.DisplayName;
3030

3131
@DisplayName("`DsAggregateStorage` after truncation should")
32-
public class DsAggregateStorageTruncationTest extends AggregateStorageTruncationTest {
32+
class DsAggregateStorageTruncationTest extends AggregateStorageTruncationTest {
3333

3434
@BeforeAll
3535
static void prepareStorageFactory() {
36-
ServerEnvironment.instance()
37-
.use(TestDatastoreStorageFactory.local(), Tests.class);
36+
ServerEnvironment.when(Tests.class)
37+
.use(TestDatastoreStorageFactory.local());
3838
}
3939

4040
@AfterAll

datastore/src/test/java/io/spine/server/storage/datastore/DsCatchUpSmokeTest.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,21 @@
3636
*
3737
* <p>The tests are extremely slow, so several long tests from {@link CatchUpTest} are disabled.
3838
*/
39-
@DisplayName("Datastore-backed `CatchUp` should ")
4039
@SlowTest
40+
@DisplayName("Datastore-backed `CatchUp` should ")
4141
class DsCatchUpSmokeTest extends CatchUpTest {
4242

4343
private TestDatastoreStorageFactory factory;
4444

45-
@Override
4645
@BeforeEach
47-
public void setUp() {
46+
void prepareStorageFactory() {
4847
factory = TestDatastoreStorageFactory.local();
49-
ServerEnvironment.instance()
50-
.use(factory, Tests.class);
48+
ServerEnvironment.when(Tests.class)
49+
.use(factory);
5150
}
5251

53-
@Override
5452
@AfterEach
55-
public void tearDown() {
53+
void tearDownStorageFactory() {
5654
if (factory != null) {
5755
factory.tearDown();
5856
}

datastore/src/test/java/io/spine/server/storage/datastore/DsDeliverySmokeTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ public class DsDeliverySmokeTest extends DeliveryTest {
4848
public void setUp() {
4949
super.setUp();
5050
factory = TestDatastoreStorageFactory.local();
51-
ServerEnvironment.instance()
52-
.use(factory, Tests.class);
51+
ServerEnvironment.when(Tests.class)
52+
.use(factory);
5353
}
5454

5555
@AfterEach

datastore/src/test/java/io/spine/server/storage/datastore/DsRecordStorageTest.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@
9191
import static io.spine.protobuf.AnyPacker.unpack;
9292
import static io.spine.server.ContextSpec.singleTenant;
9393
import static io.spine.server.entity.FieldMasks.applyMask;
94-
import static io.spine.server.entity.storage.EntityRecordWithColumns.create;
9594
import static io.spine.server.storage.datastore.given.CollegeEntity.CollegeColumn.ADMISSION_DEADLINE;
9695
import static io.spine.server.storage.datastore.given.CollegeEntity.CollegeColumn.CREATED;
9796
import static io.spine.server.storage.datastore.given.CollegeEntity.CollegeColumn.NAME;
@@ -161,7 +160,8 @@ protected EntityState newState(ProjectId projectId) {
161160
private EntityRecordWithColumns newRecordWithColumns(RecordStorage<ProjectId> storage) {
162161
EntityRecord record = newStorageRecord();
163162
Entity<ProjectId, Project> entity = new TestCounterEntity(newId());
164-
EntityRecordWithColumns recordWithColumns = create(record, entity, storage);
163+
EntityRecordWithColumns recordWithColumns =
164+
EntityRecordWithColumns.create(record, entity, storage);
165165
return recordWithColumns;
166166
}
167167

@@ -225,7 +225,8 @@ void testPersistColumns() {
225225
.setVersion(versionValue)
226226
.vBuild();
227227
DsRecordStorage<ProjectId> storage = newStorage(TestCounterEntity.class);
228-
EntityRecordWithColumns recordWithColumns = create(record, entity, storage);
228+
EntityRecordWithColumns recordWithColumns =
229+
EntityRecordWithColumns.create(record, entity, storage);
229230
ImmutableSet<String> columns = recordWithColumns.columnNames()
230231
.stream()
231232
.map(ColumnName::value)
@@ -324,7 +325,8 @@ void testLifecycleFlags() {
324325
.vBuild();
325326
TestCounterEntity entity = new TestCounterEntity(id);
326327
RecordStorage<ProjectId> storage = newStorage(TestCounterEntity.class);
327-
EntityRecordWithColumns recordWithColumns = create(record, entity, storage);
328+
EntityRecordWithColumns recordWithColumns =
329+
EntityRecordWithColumns.create(record, entity, storage);
328330
storage.write(id, recordWithColumns);
329331

330332
RecordReadRequest<ProjectId> request = new RecordReadRequest<>(id);
@@ -609,7 +611,10 @@ void testQueryEntityWithoutLifecycleById() {
609611
ProjectId id = newId();
610612
EntityRecord record = newEntityRecord(id, newState(id));
611613
EntityWithoutLifecycle entity = new EntityWithoutLifecycle(id);
612-
storage.writeRecord(entity.id(), create(record, entity, storage));
614+
storage.writeRecord(
615+
entity.id(),
616+
EntityRecordWithColumns.create(record, entity, storage)
617+
);
613618

614619
// Create ID filter.
615620
List<Any> targetIds = singletonList(pack(entity.id()));

0 commit comments

Comments
 (0)