From 1ff21cdc0ab4ea97e4b1763cca9a2580053e82f6 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 13 Sep 2022 16:26:13 -0400 Subject: [PATCH 001/179] applied `boot-autoconfiguration-update` --- pom.xml | 18 +++++++++++++++--- spring-cloud-gcp-dependencies/pom.xml | 12 ++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index eeef282dff..29798df079 100644 --- a/pom.xml +++ b/pom.xml @@ -1,7 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" + child.project.url.inherit.append.path="false"> 4.0.0 com.google.cloud @@ -60,7 +60,7 @@ 3.2.0 9.3 2.0.0 - 2.16 + 2.15.0 @@ -204,6 +204,18 @@ test + + + spring-milestone + https://repo.spring.io/milestone + + + + + spring-milestone + https://repo.spring.io/milestone + + diff --git a/spring-cloud-gcp-dependencies/pom.xml b/spring-cloud-gcp-dependencies/pom.xml index 9e46453395..1488d91aed 100644 --- a/spring-cloud-gcp-dependencies/pom.xml +++ b/spring-cloud-gcp-dependencies/pom.xml @@ -269,6 +269,18 @@ ${cloud-sql-socket-factory.version} + + dev.miku + r2dbc-mysql + 0.8.2.RELEASE + + + + io.r2dbc + r2dbc-postgresql + 0.8.12.RELEASE + + com.google.cloud.sql From 4b3f6db3b14ad89cd162b84ae7f33e28df621406 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 11 Oct 2022 17:27:02 -0400 Subject: [PATCH 002/179] extract sleuth dependency from spring-cloud-dependencies to io.micrometer dependency --- pom.xml | 10 ++++++++++ spring-cloud-gcp-autoconfigure/pom.xml | 11 +++-------- .../spring-cloud-gcp-starter-trace/pom.xml | 8 ++------ 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/pom.xml b/pom.xml index 29798df079..ea35125817 100644 --- a/pom.xml +++ b/pom.xml @@ -43,6 +43,7 @@ 1.0.4 2.4.1 0.10.5 + 1.0.0-M8 3.8.1 @@ -149,6 +150,15 @@ spring-native-configuration ${spring-native.version} + + + io.micrometer + micrometer-tracing-bom + ${micrometer-tracing.verison} + pom + import + + org.springframework.experimental spring-aot diff --git a/spring-cloud-gcp-autoconfigure/pom.xml b/spring-cloud-gcp-autoconfigure/pom.xml index 95d90dc4d1..1a00e1d82e 100644 --- a/spring-cloud-gcp-autoconfigure/pom.xml +++ b/spring-cloud-gcp-autoconfigure/pom.xml @@ -183,22 +183,17 @@ - org.springframework.cloud - spring-cloud-sleuth-autoconfigure + io.micrometer + micrometer-tracing true + io.zipkin.reporter2 zipkin-reporter-brave true - - org.springframework.cloud - spring-cloud-sleuth-brave - true - - io.zipkin.gcp zipkin-sender-stackdriver diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml index 5460cd58e9..c4fdc21e2e 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml @@ -19,12 +19,8 @@ spring-cloud-gcp-starter - org.springframework.cloud - spring-cloud-starter-sleuth - - - org.springframework.cloud - spring-cloud-sleuth-brave + io.micrometer + micrometer-tracing io.zipkin.gcp From 4adeaeb503ecdbbb0dbd0dd93f2828268dbcc48e Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 11 Oct 2022 18:53:16 -0400 Subject: [PATCH 003/179] add jakarta dependency --- spring-cloud-gcp-logging/pom.xml | 5 ++--- .../spring/logging/TraceIdLoggingWebMvcInterceptor.java | 4 ++-- .../spring/logging/extractors/CloudTraceIdExtractor.java | 2 +- .../cloud/spring/logging/extractors/TraceIdExtractor.java | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/spring-cloud-gcp-logging/pom.xml b/spring-cloud-gcp-logging/pom.xml index 017cc6ddcb..d18427365b 100644 --- a/spring-cloud-gcp-logging/pom.xml +++ b/spring-cloud-gcp-logging/pom.xml @@ -29,10 +29,9 @@ com.google.cloud google-cloud-logging-logback - - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api provided diff --git a/spring-cloud-gcp-logging/src/main/java/com/google/cloud/spring/logging/TraceIdLoggingWebMvcInterceptor.java b/spring-cloud-gcp-logging/src/main/java/com/google/cloud/spring/logging/TraceIdLoggingWebMvcInterceptor.java index f56ee20caa..234c5937f1 100644 --- a/spring-cloud-gcp-logging/src/main/java/com/google/cloud/spring/logging/TraceIdLoggingWebMvcInterceptor.java +++ b/spring-cloud-gcp-logging/src/main/java/com/google/cloud/spring/logging/TraceIdLoggingWebMvcInterceptor.java @@ -17,8 +17,8 @@ package com.google.cloud.spring.logging; import com.google.cloud.spring.logging.extractors.TraceIdExtractor; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.util.Assert; import org.springframework.web.servlet.HandlerInterceptor; diff --git a/spring-cloud-gcp-logging/src/main/java/com/google/cloud/spring/logging/extractors/CloudTraceIdExtractor.java b/spring-cloud-gcp-logging/src/main/java/com/google/cloud/spring/logging/extractors/CloudTraceIdExtractor.java index 240ce52bd2..0f7f5e9c16 100644 --- a/spring-cloud-gcp-logging/src/main/java/com/google/cloud/spring/logging/extractors/CloudTraceIdExtractor.java +++ b/spring-cloud-gcp-logging/src/main/java/com/google/cloud/spring/logging/extractors/CloudTraceIdExtractor.java @@ -16,7 +16,7 @@ package com.google.cloud.spring.logging.extractors; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; /** Extracts trace IDs from HTTP requests using the x-cloud-trace-context header. */ public class CloudTraceIdExtractor implements TraceIdExtractor { diff --git a/spring-cloud-gcp-logging/src/main/java/com/google/cloud/spring/logging/extractors/TraceIdExtractor.java b/spring-cloud-gcp-logging/src/main/java/com/google/cloud/spring/logging/extractors/TraceIdExtractor.java index 1342a4491e..f21a5af866 100644 --- a/spring-cloud-gcp-logging/src/main/java/com/google/cloud/spring/logging/extractors/TraceIdExtractor.java +++ b/spring-cloud-gcp-logging/src/main/java/com/google/cloud/spring/logging/extractors/TraceIdExtractor.java @@ -16,7 +16,7 @@ package com.google.cloud.spring.logging.extractors; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; /** An extractor that can provide a trace ID from an HTTP request. */ public interface TraceIdExtractor { From 55e97322838214e31c68cfe605d694a15866ce61 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 11 Oct 2022 20:41:06 -0400 Subject: [PATCH 004/179] extends crud repository for sorting repositories --- .../spring/data/datastore/repository/DatastoreRepository.java | 3 ++- .../spring/data/spanner/repository/SpannerRepository.java | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/repository/DatastoreRepository.java b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/repository/DatastoreRepository.java index bfafab46d0..0389f0475e 100644 --- a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/repository/DatastoreRepository.java +++ b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/repository/DatastoreRepository.java @@ -17,6 +17,7 @@ package com.google.cloud.spring.data.datastore.repository; import java.util.function.Function; +import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.query.QueryByExampleExecutor; @@ -28,7 +29,7 @@ * @since 1.1 */ public interface DatastoreRepository - extends PagingAndSortingRepository, QueryByExampleExecutor { + extends PagingAndSortingRepository, QueryByExampleExecutor, CrudRepository { /** * Performs multiple read and write operations in a single transaction. diff --git a/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/repository/SpannerRepository.java b/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/repository/SpannerRepository.java index 47211ae0bd..1bf6c4aaaa 100644 --- a/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/repository/SpannerRepository.java +++ b/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/repository/SpannerRepository.java @@ -18,6 +18,7 @@ import com.google.cloud.spring.data.spanner.core.SpannerOperations; import java.util.function.Function; +import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.PagingAndSortingRepository; /** @@ -27,7 +28,8 @@ * @param the id type of the entity * @since 1.1 */ -public interface SpannerRepository extends PagingAndSortingRepository { +public interface SpannerRepository extends PagingAndSortingRepository, + CrudRepository { /** * Gets a {@link SpannerOperations}, which allows more-direct access to Google Cloud Spanner From fee80b9a05a236078eb60ed8f3b3170343cc6925 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 11 Oct 2022 20:43:44 -0400 Subject: [PATCH 005/179] remove joda time and ThreeTenBackport --- .../datastore/core/convert/DatastoreCustomConversions.java | 4 ---- .../core/convert/DefaultDatastoreEntityConverter.java | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DatastoreCustomConversions.java b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DatastoreCustomConversions.java index d6d078cd1f..278aaa4958 100644 --- a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DatastoreCustomConversions.java +++ b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DatastoreCustomConversions.java @@ -24,9 +24,7 @@ import java.util.List; import org.springframework.core.convert.converter.Converter; import org.springframework.data.convert.CustomConversions; -import org.springframework.data.convert.JodaTimeConverters; import org.springframework.data.convert.Jsr310Converters; -import org.springframework.data.convert.ThreeTenBackPortConverters; /** * Value object to capture custom conversion. {@link DatastoreCustomConversions} @@ -41,9 +39,7 @@ public class DatastoreCustomConversions extends CustomConversions { static { ArrayList> converters = new ArrayList<>(); - converters.addAll(JodaTimeConverters.getConvertersToRegister()); converters.addAll(Jsr310Converters.getConvertersToRegister()); - converters.addAll(ThreeTenBackPortConverters.getConvertersToRegister()); converters.add( new Converter() { @Override diff --git a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DefaultDatastoreEntityConverter.java b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DefaultDatastoreEntityConverter.java index 1717655e40..931bf0c787 100644 --- a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DefaultDatastoreEntityConverter.java +++ b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DefaultDatastoreEntityConverter.java @@ -52,7 +52,7 @@ * @since 1.1 */ public class DefaultDatastoreEntityConverter implements DatastoreEntityConverter { - private DatastoreMappingContext mappingContext; + private final DatastoreMappingContext mappingContext; private final EntityInstantiators instantiators = new EntityInstantiators(); From 5b4194dec97dd2e51ad056b736483e88bde81de1 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 11 Oct 2022 20:44:49 -0400 Subject: [PATCH 006/179] remove deprecated method `getPersistentEntityTypes` --- .../core/mapping/DatastorePersistentPropertyImpl.java | 10 ---------- .../core/mapping/SpannerCompositeKeyProperty.java | 5 ----- .../core/mapping/SpannerPersistentPropertyImpl.java | 10 ---------- .../spanner/core/mapping/SpannerKeyPropertyTests.java | 6 ------ 4 files changed, 31 deletions(-) diff --git a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/mapping/DatastorePersistentPropertyImpl.java b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/mapping/DatastorePersistentPropertyImpl.java index a63e708539..a6338b6171 100644 --- a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/mapping/DatastorePersistentPropertyImpl.java +++ b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/mapping/DatastorePersistentPropertyImpl.java @@ -16,7 +16,6 @@ package com.google.cloud.spring.data.datastore.core.mapping; -import java.util.stream.Collectors; import org.springframework.data.mapping.Association; import org.springframework.data.mapping.PersistentEntity; import org.springframework.data.mapping.model.AnnotationBasedPersistentProperty; @@ -24,8 +23,6 @@ import org.springframework.data.mapping.model.Property; import org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy; import org.springframework.data.mapping.model.SimpleTypeHolder; -import org.springframework.data.util.StreamUtils; -import org.springframework.data.util.TypeInformation; import org.springframework.util.StringUtils; /** @@ -130,13 +127,6 @@ private String getAnnotatedFieldName() { return null; } - @Override - public Iterable> getPersistentEntityTypes() { - return StreamUtils.createStreamFromIterator(super.getPersistentEntityTypes().iterator()) - .filter(typeInfo -> typeInfo.getType().isAnnotationPresent(Entity.class)) - .collect(Collectors.toList()); - } - @Override public boolean isLazyLoaded() { return findAnnotation(LazyReference.class) != null; diff --git a/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerCompositeKeyProperty.java b/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerCompositeKeyProperty.java index d15e5b9bf4..64178cbc23 100644 --- a/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerCompositeKeyProperty.java +++ b/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerCompositeKeyProperty.java @@ -179,11 +179,6 @@ public TypeInformation getTypeInformation() { return ClassTypeInformation.from(getType()); } - @Override - public Iterable> getPersistentEntityTypes() { - return Collections.emptySet(); - } - @Nullable @Override public Method getGetter() { diff --git a/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentPropertyImpl.java b/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentPropertyImpl.java index a619135258..deacabe4fb 100644 --- a/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentPropertyImpl.java +++ b/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentPropertyImpl.java @@ -21,7 +21,6 @@ import java.util.List; import java.util.OptionalInt; import java.util.OptionalLong; -import java.util.stream.Collectors; import org.springframework.data.mapping.Association; import org.springframework.data.mapping.MappingException; import org.springframework.data.mapping.PersistentEntity; @@ -30,7 +29,6 @@ import org.springframework.data.mapping.model.Property; import org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy; import org.springframework.data.mapping.model.SimpleTypeHolder; -import org.springframework.data.util.StreamUtils; import org.springframework.data.util.TypeInformation; import org.springframework.util.StringUtils; @@ -66,14 +64,6 @@ public class SpannerPersistentPropertyImpl : PropertyNameFieldNamingStrategy.INSTANCE; } - /** Only provides types that are also annotated with {@link Table}. */ - @Override - public Iterable> getPersistentEntityTypes() { - return StreamUtils.createStreamFromIterator(super.getPersistentEntityTypes().iterator()) - .filter(typeInfo -> typeInfo.getType().isAnnotationPresent(Table.class)) - .collect(Collectors.toList()); - } - @Override protected Association createAssociation() { return new Association<>(this, null); diff --git a/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerKeyPropertyTests.java b/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerKeyPropertyTests.java index a78d20c557..a27d47df40 100644 --- a/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerKeyPropertyTests.java +++ b/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerKeyPropertyTests.java @@ -94,12 +94,6 @@ void getTypeInformationTest() { .isEqualTo(ClassTypeInformation.from(Key.class)); } - @Test - @SuppressWarnings("deprecation") - void getPersistentEntityTypeTest() { - assertThat(this.spannerKeyProperty.getPersistentEntityTypes().iterator().hasNext()).isFalse(); - } - @Test void getPersistentEntityTypeInformationTest() { assertThat(this.spannerKeyProperty.getPersistentEntityTypeInformation().iterator().hasNext()) From 7d3b4abb1964942c5266753a7c290c77675426c5 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Wed, 12 Oct 2022 13:17:15 -0400 Subject: [PATCH 007/179] add sleuth starter dependency since it's not included in spring cloud dependencies --- pom.xml | 9 +++++++++ spring-cloud-gcp-autoconfigure/pom.xml | 24 +++++++++++++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index ea35125817..401f83468b 100644 --- a/pom.xml +++ b/pom.xml @@ -44,6 +44,7 @@ 2.4.1 0.10.5 1.0.0-M8 + 3.1.4 3.8.1 @@ -104,6 +105,14 @@ import + + org.springframework.cloud + spring-cloud-starter-sleuth + ${spring-cloud-sleuth.version} + pom + import + + ch.qos.logback.contrib logback-json-classic diff --git a/spring-cloud-gcp-autoconfigure/pom.xml b/spring-cloud-gcp-autoconfigure/pom.xml index 1a00e1d82e..ecec9fca61 100644 --- a/spring-cloud-gcp-autoconfigure/pom.xml +++ b/spring-cloud-gcp-autoconfigure/pom.xml @@ -42,8 +42,8 @@ true - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api provided @@ -182,9 +182,21 @@ + + org.springframework.cloud + spring-cloud-starter-sleuth + true + + io.micrometer - micrometer-tracing + micrometer-tracing-bridge-brave + true + + + + io.micrometer + micrometer-tracing-reporter-wavefront true @@ -194,6 +206,12 @@ true + + io.zipkin.brave + brave-instrumentation-messaging + true + + io.zipkin.gcp zipkin-sender-stackdriver From ea8456653c3a34420d97a121651670599b21d18f Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Wed, 12 Oct 2022 13:19:54 -0400 Subject: [PATCH 008/179] add dependencies for micrometer tracing --- .../trace/StackdriverTraceAutoConfiguration.java | 2 +- .../trace/pubsub/TracePubSubAutoConfiguration.java | 2 +- .../IapAuthenticationAutoConfigurationTests.java | 2 +- .../spring-cloud-gcp-starter-trace/pom.xml | 10 +++++++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java index 12ba3f6f57..a8f218e5bd 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java @@ -42,12 +42,12 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.actuate.autoconfigure.tracing.BraveAutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration; import org.springframework.cloud.sleuth.autoconfig.brave.instrument.web.BraveHttpConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java index 81b676ce53..61af3b8791 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java @@ -23,13 +23,13 @@ import com.google.cloud.spring.pubsub.core.publisher.PublisherCustomizer; import com.google.cloud.spring.pubsub.support.PublisherFactory; import org.springframework.beans.factory.BeanFactory; +import org.springframework.boot.actuate.autoconfigure.tracing.BraveAutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration; import org.springframework.cloud.sleuth.autoconfig.brave.instrument.messaging.BraveMessagingAutoConfiguration; import org.springframework.cloud.sleuth.brave.instrument.messaging.ConditionalOnMessagingEnabled; import org.springframework.context.annotation.Bean; diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/security/IapAuthenticationAutoConfigurationTests.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/security/IapAuthenticationAutoConfigurationTests.java index 75b33965b5..511e30df4a 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/security/IapAuthenticationAutoConfigurationTests.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/security/IapAuthenticationAutoConfigurationTests.java @@ -29,9 +29,9 @@ import com.google.cloud.spring.security.iap.AppEngineAudienceProvider; import com.google.cloud.spring.security.iap.AudienceProvider; import com.google.cloud.spring.security.iap.AudienceValidator; +import jakarta.servlet.http.HttpServletRequest; import java.time.Instant; import java.util.Collections; -import javax.servlet.http.HttpServletRequest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml index c4fdc21e2e..ba768002dc 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml @@ -20,7 +20,15 @@ io.micrometer - micrometer-tracing + micrometer-tracing-bridge-brave + + + io.micrometer + micrometer-tracing-reporter-wavefront + + + io.zipkin.brave + brave-instrumentation-messaging io.zipkin.gcp From d7f8b74e8e3c2439745c712862b85ba44ccd9c52 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Wed, 12 Oct 2022 13:58:42 -0400 Subject: [PATCH 009/179] upgrade java in maven plugin to 17 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 401f83468b..b45ae60613 100644 --- a/pom.xml +++ b/pom.xml @@ -56,8 +56,8 @@ 3.4.1 3.2.1 2.22.2 - 1.8 - 1.8 + 17 + 17 1.6.13 3.2.0 9.3 From 75546ddd3156da9d53495ac9e121b7d64d2ca902 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Wed, 12 Oct 2022 17:44:41 -0400 Subject: [PATCH 010/179] remove transitive dependencies --- spring-cloud-gcp-autoconfigure/pom.xml | 18 ------------------ .../spring-cloud-gcp-starter-trace/pom.xml | 12 ++---------- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/pom.xml b/spring-cloud-gcp-autoconfigure/pom.xml index ecec9fca61..baf42250f4 100644 --- a/spring-cloud-gcp-autoconfigure/pom.xml +++ b/spring-cloud-gcp-autoconfigure/pom.xml @@ -188,30 +188,12 @@ true - - io.micrometer - micrometer-tracing-bridge-brave - true - - - - io.micrometer - micrometer-tracing-reporter-wavefront - true - - io.zipkin.reporter2 zipkin-reporter-brave true - - io.zipkin.brave - brave-instrumentation-messaging - true - - io.zipkin.gcp zipkin-sender-stackdriver diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml index ba768002dc..e8ed31bb19 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml @@ -19,16 +19,8 @@ spring-cloud-gcp-starter - io.micrometer - micrometer-tracing-bridge-brave - - - io.micrometer - micrometer-tracing-reporter-wavefront - - - io.zipkin.brave - brave-instrumentation-messaging + org.springframework.cloud + spring-cloud-starter-sleuth io.zipkin.gcp From 3ebb756b43f5e61e6b7f30cbc869620b10c82b26 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Wed, 12 Oct 2022 17:45:51 -0400 Subject: [PATCH 011/179] fix broken unit tests --- .../pubsub/TracePubSubAutoConfiguration.java | 2 +- .../TracePubSubAutoConfigurationTest.java | 52 +++++++++++-------- .../core/publisher/PublisherCustomizer.java | 2 +- 3 files changed, 33 insertions(+), 23 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java index 61af3b8791..667538baba 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java @@ -40,7 +40,7 @@ @Configuration(proxyBeanMethods = false) @ConditionalOnMessagingEnabled @ConditionalOnBean(Tracing.class) -@ConditionalOnProperty(value = "spring.cloud.gcp.trace.pubsub.enabled", matchIfMissing = false) +@ConditionalOnProperty(value = "spring.cloud.gcp.trace.pubsub.enabled") @ConditionalOnClass({PublisherFactory.class, MessagingTracing.class}) @AutoConfigureAfter({BraveAutoConfiguration.class, BraveMessagingAutoConfiguration.class}) @AutoConfigureBefore(GcpPubSubAutoConfiguration.class) diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java index 8955eac4e2..400d367cc0 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java @@ -23,6 +23,7 @@ import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; +import brave.Tracing; import brave.handler.SpanHandler; import brave.http.HttpRequestParser; import brave.http.HttpTracingCustomizer; @@ -35,6 +36,8 @@ import io.grpc.ManagedChannel; import java.util.List; import java.util.stream.Collectors; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.ObjectProvider; import org.springframework.boot.autoconfigure.AutoConfigurations; @@ -42,31 +45,37 @@ import org.springframework.cloud.autoconfigure.RefreshAutoConfiguration; import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration; import org.springframework.cloud.sleuth.autoconfig.brave.instrument.messaging.BraveMessagingAutoConfiguration; +import org.springframework.core.ResolvableType; import zipkin2.reporter.Reporter; import zipkin2.reporter.Sender; /** Tests for Trace Pub/Sub auto-config. */ class TracePubSubAutoConfigurationTest { - private ApplicationContextRunner contextRunner = - new ApplicationContextRunner() - .withConfiguration( - AutoConfigurations.of( - TracePubSubAutoConfiguration.class, - StackdriverTraceAutoConfiguration.class, - GcpContextAutoConfiguration.class, - BraveAutoConfiguration.class, - BraveMessagingAutoConfiguration.class, - RefreshAutoConfiguration.class)) - .withUserConfiguration(MockConfiguration.class) - .withBean( - StackdriverTraceAutoConfiguration.SPAN_HANDLER_BEAN_NAME, - SpanHandler.class, - () -> SpanHandler.NOOP) - // Prevent healthcheck from triggering a real call to Trace. - .withBean(REPORTER_BEAN_NAME, Reporter.class, () -> mock(Reporter.class)) - .withPropertyValues( - "spring.cloud.gcp.project-id=proj", "spring.sleuth.sampler.probability=1.0"); + private ApplicationContextRunner contextRunner; + + @BeforeEach + void init() { + contextRunner = + new ApplicationContextRunner() + .withConfiguration( + AutoConfigurations.of( + TracePubSubAutoConfiguration.class, + StackdriverTraceAutoConfiguration.class, + GcpContextAutoConfiguration.class, + BraveAutoConfiguration.class, + BraveMessagingAutoConfiguration.class, + RefreshAutoConfiguration.class)) + .withUserConfiguration(MockConfiguration.class) + .withBean( + StackdriverTraceAutoConfiguration.SPAN_HANDLER_BEAN_NAME, + SpanHandler.class, + () -> SpanHandler.NOOP) + // Prevent health-check from triggering a real call to Trace. + .withBean(REPORTER_BEAN_NAME, Reporter.class, () -> mock(Reporter.class)) + .withPropertyValues( + "spring.cloud.gcp.project-id=proj", "spring.sleuth.sampler.probability=1.0"); + } @Test void test() { @@ -96,8 +105,8 @@ void testPubSubTracingEnabled() { .withPropertyValues("spring.cloud.gcp.trace.pubsub.enabled=true") .run( context -> { - assertThat(context.getBean(TracePubSubBeanPostProcessor.class)).isNotNull(); - assertThat(context.getBean(PubSubTracing.class)).isNotNull(); + assertThat(context.getBeansOfType(TracePubSubBeanPostProcessor.class)).isNotNull(); + assertThat(context.getBeansOfType(PubSubTracing.class)).isNotNull(); }); } @@ -106,6 +115,7 @@ void tracePubSubCustomizerAppliedLast() { PublisherCustomizer noopCustomizer = (pb, t) -> {}; this.contextRunner .withPropertyValues("spring.cloud.gcp.trace.pubsub.enabled=true") + .withBean(Tracing.class, () -> Tracing.newBuilder().build()) .withBean(PublisherCustomizer.class, () -> noopCustomizer) .run(context -> { ObjectProvider customizersProvider = diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/publisher/PublisherCustomizer.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/publisher/PublisherCustomizer.java index 6cd2bc813c..fa493c9c1a 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/publisher/PublisherCustomizer.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/publisher/PublisherCustomizer.java @@ -23,5 +23,5 @@ * Can be implemented as a lambda accepting a {@link Publisher.Builder} and a `String` topic. */ public interface PublisherCustomizer { - public void apply(Publisher.Builder publisherBuilder, String topic); + void apply(Publisher.Builder publisherBuilder, String topic); } From 62e735b6cf5d3436c2c9f6139b4e70f3b87d7228 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 13 Oct 2022 16:39:46 -0400 Subject: [PATCH 012/179] remove sleuth starter dependency --- pom.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pom.xml b/pom.xml index b45ae60613..966f29777c 100644 --- a/pom.xml +++ b/pom.xml @@ -105,14 +105,6 @@ import - - org.springframework.cloud - spring-cloud-starter-sleuth - ${spring-cloud-sleuth.version} - pom - import - - ch.qos.logback.contrib logback-json-classic From b1f06c11ae07fc0d472e1b4080576938b160ed91 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 13 Oct 2022 16:40:24 -0400 Subject: [PATCH 013/179] add io.micrometer dependency --- spring-cloud-gcp-autoconfigure/pom.xml | 10 ++++++++-- .../spring-cloud-gcp-starter-trace/pom.xml | 8 ++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/pom.xml b/spring-cloud-gcp-autoconfigure/pom.xml index baf42250f4..ceba37d6b8 100644 --- a/spring-cloud-gcp-autoconfigure/pom.xml +++ b/spring-cloud-gcp-autoconfigure/pom.xml @@ -183,8 +183,14 @@ - org.springframework.cloud - spring-cloud-starter-sleuth + io.micrometer + micrometer-tracing-bridge-brave + true + + + + io.zipkin.brave + brave-instrumentation-messaging true diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml index e8ed31bb19..b760b1d1fe 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml @@ -19,8 +19,12 @@ spring-cloud-gcp-starter - org.springframework.cloud - spring-cloud-starter-sleuth + io.micrometer + micrometer-tracing-bridge-brave + + + io.zipkin.brave + brave-instrumentation-messaging io.zipkin.gcp From 5c69c3e10cd2257329eee226f1f101fcc8a78dad Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 13 Oct 2022 16:43:46 -0400 Subject: [PATCH 014/179] refacter test class --- ...ckdriverLoggingAutoConfigurationTests.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/logging/StackdriverLoggingAutoConfigurationTests.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/logging/StackdriverLoggingAutoConfigurationTests.java index 3cd6785b76..999771507c 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/logging/StackdriverLoggingAutoConfigurationTests.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/logging/StackdriverLoggingAutoConfigurationTests.java @@ -24,24 +24,28 @@ import com.google.cloud.spring.autoconfigure.core.GcpContextAutoConfiguration; import com.google.cloud.spring.autoconfigure.trace.StackdriverTraceAutoConfiguration; import com.google.cloud.spring.logging.TraceIdLoggingWebMvcInterceptor; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; -import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration; import org.springframework.context.annotation.Bean; import zipkin2.reporter.Reporter; /** Tests for auto-config. */ class StackdriverLoggingAutoConfigurationTests { - private WebApplicationContextRunner contextRunner = - new WebApplicationContextRunner() - .withUserConfiguration(TestConfiguration.class) - .withConfiguration( - AutoConfigurations.of( - StackdriverLoggingAutoConfiguration.class, GcpContextAutoConfiguration.class)); + private WebApplicationContextRunner contextRunner; + + @BeforeEach + void init() { + contextRunner = new WebApplicationContextRunner() + .withUserConfiguration(TestConfiguration.class) + .withConfiguration( + AutoConfigurations.of( + StackdriverLoggingAutoConfiguration.class, GcpContextAutoConfiguration.class)); + } @Test void testDisabledConfiguration() { @@ -89,9 +93,7 @@ void testRegularConfiguration() { @Test void testWithSleuth() { this.contextRunner - .withConfiguration( - AutoConfigurations.of( - StackdriverTraceAutoConfiguration.class, BraveAutoConfiguration.class)) + .withConfiguration(AutoConfigurations.of(StackdriverTraceAutoConfiguration.class)) .withPropertyValues("spring.cloud.gcp.project-id=pop-1") .run( context -> From f50be0dc5932936df46b2ebe56911de824366e45 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 13 Oct 2022 20:52:33 -0400 Subject: [PATCH 015/179] remove BraveHttpConfiguration as it is deprecated --- .../pubsub/TracePubSubAutoConfiguration.java | 10 +++------- .../TracePubSubAutoConfigurationTest.java | 18 +++++++++--------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java index 667538baba..7bb86bf61e 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java @@ -30,19 +30,16 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.cloud.sleuth.autoconfig.brave.instrument.messaging.BraveMessagingAutoConfiguration; -import org.springframework.cloud.sleuth.brave.instrument.messaging.ConditionalOnMessagingEnabled; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; @Configuration(proxyBeanMethods = false) -@ConditionalOnMessagingEnabled @ConditionalOnBean(Tracing.class) @ConditionalOnProperty(value = "spring.cloud.gcp.trace.pubsub.enabled") @ConditionalOnClass({PublisherFactory.class, MessagingTracing.class}) -@AutoConfigureAfter({BraveAutoConfiguration.class, BraveMessagingAutoConfiguration.class}) +@AutoConfigureAfter({BraveAutoConfiguration.class}) @AutoConfigureBefore(GcpPubSubAutoConfiguration.class) class TracePubSubAutoConfiguration { @@ -63,8 +60,7 @@ PubSubTracing pubSubTracing(MessagingTracing messagingTracing) { PublisherCustomizer tracePublisherCustomizer(PubSubTracing pubSubTracing) { TraceHelper helper = new TraceHelper(pubSubTracing); - return (Publisher.Builder publisherBuilder, String topic) -> { - publisherBuilder.setTransform(msg -> helper.instrumentMessage(msg, topic)); - }; + return (Publisher.Builder publisherBuilder, String topic) -> + publisherBuilder.setTransform(msg -> helper.instrumentMessage(msg, topic)); } } diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java index 400d367cc0..f5e15c3723 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java @@ -27,6 +27,7 @@ import brave.handler.SpanHandler; import brave.http.HttpRequestParser; import brave.http.HttpTracingCustomizer; +import brave.messaging.MessagingTracing; import com.google.api.core.ApiFunction; import com.google.cloud.pubsub.v1.Publisher; import com.google.cloud.spring.autoconfigure.core.GcpContextAutoConfiguration; @@ -37,15 +38,11 @@ import java.util.List; import java.util.stream.Collectors; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.ObjectProvider; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.cloud.autoconfigure.RefreshAutoConfiguration; -import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration; -import org.springframework.cloud.sleuth.autoconfig.brave.instrument.messaging.BraveMessagingAutoConfiguration; -import org.springframework.core.ResolvableType; import zipkin2.reporter.Reporter; import zipkin2.reporter.Sender; @@ -63,8 +60,6 @@ void init() { TracePubSubAutoConfiguration.class, StackdriverTraceAutoConfiguration.class, GcpContextAutoConfiguration.class, - BraveAutoConfiguration.class, - BraveMessagingAutoConfiguration.class, RefreshAutoConfiguration.class)) .withUserConfiguration(MockConfiguration.class) .withBean( @@ -101,21 +96,26 @@ void testPubSubTracingDisabledByDefault() { @Test void testPubSubTracingEnabled() { + Tracing tracing = Tracing.newBuilder().build(); this.contextRunner .withPropertyValues("spring.cloud.gcp.trace.pubsub.enabled=true") + .withBean(Tracing.class, () -> tracing) + .withBean(MessagingTracing.class, () -> MessagingTracing.newBuilder(tracing).build()) .run( context -> { - assertThat(context.getBeansOfType(TracePubSubBeanPostProcessor.class)).isNotNull(); - assertThat(context.getBeansOfType(PubSubTracing.class)).isNotNull(); + assertThat(context.getBean(TracePubSubBeanPostProcessor.class)).isNotNull(); + assertThat(context.getBean(PubSubTracing.class)).isNotNull(); }); } @Test void tracePubSubCustomizerAppliedLast() { PublisherCustomizer noopCustomizer = (pb, t) -> {}; + Tracing tracing = Tracing.newBuilder().build(); this.contextRunner .withPropertyValues("spring.cloud.gcp.trace.pubsub.enabled=true") - .withBean(Tracing.class, () -> Tracing.newBuilder().build()) + .withBean(Tracing.class, () -> tracing) + .withBean(MessagingTracing.class, () -> MessagingTracing.newBuilder(tracing).build()) .withBean(PublisherCustomizer.class, () -> noopCustomizer) .run(context -> { ObjectProvider customizersProvider = From 701a022ae0bd9c2d55ef2e1e5b3e36c5cc5195da Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sat, 15 Oct 2022 12:23:21 -0400 Subject: [PATCH 016/179] add actuator starter dependency --- .../spring-cloud-gcp-starter-trace/pom.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml index b760b1d1fe..a8bd4f5ffb 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml @@ -18,6 +18,10 @@ com.google.cloud spring-cloud-gcp-starter + + org.springframework.boot + spring-boot-actuator + io.micrometer micrometer-tracing-bridge-brave From eef5d36a75be82fab87e7c252f461cfe9ae599aa Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sat, 15 Oct 2022 12:24:32 -0400 Subject: [PATCH 017/179] remove BraveHttpConfiguration --- .../trace/StackdriverTraceAutoConfiguration.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java index a8f218e5bd..32ff1b107f 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java @@ -48,7 +48,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.cloud.sleuth.autoconfig.brave.instrument.web.BraveHttpConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; @@ -98,11 +97,11 @@ public class StackdriverTraceAutoConfiguration { */ public static final String CUSTOMIZER_BEAN_NAME = "stackdriverTracingCustomizer"; - private GcpProjectIdProvider finalProjectIdProvider; + private final GcpProjectIdProvider finalProjectIdProvider; - private CredentialsProvider finalCredentialsProvider; + private final CredentialsProvider finalCredentialsProvider; - private UserAgentHeaderProvider headerProvider = new UserAgentHeaderProvider(this.getClass()); + private final UserAgentHeaderProvider headerProvider = new UserAgentHeaderProvider(this.getClass()); private ThreadPoolTaskScheduler defaultTraceSenderThreadPool; @@ -267,7 +266,7 @@ public void closeScheduler() { name = "spring.sleuth.http.enabled", havingValue = "true", matchIfMissing = true) - @AutoConfigureBefore(BraveHttpConfiguration.class) + @AutoConfigureBefore(BraveAutoConfiguration.class) public static class StackdriverTraceHttpAutoconfiguration { @Bean @ConditionalOnProperty( From fbfa218a063603c8fb4cc1e5b5e4e03c5c1c2af7 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sat, 15 Oct 2022 12:24:46 -0400 Subject: [PATCH 018/179] fix broken unit tests --- ...tackdriverTraceAutoConfigurationTests.java | 65 ++++++++++++------- 1 file changed, 40 insertions(+), 25 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfigurationTests.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfigurationTests.java index 7abf8c6ccf..9d3af8d913 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfigurationTests.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfigurationTests.java @@ -23,12 +23,19 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import brave.Tracer; +import brave.Tracing; import brave.TracingCustomizer; import brave.handler.SpanHandler; import brave.http.HttpRequestParser; import brave.http.HttpTracingCustomizer; +import brave.propagation.TraceContextOrSamplingFlags; +import brave.sampler.Sampler; +import brave.sampler.SamplerFunction; import com.google.api.gax.core.ExecutorProvider; import com.google.cloud.spring.autoconfigure.core.GcpContextAutoConfiguration; +import com.google.cloud.spring.autoconfigure.trace.StackdriverTraceAutoConfigurationTests.MultipleSpanHandlersConfig.GcpTraceService; +import com.google.cloud.spring.autoconfigure.trace.StackdriverTraceAutoConfigurationTests.MultipleSpanHandlersConfig.OtherSender; import com.google.devtools.cloudtrace.v2.BatchWriteSpansRequest; import com.google.devtools.cloudtrace.v2.Span; import com.google.devtools.cloudtrace.v2.TraceServiceGrpc; @@ -47,12 +54,12 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import org.apache.commons.lang3.reflect.FieldUtils; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.springframework.boot.actuate.autoconfigure.tracing.BraveAutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.cloud.autoconfigure.RefreshAutoConfiguration; -import org.springframework.cloud.sleuth.Tracer; -import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; import zipkin2.Call; @@ -67,17 +74,21 @@ /** Tests for auto-config. */ class StackdriverTraceAutoConfigurationTests { - private ApplicationContextRunner contextRunner = - new ApplicationContextRunner() - .withConfiguration( - AutoConfigurations.of( - StackdriverTraceAutoConfiguration.class, - GcpContextAutoConfiguration.class, - BraveAutoConfiguration.class, - RefreshAutoConfiguration.class)) - .withUserConfiguration(MockConfiguration.class) - .withPropertyValues( - "spring.cloud.gcp.project-id=proj", "spring.sleuth.sampler.probability=1.0"); + private ApplicationContextRunner contextRunner; + + @BeforeEach + void init() { + contextRunner = new ApplicationContextRunner() + .withConfiguration( + AutoConfigurations.of( + StackdriverTraceAutoConfiguration.class, + GcpContextAutoConfiguration.class, + BraveAutoConfiguration.class, + RefreshAutoConfiguration.class)) + .withUserConfiguration(MockConfiguration.class) + .withPropertyValues( + "spring.cloud.gcp.project-id=proj", "spring.sleuth.sampler.probability=1.0"); + } @Test void test() { @@ -174,13 +185,18 @@ void supportsMultipleReporters() { assertThat(context.getBeansOfType(SpanHandler.class)) .containsKeys("stackdriverSpanHandler", "otherSpanHandler"); - org.springframework.cloud.sleuth.Span span = - context.getBean(Tracer.class).nextSpan().name("foo").tag("foo", "bar").start(); - span.end(); - String spanId = span.context().spanId(); + brave.Span span = context + .getBean(Tracer.class) + // always send the trace + .nextSpan(TraceContextOrSamplingFlags.SAMPLED) + .name("foo") + .tag("foo", "bar") + .start(); + span.finish(); + String spanId = span.context().spanIdString(); + GcpTraceService gcpTraceService = + context.getBean(GcpTraceService.class); - MultipleSpanHandlersConfig.GcpTraceService gcpTraceService = - context.getBean(MultipleSpanHandlersConfig.GcpTraceService.class); await() .atMost(10, TimeUnit.SECONDS) .pollInterval(Duration.ofSeconds(1)) @@ -202,8 +218,8 @@ void supportsMultipleReporters() { .isEqualTo("bar"); }); - MultipleSpanHandlersConfig.OtherSender sender = - (MultipleSpanHandlersConfig.OtherSender) context.getBean("otherSender"); + OtherSender sender = + (OtherSender) context.getBean("otherSender"); await() .atMost(10, TimeUnit.SECONDS) .untilAsserted(() -> assertThat(sender.isSpanSent()).isTrue()); @@ -299,9 +315,8 @@ TracingCustomizer otherTracingCustomizer(SpanHandler otherSpanHandler) { @Bean SpanHandler otherSpanHandler(OtherSender otherSender) { - AsyncReporter reporter = AsyncReporter.create(otherSender); - SpanHandler spanHandler = AsyncZipkinSpanHandler.create(reporter); - return spanHandler; + AsyncReporter reporter = AsyncReporter.create(otherSender); + return AsyncZipkinSpanHandler.create(reporter); } @Bean @@ -343,7 +358,7 @@ public Call sendSpans(List encodedSpans) { /** Used as implementation on the in-process gRPC server for verification. */ static class GcpTraceService extends TraceServiceGrpc.TraceServiceImplBase { - private Map traces = new HashMap<>(); + private final Map traces = new HashMap<>(); boolean hasSpan(String spanId) { return this.traces.containsKey(spanId); From d2c4a522f6bc0cb9498241e4c4b80dab7c99d0cc Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Fri, 21 Oct 2022 17:24:32 -0400 Subject: [PATCH 019/179] remove usage of a deprecated constructor --- .../repository/config/DatastoreAuditingRegistrar.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/repository/config/DatastoreAuditingRegistrar.java b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/repository/config/DatastoreAuditingRegistrar.java index 45803d1ca3..617e96c941 100644 --- a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/repository/config/DatastoreAuditingRegistrar.java +++ b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/repository/config/DatastoreAuditingRegistrar.java @@ -16,6 +16,7 @@ package com.google.cloud.spring.data.datastore.repository.config; +import com.google.cloud.spring.data.datastore.core.mapping.DatastoreMappingContext; import com.google.cloud.spring.data.datastore.repository.support.DatastoreAuditingEventListener; import java.lang.annotation.Annotation; import org.springframework.beans.factory.config.BeanDefinition; @@ -24,6 +25,7 @@ import org.springframework.data.auditing.AuditingHandler; import org.springframework.data.auditing.config.AuditingBeanDefinitionRegistrarSupport; import org.springframework.data.auditing.config.AuditingConfiguration; +import org.springframework.data.mapping.context.PersistentEntities; /** * Registers the annotations and classes for providing auditing support in Spring Data Cloud @@ -35,8 +37,6 @@ public class DatastoreAuditingRegistrar extends AuditingBeanDefinitionRegistrarS private static final String AUDITING_HANDLER_BEAN_NAME = "datastoreAuditingHandler"; - private static final String MAPPING_CONTEXT_BEAN_NAME = "datastoreMappingContext"; - @Override protected Class getAnnotation() { return EnableDatastoreAuditing.class; @@ -57,10 +57,9 @@ protected void registerAuditListenerBeanDefinition( @Override protected BeanDefinitionBuilder getAuditHandlerBeanDefinitionBuilder( AuditingConfiguration configuration) { - BeanDefinitionBuilder builder = - configureDefaultAuditHandlerAttributes( - configuration, BeanDefinitionBuilder.rootBeanDefinition(AuditingHandler.class)); - return builder.addConstructorArgReference(MAPPING_CONTEXT_BEAN_NAME); + return configureDefaultAuditHandlerAttributes( + configuration, BeanDefinitionBuilder.rootBeanDefinition(AuditingHandler.class)) + .addConstructorArgValue(PersistentEntities.of(new DatastoreMappingContext())); } @Override From d79a3cb8a2f158ec68bbe34cd1bcbe98446d8832 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Fri, 21 Oct 2022 17:27:04 -0400 Subject: [PATCH 020/179] code refactor --- .../datastore/core/DatastoreTemplateAuditingTests.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/DatastoreTemplateAuditingTests.java b/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/DatastoreTemplateAuditingTests.java index 7c102dc377..497c7eaad6 100644 --- a/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/DatastoreTemplateAuditingTests.java +++ b/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/DatastoreTemplateAuditingTests.java @@ -31,8 +31,7 @@ import com.google.cloud.spring.data.datastore.core.mapping.DatastoreMappingContext; import com.google.cloud.spring.data.datastore.core.mapping.Entity; import com.google.cloud.spring.data.datastore.repository.config.EnableDatastoreAuditing; -import java.time.LocalDate; -import java.time.LocalDateTime; +import java.time.Instant; import java.util.Collections; import java.util.Optional; import org.junit.jupiter.api.Test; @@ -52,7 +51,7 @@ @ContextConfiguration class DatastoreTemplateAuditingTests { - private static final LocalDateTime LONG_AGO = LocalDate.parse("2000-01-01").atStartOfDay(); + private static final Instant LONG_AGO = Instant.parse("2000-01-01T00:00:00.00Z"); @Autowired DatastoreTemplate datastoreTemplate; @Autowired Datastore datastore; @@ -134,7 +133,7 @@ public DatastoreTemplate datastoreTemplate( FullEntity testEntity = invocation.getArgument(0); assertThat(testEntity.getTimestamp("lastTouched")).isNotNull(); assertThat(testEntity.getTimestamp("lastTouched")) - .isGreaterThan(Timestamp.of(java.sql.Timestamp.valueOf(LONG_AGO))); + .isGreaterThan(Timestamp.of(java.sql.Timestamp.from(LONG_AGO))); assertThat(testEntity.getString("lastUser")).isEqualTo("test_user"); return null; }); @@ -154,6 +153,7 @@ private static class TestEntity { @LastModifiedBy String lastUser; - @LastModifiedDate LocalDateTime lastTouched; + @LastModifiedDate + Instant lastTouched; } } From 95be0fde436a70c39b38e7bebfb9cf6020650993 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Fri, 21 Oct 2022 20:30:51 -0400 Subject: [PATCH 021/179] remove the usage of a deprecated constructor --- .../repository/config/SpannerAuditingRegistrar.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/repository/config/SpannerAuditingRegistrar.java b/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/repository/config/SpannerAuditingRegistrar.java index a4c2e40f11..1ce60ddb0b 100644 --- a/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/repository/config/SpannerAuditingRegistrar.java +++ b/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/repository/config/SpannerAuditingRegistrar.java @@ -16,6 +16,7 @@ package com.google.cloud.spring.data.spanner.repository.config; +import com.google.cloud.spring.data.spanner.core.mapping.SpannerMappingContext; import com.google.cloud.spring.data.spanner.repository.support.SpannerAuditingEventListener; import java.lang.annotation.Annotation; import org.springframework.beans.factory.config.BeanDefinition; @@ -24,6 +25,7 @@ import org.springframework.data.auditing.AuditingHandler; import org.springframework.data.auditing.config.AuditingBeanDefinitionRegistrarSupport; import org.springframework.data.auditing.config.AuditingConfiguration; +import org.springframework.data.mapping.context.PersistentEntities; /** * Registers the annotations and classes for providing auditing support in Spring Data Cloud @@ -35,8 +37,6 @@ public class SpannerAuditingRegistrar extends AuditingBeanDefinitionRegistrarSup private static final String AUDITING_HANDLER_BEAN_NAME = "spannerAuditingHandler"; - private static final String MAPPING_CONTEXT_BEAN_NAME = "spannerMappingContext"; - @Override protected Class getAnnotation() { return EnableSpannerAuditing.class; @@ -57,10 +57,9 @@ protected void registerAuditListenerBeanDefinition( @Override protected BeanDefinitionBuilder getAuditHandlerBeanDefinitionBuilder( AuditingConfiguration configuration) { - BeanDefinitionBuilder builder = - configureDefaultAuditHandlerAttributes( - configuration, BeanDefinitionBuilder.rootBeanDefinition(AuditingHandler.class)); - return builder.addConstructorArgReference(MAPPING_CONTEXT_BEAN_NAME); + return configureDefaultAuditHandlerAttributes( + configuration, BeanDefinitionBuilder.rootBeanDefinition(AuditingHandler.class)) + .addConstructorArgValue(PersistentEntities.of(new SpannerMappingContext())); } @Override From fbaba862644b775340c12dd144f88595a899a09c Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Fri, 21 Oct 2022 20:33:13 -0400 Subject: [PATCH 022/179] refactor tests --- .../spanner/core/SpannerTemplateAuditingTests.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/SpannerTemplateAuditingTests.java b/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/SpannerTemplateAuditingTests.java index ae876eb0d3..fca1abfb63 100644 --- a/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/SpannerTemplateAuditingTests.java +++ b/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/SpannerTemplateAuditingTests.java @@ -28,9 +28,7 @@ import com.google.cloud.spring.data.spanner.core.mapping.SpannerMappingContext; import com.google.cloud.spring.data.spanner.core.mapping.Table; import com.google.cloud.spring.data.spanner.repository.config.EnableSpannerAuditing; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.util.Arrays; +import java.time.Instant; import java.util.List; import java.util.Optional; import org.junit.jupiter.api.Test; @@ -51,9 +49,9 @@ class SpannerTemplateAuditingTests { private static final List UPSERT_MUTATION = - Arrays.asList(Mutation.newInsertOrUpdateBuilder("custom_test_table").build()); + List.of(Mutation.newInsertOrUpdateBuilder("custom_test_table").build()); - private static final LocalDateTime LONG_AGO = LocalDate.parse("2000-01-01").atStartOfDay(); + private static final Instant LONG_AGO = Instant.parse("2000-01-01T00:00:00.00Z"); @Autowired SpannerTemplate spannerTemplate; @@ -133,6 +131,6 @@ private static class TestEntity { @LastModifiedBy String lastUser; - @LastModifiedDate LocalDateTime lastTouched; + @LastModifiedDate Instant lastTouched; } } From e8279b8835ed87cdd5d15b7db00809956f9a84aa Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 25 Oct 2022 13:16:14 -0400 Subject: [PATCH 023/179] change to functional programming model --- .../PubSubMessageChannelBinderTests.java | 89 +++++++++---------- ...PubSubExtendedBindingsPropertiesTests.java | 39 ++++---- 2 files changed, 64 insertions(+), 64 deletions(-) diff --git a/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/PubSubMessageChannelBinderTests.java b/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/PubSubMessageChannelBinderTests.java index 0506f78f74..d5e9cf0f65 100644 --- a/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/PubSubMessageChannelBinderTests.java +++ b/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/PubSubMessageChannelBinderTests.java @@ -38,10 +38,14 @@ import com.google.cloud.spring.stream.binder.pubsub.provisioning.PubSubChannelProvisioner; import java.util.List; import java.util.Map; +import java.util.function.Consumer; +import java.util.function.Supplier; import org.apache.commons.lang3.reflect.FieldUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.junit.Assert; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; @@ -50,23 +54,18 @@ import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.test.context.runner.ApplicationContextRunner; -import org.springframework.cloud.stream.annotation.EnableBinding; -import org.springframework.cloud.stream.annotation.Input; -import org.springframework.cloud.stream.annotation.StreamListener; import org.springframework.cloud.stream.binder.Binding; import org.springframework.cloud.stream.binder.ExtendedConsumerProperties; import org.springframework.cloud.stream.binder.ExtendedProducerProperties; -import org.springframework.cloud.stream.binder.PollableMessageSource; import org.springframework.cloud.stream.binding.BindingService; import org.springframework.cloud.stream.config.ConsumerEndpointCustomizer; import org.springframework.cloud.stream.config.ProducerMessageHandlerCustomizer; -import org.springframework.cloud.stream.messaging.Processor; -import org.springframework.cloud.stream.messaging.Sink; import org.springframework.cloud.stream.provisioning.ConsumerDestination; import org.springframework.cloud.stream.provisioning.ProducerDestination; import org.springframework.context.annotation.Bean; import org.springframework.integration.core.MessageProducer; import org.springframework.messaging.MessageChannel; +import reactor.core.publisher.Flux; /** * Tests for channel binder. @@ -77,7 +76,7 @@ class PubSubMessageChannelBinderTests { private static final Log LOGGER = LogFactory.getLog(PubSubMessageChannelBinderTests.class); - PubSubMessageChannelBinder binder; + private PubSubMessageChannelBinder binder; @Mock PubSubChannelProvisioner channelProvisioner; @@ -97,18 +96,22 @@ class PubSubMessageChannelBinderTests { @Mock HealthTrackerRegistry healthTrackerRegistry; - ApplicationContextRunner baseContext = - new ApplicationContextRunner() - .withBean(PubSubTemplate.class, () -> pubSubTemplate) - .withBean(PubSubAdmin.class, () -> pubSubAdmin) - .withConfiguration( - AutoConfigurations.of( - PubSubBinderConfiguration.class, PubSubExtendedBindingProperties.class)); + private ApplicationContextRunner baseContext; + + @BeforeEach + void init() { + baseContext = + new ApplicationContextRunner() + .withBean(PubSubTemplate.class, () -> pubSubTemplate) + .withBean(PubSubAdmin.class, () -> pubSubAdmin) + .withConfiguration( + AutoConfigurations.of( + PubSubBinderConfiguration.class, PubSubExtendedBindingProperties.class)); + this.binder = new PubSubMessageChannelBinder(new String[0], this.channelProvisioner, this.pubSubTemplate, this.properties); + } @Test void testAfterUnbindConsumer() { - - this.binder = new PubSubMessageChannelBinder(new String[0], this.channelProvisioner, this.pubSubTemplate, this.properties); this.binder.afterUnbindConsumer(this.consumerDestination, "group1", this.consumerProperties); verify(this.channelProvisioner).afterUnbindConsumer(this.consumerDestination); @@ -116,8 +119,6 @@ void testAfterUnbindConsumer() { @Test void producerSyncPropertyFalseByDefault() { - - this.binder = new PubSubMessageChannelBinder(new String[0], this.channelProvisioner, this.pubSubTemplate, this.properties); when(producerDestination.getName()).thenReturn("test-topic"); baseContext.run( ctx -> { @@ -137,8 +138,6 @@ void producerSyncPropertyFalseByDefault() { @Test void producerSyncPropertyPropagatesToMessageHandler() { - - this.binder = new PubSubMessageChannelBinder(new String[0], this.channelProvisioner, this.pubSubTemplate, this.properties); when(producerDestination.getName()).thenReturn("test-topic"); baseContext .withPropertyValues("spring.cloud.stream.gcp.pubsub.default.producer.sync=true") @@ -162,7 +161,6 @@ void producerSyncPropertyPropagatesToMessageHandler() { @Test void producerHeaderPropertyPropagatesToMessageHandler() { - this.binder = new PubSubMessageChannelBinder(new String[0], this.channelProvisioner, this.pubSubTemplate, this.properties); when(producerDestination.getName()).thenReturn("test-topic"); baseContext .withPropertyValues("spring.cloud.stream.gcp.pubsub.default.producer.allowedHeaders=foo4,foo5") @@ -181,13 +179,12 @@ void producerHeaderPropertyPropagatesToMessageHandler() { errorChannel); PubSubHeaderMapper mapper = (PubSubHeaderMapper) FieldUtils.readField(messageHandler, "headerMapper", true); String[] headersToCheck = (String[]) FieldUtils.readField(mapper, "outboundHeaderPatterns", true); - Assert.assertArrayEquals(headersToCheck, new String[]{"foo4", "foo5"}); + Assertions.assertArrayEquals(new String[]{"foo4", "foo5"}, headersToCheck); }); } @Test void consumerMaxFetchPropertyPropagatesToMessageSource() { - this.binder = new PubSubMessageChannelBinder(new String[0], this.channelProvisioner, this.pubSubTemplate, this.properties); when(consumerDestination.getName()).thenReturn("test-subscription"); baseContext .withPropertyValues("spring.cloud.stream.gcp.pubsub.default.consumer.maxFetchSize=20") @@ -209,8 +206,6 @@ void consumerMaxFetchPropertyPropagatesToMessageSource() { @Test void testCreateConsumerWithRegistry() { - - this.binder = new PubSubMessageChannelBinder(new String[0], this.channelProvisioner, this.pubSubTemplate, this.properties); when(consumerDestination.getName()).thenReturn("test-subscription"); baseContext.run( ctx -> { @@ -235,11 +230,15 @@ void testCreateConsumerWithRegistry() { @Test void testProducerAndConsumerCustomizers() { - - this.binder = new PubSubMessageChannelBinder(new String[0], this.channelProvisioner, this.pubSubTemplate, this.properties); baseContext .withUserConfiguration(PubSubBinderTestConfig.class) - .withPropertyValues("spring.cloud.stream.bindings.input.group=testGroup") + .withPropertyValues( + "spring.cloud.stream.pollable-source=consumer", + "spring.cloud.stream.bindings.producer-out-0.destination=my-topic", + "spring.cloud.stream.bindings.producer-out-0.group=testGroup", + "spring.cloud.stream.bindings.consumer-in-0.destination=my-topic", + "spring.cloud.stream.bindings.consumer-in-0.group=testGroup" + ) .run( context -> { DirectFieldAccessor channelBindingServiceAccessor = @@ -248,8 +247,9 @@ void testProducerAndConsumerCustomizers() { Map>> consumerBindings = (Map>>) channelBindingServiceAccessor.getPropertyValue("consumerBindings"); + assertThat(consumerBindings).isNotEmpty(); assertThat( - new DirectFieldAccessor(consumerBindings.get("input").get(0)) + new DirectFieldAccessor(consumerBindings.get("consumer-in-0").get(0)) .getPropertyValue("lifecycle.beanName")) .isEqualTo("setByCustomizer:input"); @@ -257,6 +257,7 @@ void testProducerAndConsumerCustomizers() { Map> producerBindings = (Map>) channelBindingServiceAccessor.getPropertyValue("producerBindings"); + assertThat(producerBindings).isNotEmpty(); assertThat( new DirectFieldAccessor(producerBindings.get("output")) .getPropertyValue("val$producerMessageHandler.beanName")) @@ -266,8 +267,6 @@ void testProducerAndConsumerCustomizers() { @Test void testConsumerEndpointCreation() { - - this.binder = new PubSubMessageChannelBinder(new String[0], this.channelProvisioner, this.pubSubTemplate, this.properties); when(consumerDestination.getName()).thenReturn("test-subscription"); baseContext .withPropertyValues( @@ -300,8 +299,6 @@ void testConsumerEndpointCreation() { @Test void testConsumerEndpointCreationWithNoHeadersProvided() { - - this.binder = new PubSubMessageChannelBinder(new String[0], this.channelProvisioner, this.pubSubTemplate, this.properties); when(consumerDestination.getName()).thenReturn("test-subscription"); baseContext .run( @@ -323,14 +320,13 @@ void testConsumerEndpointCreationWithNoHeadersProvided() { (PubSubInboundChannelAdapter) messageProducer; PubSubHeaderMapper mapper = (PubSubHeaderMapper) FieldUtils.readField(inboundChannelAdapter, "headerMapper", true); String [] headersToCheck = (String[]) FieldUtils.readField(mapper, "inboundHeaderPatterns", true); - Assert.assertArrayEquals(headersToCheck, (String[]) FieldUtils.readField(mapper, "inboundHeaderPatterns", true)); + Assertions.assertArrayEquals(headersToCheck, + (String[]) FieldUtils.readField(mapper, "inboundHeaderPatterns", true)); }); } @Test void testConsumerEndpointCreationWithHeadersProvided() { - - this.binder = new PubSubMessageChannelBinder(new String[0], this.channelProvisioner, this.pubSubTemplate, this.properties); when(consumerDestination.getName()).thenReturn("test-subscription"); baseContext .withPropertyValues("spring.cloud.stream.gcp.pubsub.default.consumer.allowedHeaders=foo2,foo3") @@ -353,16 +349,10 @@ void testConsumerEndpointCreationWithHeadersProvided() { (PubSubInboundChannelAdapter) messageProducer; PubSubHeaderMapper mapper = (PubSubHeaderMapper) FieldUtils.readField(inboundChannelAdapter, "headerMapper", true); String [] headersToCheck = (String[]) FieldUtils.readField(mapper, "inboundHeaderPatterns", true); - Assert.assertArrayEquals(headersToCheck, new String[]{"foo2", "foo3"}); + Assertions.assertArrayEquals(new String[]{"foo2", "foo3"}, headersToCheck); }); } - public interface PollableSource { - @Input - PollableMessageSource source(); - } - - @EnableBinding({Processor.class, PollableSource.class}) @EnableAutoConfiguration public static class PubSubBinderTestConfig { @@ -377,9 +367,14 @@ public ProducerMessageHandlerCustomizer handlerCustomizer( handler.setBeanName("setByCustomizer:" + destinationName); } - @StreamListener(Sink.INPUT) - public void process(String payload) throws InterruptedException { - LOGGER.info("received: " + payload); + @Bean + public Supplier> producer() { + return () -> Flux.just("empty"); + } + + @Bean + public Consumer consumer() { + return str -> LOGGER.info("received " + str); } @Bean diff --git a/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/properties/PubSubExtendedBindingsPropertiesTests.java b/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/properties/PubSubExtendedBindingsPropertiesTests.java index 895e6c761d..48e130e6cf 100644 --- a/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/properties/PubSubExtendedBindingsPropertiesTests.java +++ b/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/properties/PubSubExtendedBindingsPropertiesTests.java @@ -31,33 +31,40 @@ import com.google.cloud.spring.pubsub.support.PublisherFactory; import com.google.cloud.spring.pubsub.support.SubscriberFactory; import com.google.cloud.spring.stream.binder.pubsub.PubSubMessageChannelBinder; +import com.google.cloud.spring.stream.binder.pubsub.config.PubSubBinderConfiguration; import com.google.cloud.spring.stream.binder.pubsub.properties.PubSubExtendedBindingsPropertiesTests.PubSubBindingsTestConfiguration; import com.google.pubsub.v1.Subscription; import com.google.pubsub.v1.Topic; +import java.util.function.Consumer; +import java.util.function.Supplier; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.cloud.stream.annotation.EnableBinding; -import org.springframework.cloud.stream.annotation.Input; -import org.springframework.cloud.stream.annotation.StreamListener; import org.springframework.cloud.stream.binder.BinderFactory; +import org.springframework.cloud.stream.config.BinderFactoryAutoConfiguration; import org.springframework.cloud.stream.config.BindingServiceConfiguration; -import org.springframework.cloud.stream.messaging.Sink; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.messaging.MessageChannel; -import org.springframework.messaging.SubscribableChannel; import org.springframework.test.context.junit.jupiter.SpringExtension; /** Tests for extended binding properties. */ @ExtendWith(SpringExtension.class) @SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.NONE, - classes = {PubSubBindingsTestConfiguration.class, BindingServiceConfiguration.class}, + classes = { + PubSubBindingsTestConfiguration.class, + BinderFactoryAutoConfiguration.class, + PubSubBinderConfiguration.class, + PubSubExtendedBindingProperties.class, + BindingServiceConfiguration.class + }, properties = { + "spring.cloud.stream.pollable-source=customIn", "spring.cloud.stream.gcp.pubsub.bindings.input.consumer.ack-mode=AUTO_ACK", "spring.cloud.stream.gcp.pubsub.bindings.input.consumer.auto-create-resources=true", "spring.cloud.stream.gcp.pubsub.default.consumer.auto-create-resources=false" @@ -83,7 +90,6 @@ void testExtendedPropertiesOverrideDefaults() { /** Spring Boot config for tests. */ @Configuration - @EnableBinding(PubSubBindingsTestConfiguration.CustomTestSink.class) static class PubSubBindingsTestConfiguration { @Bean @@ -113,20 +119,19 @@ public PubSubTemplate pubSubTemplate() { new PubSubSubscriberTemplate(subscriberFactory)); } - @StreamListener("input") - public void process(String payload) { - System.out.println(payload); + @Bean + Consumer process() { + return System.out::println; } - @StreamListener("custom-in") - public void processCustom(String payload) { - System.out.println(payload); + @Bean + Consumer processCustom() { + return System.out::println; } - /** interface for testing. */ - interface CustomTestSink extends Sink { - @Input("custom-in") - SubscribableChannel customIn(); + @Bean + public Supplier customIn() { + return () -> "empty"; } } } From 622173c167ce8fe1824f3cca2e26b6c779f9da51 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 25 Oct 2022 13:57:17 -0400 Subject: [PATCH 024/179] remove deprecated class in comments --- .../security/IapAuthenticationAutoConfiguration.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/security/IapAuthenticationAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/security/IapAuthenticationAutoConfiguration.java index 08719bf134..c96b77b67b 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/security/IapAuthenticationAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/security/IapAuthenticationAutoConfiguration.java @@ -37,7 +37,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.oauth2.core.DelegatingOAuth2TokenValidator; import org.springframework.security.oauth2.core.OAuth2TokenValidator; import org.springframework.security.oauth2.jose.jws.SignatureAlgorithm; @@ -67,12 +66,6 @@ * * * - *

If a custom {@link WebSecurityConfigurerAdapter} is present, it must add {@code - * .oauth2ResourceServer().jwt()} customization to {@link - * org.springframework.security.config.annotation.web.builders.HttpSecurity} object. If no custom - * {@link WebSecurityConfigurerAdapter} is found, Spring Boot's default {@code - * OAuth2ResourceServerWebSecurityConfiguration} will add this customization. - * * @since 1.1 */ @Configuration(proxyBeanMethods = false) From 748cef328e80896bc3d8073e65e3c49a659b7323 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 25 Oct 2022 13:58:24 -0400 Subject: [PATCH 025/179] fix broken unit tests --- .../integration/inbound/PubSubInboundChannelAdapterTests.java | 2 +- .../pubsub/integration/inbound/PubSubMessageSourceTests.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/integration/inbound/PubSubInboundChannelAdapterTests.java b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/integration/inbound/PubSubInboundChannelAdapterTests.java index 4e6febb390..855ac1f4a2 100644 --- a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/integration/inbound/PubSubInboundChannelAdapterTests.java +++ b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/integration/inbound/PubSubInboundChannelAdapterTests.java @@ -57,7 +57,7 @@ @ExtendWith(OutputCaptureExtension.class) class PubSubInboundChannelAdapterTests { - private TestUtils.TestApplicationContext context = TestUtils.createTestApplicationContext(); + private final TestUtils.TestApplicationContext context = TestUtils.createTestApplicationContext(); PubSubInboundChannelAdapter adapter; diff --git a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/integration/inbound/PubSubMessageSourceTests.java b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/integration/inbound/PubSubMessageSourceTests.java index cb3d99831c..6b53039ac1 100644 --- a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/integration/inbound/PubSubMessageSourceTests.java +++ b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/integration/inbound/PubSubMessageSourceTests.java @@ -254,7 +254,7 @@ void doReceive_autoModeNacksAutomatically() { }); }) .isInstanceOf(MessageHandlingException.class) - .hasMessageContaining("Nope."); + .hasStackTraceContaining("Nope."); verify(this.msg1).nack(); } @@ -276,7 +276,7 @@ void doReceive_autoAckModeDoesNotNackAutomatically() { }); }) .isInstanceOf(MessageHandlingException.class) - .hasMessageContaining("Nope."); + .hasStackTraceContaining("Nope."); verify(this.msg1, times(0)).nack(); } From 33b58d7e3408a0a6282a6bb0160ff2630e7a26e4 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 25 Oct 2022 13:58:56 -0400 Subject: [PATCH 026/179] rebase --- spring-cloud-gcp-samples/pom.xml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/spring-cloud-gcp-samples/pom.xml b/spring-cloud-gcp-samples/pom.xml index 275b553fff..e6f8847e8a 100644 --- a/spring-cloud-gcp-samples/pom.xml +++ b/spring-cloud-gcp-samples/pom.xml @@ -6,7 +6,7 @@ org.springframework.boot spring-boot-starter-parent - 2.7.6 + 3.0.0-RC1 @@ -112,6 +112,19 @@ + + + spring-milestone + https://repo.spring.io/milestone + + + + + spring-milestone + https://repo.spring.io/milestone + + + From 177cd74dd3fad6adfcb9d1ceff240b040125e251 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 25 Oct 2022 13:59:38 -0400 Subject: [PATCH 027/179] fix broken unit testd --- .../google/cloud/spring/pubsub/core/PubSubTemplateTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/PubSubTemplateTests.java b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/PubSubTemplateTests.java index d95f5055c6..cbb5474b57 100644 --- a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/PubSubTemplateTests.java +++ b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/PubSubTemplateTests.java @@ -186,7 +186,7 @@ void testSend_onFailure() { assertThatThrownBy(() -> future.get()) .isInstanceOf(ExecutionException.class) - .hasMessageContaining("future failed."); + .hasStackTraceContaining("future failed."); } @Test @@ -198,7 +198,7 @@ void testPublish_onFailureWithPayload() { assertThatThrownBy(() -> future.get()) .isInstanceOf(ExecutionException.class) .hasCauseInstanceOf(PubSubDeliveryException.class) - .hasMessageContaining("Publish failed"); + .hasStackTraceContaining("Publish failed"); } @Test From 55e6d5b551a1ef8ca9deba5a2fe5f7781555c674 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 25 Oct 2022 14:01:31 -0400 Subject: [PATCH 028/179] rebase --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 966f29777c..d74a09178a 100644 --- a/pom.xml +++ b/pom.xml @@ -38,8 +38,8 @@ - 2021.0.5 - 2.7.6 + 2022.0.0-M4 + 3.0.0-RC1 1.0.4 2.4.1 0.10.5 From 20d8e51b05e5eb9eae2e9cc5b9ec2b0d283a4b7d Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 27 Oct 2022 11:21:25 -0400 Subject: [PATCH 029/179] change extended binding properties tests according to spring style --- ...PubSubExtendedBindingsPropertiesTests.java | 172 ++++++++---------- 1 file changed, 77 insertions(+), 95 deletions(-) diff --git a/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/properties/PubSubExtendedBindingsPropertiesTests.java b/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/properties/PubSubExtendedBindingsPropertiesTests.java index 48e130e6cf..601e4876f0 100644 --- a/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/properties/PubSubExtendedBindingsPropertiesTests.java +++ b/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/properties/PubSubExtendedBindingsPropertiesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2020 the original author or authors. + * Copyright 2017-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,121 +17,103 @@ package com.google.cloud.spring.stream.binder.pubsub.properties; import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.when; -import com.google.cloud.pubsub.v1.Subscriber; -import com.google.cloud.pubsub.v1.stub.SubscriberStub; -import com.google.cloud.spring.pubsub.PubSubAdmin; -import com.google.cloud.spring.pubsub.core.PubSubTemplate; -import com.google.cloud.spring.pubsub.core.publisher.PubSubPublisherTemplate; -import com.google.cloud.spring.pubsub.core.subscriber.PubSubSubscriberTemplate; import com.google.cloud.spring.pubsub.integration.AckMode; -import com.google.cloud.spring.pubsub.support.PublisherFactory; -import com.google.cloud.spring.pubsub.support.SubscriberFactory; -import com.google.cloud.spring.stream.binder.pubsub.PubSubMessageChannelBinder; -import com.google.cloud.spring.stream.binder.pubsub.config.PubSubBinderConfiguration; -import com.google.cloud.spring.stream.binder.pubsub.properties.PubSubExtendedBindingsPropertiesTests.PubSubBindingsTestConfiguration; -import com.google.pubsub.v1.Subscription; -import com.google.pubsub.v1.Topic; -import java.util.function.Consumer; -import java.util.function.Supplier; -import org.junit.jupiter.api.Disabled; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mockito; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.cloud.stream.binder.BinderFactory; -import org.springframework.cloud.stream.config.BinderFactoryAutoConfiguration; -import org.springframework.cloud.stream.config.BindingServiceConfiguration; +import org.springframework.cloud.stream.binder.Binder; +import org.springframework.cloud.stream.binder.BinderConfiguration; +import org.springframework.cloud.stream.binder.BinderType; +import org.springframework.cloud.stream.binder.BinderTypeRegistry; +import org.springframework.cloud.stream.binder.DefaultBinderFactory; +import org.springframework.cloud.stream.binder.DefaultBinderTypeRegistry; +import org.springframework.cloud.stream.binder.ExtendedPropertiesBinder; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.support.GenericApplicationContext; +import org.springframework.core.env.ConfigurableEnvironment; +import org.springframework.core.env.MapPropertySource; +import org.springframework.core.env.StandardEnvironment; import org.springframework.messaging.MessageChannel; -import org.springframework.test.context.junit.jupiter.SpringExtension; -/** Tests for extended binding properties. */ -@ExtendWith(SpringExtension.class) -@SpringBootTest( - webEnvironment = SpringBootTest.WebEnvironment.NONE, - classes = { - PubSubBindingsTestConfiguration.class, - BinderFactoryAutoConfiguration.class, - PubSubBinderConfiguration.class, - PubSubExtendedBindingProperties.class, - BindingServiceConfiguration.class - }, - properties = { - "spring.cloud.stream.pollable-source=customIn", - "spring.cloud.stream.gcp.pubsub.bindings.input.consumer.ack-mode=AUTO_ACK", - "spring.cloud.stream.gcp.pubsub.bindings.input.consumer.auto-create-resources=true", - "spring.cloud.stream.gcp.pubsub.default.consumer.auto-create-resources=false" - }) +/** + * Tests for extended binding properties. + */ class PubSubExtendedBindingsPropertiesTests { - @Autowired private ConfigurableApplicationContext context; + @Test + void testExtendedDefaultProducerProperties() { + DefaultBinderFactory binderFactory = createMockExtendedBinderFactory(); + Binder binder = binderFactory.getBinder(null, + MessageChannel.class); + PubSubProducerProperties producerProperties = (PubSubProducerProperties) ((ExtendedPropertiesBinder) binder) + .getExtendedProducerProperties("default-output"); + assertThat(producerProperties.isAutoCreateResources()).isTrue(); + assertThat(producerProperties.getAllowedHeaders()).isNull(); + assertThat(producerProperties.isSync()).isFalse(); + } @Test - void testExtendedPropertiesOverrideDefaults() { - BinderFactory binderFactory = this.context.getBeanFactory().getBean(BinderFactory.class); - PubSubMessageChannelBinder binder = - (PubSubMessageChannelBinder) binderFactory.getBinder("pubsub", MessageChannel.class); + void testExtendedDefaultConsumerProperties() { + DefaultBinderFactory binderFactory = createMockExtendedBinderFactory(); + Binder binder = binderFactory.getBinder(null, + MessageChannel.class); + PubSubConsumerProperties consumerProperties = (PubSubConsumerProperties) ((ExtendedPropertiesBinder) binder) + .getExtendedConsumerProperties("default-input"); + assertThat(consumerProperties.isAutoCreateResources()).isTrue(); + assertThat(consumerProperties.getAllowedHeaders()).isNull(); + assertThat(consumerProperties.getAckMode()).isEqualTo(AckMode.AUTO); + assertThat(consumerProperties.getMaxFetchSize()).isEqualTo(1); + assertThat(consumerProperties.getSubscriptionName()).isNull(); + assertThat(consumerProperties.getDeadLetterPolicy()).isNull(); + } - assertThat(binder.getExtendedConsumerProperties("custom-in").isAutoCreateResources()).isFalse(); - assertThat(binder.getExtendedConsumerProperties("input").isAutoCreateResources()).isTrue(); + private DefaultBinderFactory createMockExtendedBinderFactory() { + BinderTypeRegistry binderTypeRegistry = createMockExtendedBinderTypeRegistry(); + return new DefaultBinderFactory( + Collections.singletonMap("mock", + new BinderConfiguration("mock", new HashMap<>(), true, true)), + binderTypeRegistry, null); + } - assertThat(binder.getExtendedConsumerProperties("custom-in").getAckMode()) - .isEqualTo(AckMode.AUTO); - assertThat(binder.getExtendedConsumerProperties("input").getAckMode()) - .isEqualTo(AckMode.AUTO_ACK); + private DefaultBinderTypeRegistry createMockExtendedBinderTypeRegistry() { + return new DefaultBinderTypeRegistry( + Collections.singletonMap("mock", new BinderType("mock", + new Class[]{ MockExtendedBinderConfiguration.class }))); } - /** Spring Boot config for tests. */ @Configuration - static class PubSubBindingsTestConfiguration { - - @Bean - public PubSubAdmin pubSubAdmin() { - PubSubAdmin pubSubAdminMock = Mockito.mock(PubSubAdmin.class); - when(pubSubAdminMock.createSubscription(anyString(), anyString())) - .thenReturn(Subscription.getDefaultInstance()); - when(pubSubAdminMock.getSubscription(anyString())) - .thenReturn(Subscription.getDefaultInstance()); - when(pubSubAdminMock.getTopic(anyString())).thenReturn(Topic.getDefaultInstance()); - return pubSubAdminMock; - } - - @Bean - public PubSubTemplate pubSubTemplate() { - PublisherFactory publisherFactory = Mockito.mock(PublisherFactory.class); - - SubscriberFactory subscriberFactory = Mockito.mock(SubscriberFactory.class); - when(subscriberFactory.getProjectId()).thenReturn("test-project"); - when(subscriberFactory.createSubscriberStub(any())) - .thenReturn(Mockito.mock(SubscriberStub.class)); - when(subscriberFactory.createSubscriber(anyString(), any())) - .thenReturn(Mockito.mock(Subscriber.class)); - - return new PubSubTemplate( - new PubSubPublisherTemplate(publisherFactory), - new PubSubSubscriberTemplate(subscriberFactory)); - } - - @Bean - Consumer process() { - return System.out::println; - } - - @Bean - Consumer processCustom() { - return System.out::println; - } + public static class MockExtendedBinderConfiguration { + @SuppressWarnings("rawtypes") @Bean - public Supplier customIn() { - return () -> "empty"; + public Binder extendedPropertiesBinder() { + Binder mock = Mockito.mock(Binder.class, + Mockito.withSettings().defaultAnswer(Mockito.RETURNS_MOCKS) + .extraInterfaces(ExtendedPropertiesBinder.class)); + ConfigurableEnvironment environment = new StandardEnvironment(); + Map propertiesToAdd = new HashMap<>(); + environment.getPropertySources() + .addLast(new MapPropertySource("extPropertiesConfig", propertiesToAdd)); + ConfigurableApplicationContext applicationContext = new GenericApplicationContext(); + applicationContext.setEnvironment(environment); + + PubSubExtendedBindingProperties pubSubExtendedBindingProperties = new PubSubExtendedBindingProperties(); + pubSubExtendedBindingProperties.setApplicationContext(applicationContext); + final PubSubConsumerProperties defaultConsumerProperties = pubSubExtendedBindingProperties + .getExtendedConsumerProperties("default-input"); + final PubSubProducerProperties defaultProducerProperties = pubSubExtendedBindingProperties + .getExtendedProducerProperties("default-output"); + when(((ExtendedPropertiesBinder) mock).getExtendedConsumerProperties("default-input")) + .thenReturn(defaultConsumerProperties); + when(((ExtendedPropertiesBinder) mock).getExtendedProducerProperties("default-output")) + .thenReturn(defaultProducerProperties); + return mock; } } } From bc50f97ec85be3ca5a02be104188ace0d519b555 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 27 Oct 2022 11:35:04 -0400 Subject: [PATCH 030/179] improve line coverage --- .../pubsub/PubSubMessageChannelBinderTests.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/PubSubMessageChannelBinderTests.java b/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/PubSubMessageChannelBinderTests.java index d5e9cf0f65..541c187225 100644 --- a/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/PubSubMessageChannelBinderTests.java +++ b/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/PubSubMessageChannelBinderTests.java @@ -187,7 +187,11 @@ void producerHeaderPropertyPropagatesToMessageHandler() { void consumerMaxFetchPropertyPropagatesToMessageSource() { when(consumerDestination.getName()).thenReturn("test-subscription"); baseContext - .withPropertyValues("spring.cloud.stream.gcp.pubsub.default.consumer.maxFetchSize=20") + .withPropertyValues( + "spring.cloud.stream.gcp.pubsub.default.consumer.maxFetchSize=20", + "spring.cloud.stream.gcp.pubsub.default.consumer.subscription-name=mock", + "spring.cloud.stream.gcp.pubsub.default.consumer.auto-create-resources=false" + ) .run( ctx -> { PubSubMessageChannelBinder binder = ctx.getBean(PubSubMessageChannelBinder.class); @@ -195,6 +199,14 @@ void consumerMaxFetchPropertyPropagatesToMessageSource() { ctx.getBean( "pubSubExtendedBindingProperties", PubSubExtendedBindingProperties.class); + assertThat(props.getExtendedConsumerProperties("test") + .getSubscriptionName()) + .isEqualTo("mock"); + + assertThat(props.getExtendedConsumerProperties("test") + .isAutoCreateResources()) + .isFalse(); + PubSubMessageSource source = binder.createPubSubMessageSource( consumerDestination, From 84974479ea12c3c92a519c5a671e121258385d19 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sun, 30 Oct 2022 15:32:50 -0400 Subject: [PATCH 031/179] update errorprone to 2.16 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d74a09178a..3c94e6bb1b 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 3.2.0 9.3 2.0.0 - 2.15.0 + 2.16 From ebc874579c8c0e59f290cfd845875dcae98edf0b Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sun, 30 Oct 2022 17:37:19 -0400 Subject: [PATCH 032/179] refactor code --- .../DefaultDatastoreEntityConverter.java | 2 +- .../core/convert/TwoStepsConversions.java | 118 +++++++----------- 2 files changed, 47 insertions(+), 73 deletions(-) diff --git a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DefaultDatastoreEntityConverter.java b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DefaultDatastoreEntityConverter.java index 931bf0c787..abf6e4a695 100644 --- a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DefaultDatastoreEntityConverter.java +++ b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DefaultDatastoreEntityConverter.java @@ -172,7 +172,7 @@ public R read(Class clazz, BaseEntity entity) { persistentEntity.doWithColumnBackedProperties( datastorePersistentProperty -> { // if a property is a constructor argument, it was already computed on instantiation - if (!persistentEntity.isConstructorArgument(datastorePersistentProperty)) { + if (!persistentEntity.isCreatorArgument(datastorePersistentProperty)) { Object value = propertyValueProvider.getPropertyValue(datastorePersistentProperty); if (value != null) { accessor.setProperty(datastorePersistentProperty, value); diff --git a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/TwoStepsConversions.java b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/TwoStepsConversions.java index 09eee40c10..024d22c772 100644 --- a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/TwoStepsConversions.java +++ b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/TwoStepsConversions.java @@ -34,12 +34,12 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; import java.util.function.BiFunction; import java.util.function.Consumer; import java.util.function.Function; -import java.util.stream.Collectors; import java.util.stream.StreamSupport; import org.springframework.core.convert.ConversionException; import org.springframework.core.convert.converter.Converter; @@ -47,7 +47,6 @@ import org.springframework.core.convert.support.GenericConversionService; import org.springframework.data.convert.CustomConversions; import org.springframework.data.mapping.PersistentEntity; -import org.springframework.data.util.ClassTypeInformation; import org.springframework.data.util.TypeInformation; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; @@ -62,7 +61,7 @@ */ public class TwoStepsConversions implements ReadWriteConversions { private static final Converter BLOB_TO_BYTE_ARRAY_CONVERTER = - new Converter() { + new Converter<>() { @Override public byte[] convert(Blob source) { return source.toByteArray(); @@ -70,7 +69,7 @@ public byte[] convert(Blob source) { }; private static final Converter BYTE_ARRAY_TO_BLOB_CONVERTER = - new Converter() { + new Converter<>() { @Override public Blob convert(byte[] source) { return Blob.copyFrom(source); @@ -106,14 +105,14 @@ public TwoStepsConversions( this.internalConversionService.addConverter(BLOB_TO_BYTE_ARRAY_CONVERTER); } + @SuppressWarnings("unchecked") @Override public T convertOnRead(Object val, Class targetCollectionType, Class targetComponentType) { - return (T) - convertOnRead( - val, - EmbeddedType.NOT_EMBEDDED, - targetCollectionType, - ClassTypeInformation.from(targetComponentType)); + return convertOnRead( + val, + EmbeddedType.NOT_EMBEDDED, + targetCollectionType, + TypeInformation.of(targetComponentType)); } @Override @@ -130,34 +129,25 @@ public T convertOnRead( return convertOnRead(val, embeddedType, collectionType, componentTypeInformation); } + @SuppressWarnings("unchecked") private T convertOnRead( Object val, EmbeddedType embeddedType, Class targetCollectionType, - TypeInformation targetComponentType) { + TypeInformation targetComponentType) { if (val == null) { return null; } - BiFunction, ?> readConverter; - switch (embeddedType) { - case EMBEDDED_MAP: - readConverter = - (x, typeInformation) -> - convertOnReadSingleEmbeddedMap( - x, - typeInformation.getComponentType().getType(), - typeInformation.getMapValueType(), - targetComponentType); - break; - case EMBEDDED_ENTITY: - readConverter = this::convertOnReadSingleEmbedded; - break; - case NOT_EMBEDDED: - readConverter = this::convertOnReadSingle; - break; - default: - throw new DatastoreDataException("Unexpected property embedded type: " + embeddedType); - } + BiFunction, ?> readConverter = switch (embeddedType) { + case EMBEDDED_MAP -> (x, typeInformation) -> + convertOnReadSingleEmbeddedMap( + x, + Objects.requireNonNull(typeInformation.getComponentType()).getType(), + typeInformation.getMapValueType(), + targetComponentType); + case EMBEDDED_ENTITY -> this::convertOnReadSingleEmbedded; + case NOT_EMBEDDED -> this::convertOnReadSingle; + }; if (ValueUtil.isCollectionLike(val.getClass()) && targetCollectionType != null @@ -166,15 +156,15 @@ private T convertOnRead( try { Assert.isInstanceOf( Iterable.class, val, "Value passed to convertOnRead expected to be Iterable"); - List elements = + List elements = StreamSupport.stream(((Iterable) val).spliterator(), false) .map( v -> { - Object o = (v instanceof Value) ? ((Value) v).get() : v; + Object o = (v instanceof Value) ? ((Value) v).get() : v; return readConverter.apply(o, targetComponentType); }) - .collect(Collectors.toList()); - return (T) convertCollection(elements, targetCollectionType); + .toList(); + return convertCollection(elements, targetCollectionType); } catch (ConversionException | DatastoreDataException ex) { throw new DatastoreDataException("Unable process elements of a collection", ex); } @@ -187,10 +177,10 @@ private Map convertOnReadSingleEmbeddedMap( Object value, Class keyType, TypeInformation targetComponentType, - TypeInformation componentType) { + TypeInformation componentType) { Assert.notNull(value, "Cannot convert a null value."); - if (value instanceof BaseEntity) { - return this.datastoreEntityConverter.readAsMap((BaseEntity) value, componentType); + if (value instanceof BaseEntity baseEntity) { + return this.datastoreEntityConverter.readAsMap(baseEntity, componentType); } throw new DatastoreDataException( "Embedded entity was expected, but " + value.getClass() + " found"); @@ -200,9 +190,9 @@ private Map convertOnReadSingleEmbeddedMap( private T convertOnReadSingleEmbedded( Object value, TypeInformation targetTypeInformation) { Assert.notNull(value, "Cannot convert a null value."); - if (value instanceof BaseEntity) { + if (value instanceof BaseEntity baseEntity) { return (T) - this.datastoreEntityConverter.read(targetTypeInformation.getType(), (BaseEntity) value); + this.datastoreEntityConverter.read(targetTypeInformation.getType(), baseEntity); } throw new DatastoreDataException( "Embedded entity was expected, but " + value.getClass() + " found"); @@ -213,8 +203,8 @@ private T convertOnReadSingle(Object val, TypeInformation targetTypeInfor if (val == null) { return null; } - Class targetType = boxIfNeeded(targetTypeInformation.getType()); - Class sourceType = val.getClass(); + Class targetType = boxIfNeeded(targetTypeInformation.getType()); + Class sourceType = val.getClass(); Object result = null; TypeTargets typeTargets = computeTypeTargets(targetType); @@ -231,8 +221,7 @@ private T convertOnReadSingle(Object val, TypeInformation targetTypeInfor && typeTargets.getSecondStepTarget() == null) { // only first step was applied on write result = this.conversionService.convert(val, targetType); - } else if (typeTargets.getFirstStepTarget() != null - && typeTargets.getSecondStepTarget() != null) { + } else if (typeTargets.getFirstStepTarget() != null) { // both steps were applied Object secondStepVal = this.internalConversionService.convert(val, typeTargets.getFirstStepTarget()); @@ -271,27 +260,19 @@ private Value convertOnWrite( Function writeConverter = this::convertOnWriteSingle; if (proppertyVal != null) { - switch (embeddedType) { - case EMBEDDED_MAP: - writeConverter = - x -> convertOnWriteSingleEmbeddedMap(x, fieldName, typeInformation.getMapValueType()); - break; - case EMBEDDED_ENTITY: - writeConverter = x -> convertOnWriteSingleEmbedded(x, fieldName); - break; - case NOT_EMBEDDED: - writeConverter = this::convertOnWriteSingle; - break; - default: - throw new DatastoreDataException("Unexpected property embedded type: " + embeddedType); - } + writeConverter = switch (embeddedType) { + case EMBEDDED_MAP -> x -> convertOnWriteSingleEmbeddedMap(x, fieldName, + typeInformation.getMapValueType()); + case EMBEDDED_ENTITY -> x -> convertOnWriteSingleEmbedded(x, fieldName); + case NOT_EMBEDDED -> this::convertOnWriteSingle; + }; } val = ValueUtil.toListIfArray(val); - if (val instanceof Iterable) { + if (val instanceof Iterable iterable) { List> values = new ArrayList<>(); - for (Object propEltValue : (Iterable) val) { + for (Object propEltValue : iterable) { values.add(writeConverter.apply(propEltValue)); } return ListValue.of(values); @@ -315,8 +296,8 @@ private EntityValue applyEntityValueBuilder( .map(PersistentEntity::getIdProperty) .map( id -> - this.datastoreMappingContext - .getPersistentEntity(val.getClass()) + Objects.requireNonNull(this.datastoreMappingContext + .getPersistentEntity(val.getClass())) .getPropertyAccessor(val) .getProperty(id)); @@ -340,7 +321,7 @@ private EntityValue convertOnWriteSingleEmbeddedMap( String field = convertOnReadSingle( convertOnWriteSingle(e.getKey()).get(), - ClassTypeInformation.from(String.class)); + TypeInformation.of(String.class)); builder.set( field, convertOnWrite( @@ -430,15 +411,8 @@ public void registerEntityConverter(DatastoreEntityConverter datastoreEntityConv this.datastoreEntityConverter = datastoreEntityConverter; } - private static class TypeTargets { - private Class firstStepTarget; - - private Class secondStepTarget; - - TypeTargets(Class firstStepTarget, Class secondStepTarget) { - this.firstStepTarget = firstStepTarget; - this.secondStepTarget = secondStepTarget; - } + private record TypeTargets(Class firstStepTarget, + Class secondStepTarget) { Class getFirstStepTarget() { return this.firstStepTarget; From e314000a29ea93d67a7fef45eb867e6435f72744 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sun, 30 Oct 2022 17:38:37 -0400 Subject: [PATCH 033/179] fix broken tests --- .../core/DatastoreTemplateTests.java | 3 +- .../DatastoreTransactionManagerTests.java | 16 ++++----- .../DefaultDatastoreEntityConverterTests.java | 36 +++++++++---------- .../EntityPropertyValueProviderTests.java | 8 +++-- .../convert/TestDatastoreItemCollections.java | 4 +-- 5 files changed, 35 insertions(+), 32 deletions(-) diff --git a/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/DatastoreTemplateTests.java b/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/DatastoreTemplateTests.java index 5f35fd7ce6..52c6064ac0 100644 --- a/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/DatastoreTemplateTests.java +++ b/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/DatastoreTemplateTests.java @@ -96,6 +96,7 @@ import org.springframework.data.domain.Slice; import org.springframework.data.domain.Sort; import org.springframework.data.util.ClassTypeInformation; +import org.springframework.data.util.TypeInformation; /** Tests for the Datastore Template. */ class DatastoreTemplateTests { @@ -1407,7 +1408,7 @@ void findByIdAsMapTest() { this.datastoreTemplate.findByIdAsMap(keyForMap, Long.class); verify(this.datastoreEntityConverter, times(1)) - .readAsMap(String.class, ClassTypeInformation.from(Long.class), datastoreEntity); + .readAsMap(String.class, TypeInformation.of(Long.class), datastoreEntity); } @Test diff --git a/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/DatastoreTransactionManagerTests.java b/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/DatastoreTransactionManagerTests.java index 65b4390d6f..f357a3eb50 100644 --- a/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/DatastoreTransactionManagerTests.java +++ b/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/DatastoreTransactionManagerTests.java @@ -101,15 +101,15 @@ void testDoCommit() { @Test void testDoCommitFailure() { - + DatastoreException exception = new DatastoreException(0, "", ""); when(this.transaction.isActive()).thenReturn(true); - when(this.transaction.commit()).thenThrow(new DatastoreException(0, "", "")); + when(this.transaction.commit()).thenThrow(exception); this.tx.setTransaction(this.transaction); assertThatThrownBy(() -> this.manager.doCommit(this.status)) .isInstanceOf(TransactionSystemException.class) - .hasMessage("Cloud Datastore transaction failed to commit.; " - + "nested exception is com.google.cloud.datastore.DatastoreException: "); + .hasMessage("Cloud Datastore transaction failed to commit.") + .hasCause(exception); } @Test @@ -130,15 +130,15 @@ void testDoRollback() { @Test void testDoRollbackFailure() { - + DatastoreException exception = new DatastoreException(0, "", ""); when(this.transaction.isActive()).thenReturn(true); - doThrow(new DatastoreException(0, "", "")).when(this.transaction).rollback(); + doThrow(exception).when(this.transaction).rollback(); this.tx.setTransaction(this.transaction); assertThatThrownBy(() -> this.manager.doRollback(this.status)) .isInstanceOf(TransactionSystemException.class) - .hasMessage("Cloud Datastore transaction failed to rollback.; " - + "nested exception is com.google.cloud.datastore.DatastoreException: "); + .hasMessage("Cloud Datastore transaction failed to rollback.") + .hasCause(exception); } @Test diff --git a/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/convert/DefaultDatastoreEntityConverterTests.java b/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/convert/DefaultDatastoreEntityConverterTests.java index 8a67579865..a6d14b2906 100644 --- a/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/convert/DefaultDatastoreEntityConverterTests.java +++ b/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/convert/DefaultDatastoreEntityConverterTests.java @@ -230,8 +230,8 @@ void testWrongTypeReadException() { .isInstanceOf(DatastoreDataException.class) .hasMessageContaining("Unable to read " + "com.google.cloud.spring.data.datastore.core.convert.TestDatastoreItem entity") - .hasMessageContaining("Unable to read property boolField") - .hasMessageContaining("Unable to convert class java.lang.Long to class java.lang.Boolean"); + .hasStackTraceContaining("Unable to read property boolField") + .hasStackTraceContaining("Unable to convert class java.lang.Long to class java.lang.Boolean"); } @Test @@ -258,8 +258,8 @@ void testWrongTypeReadExceptionList() { .isInstanceOf(DatastoreDataException.class) .hasMessageContaining("Unable to read " + "com.google.cloud.spring.data.datastore.core.convert.TestDatastoreItem entity") - .hasMessageContaining("Unable to read property boolField") - .hasMessageContaining("Unable to convert class " + .hasStackTraceContaining("Unable to read property boolField") + .hasStackTraceContaining("Unable to convert class " + "com.google.common.collect.SingletonImmutableList to class java.lang.Boolean"); } @@ -365,7 +365,7 @@ void testUnsupportedTypeWriteException() { assertThatThrownBy(() -> ENTITY_CONVERTER.write(item, builder)) .isInstanceOf(DatastoreDataException.class) .hasMessageContaining("Unable to write testItemUnsupportedFields.unsupportedField") - .hasMessageContaining("Unable to convert class " + .hasStackTraceContaining("Unable to convert class " + "com.google.cloud.spring.data.datastore.core.convert." + "TestItemUnsupportedFields$NewType to Datastore supported type."); } @@ -402,7 +402,7 @@ void testUnsupportedTypeWrite() { @Test void testCollectionFieldsUnsupportedCollection() { - ComparableBeanContextSupport comparableBeanContextSupport = new ComparableBeanContextSupport(); + ComparableBeanContextSupport comparableBeanContextSupport = new ComparableBeanContextSupport<>(); comparableBeanContextSupport.add("this implementation of Collection"); comparableBeanContextSupport.add("is unsupported out of the box!"); @@ -423,10 +423,10 @@ void testCollectionFieldsUnsupportedCollection() { .isInstanceOf(DatastoreDataException.class) .hasMessageContaining("Unable to read" + " com.google.cloud.spring.data.datastore.core.convert.TestDatastoreItemCollections" - + " entity;") - .hasMessageContaining("Unable to read property beanContext;") - .hasMessageContaining("Failed to convert from type [java.util.ArrayList] to type" - + " [com.google.cloud.spring.data.datastore.core.convert.TestDatastoreItemCollections$ComparableBeanContextSupport]"); + + " entity") + .hasStackTraceContaining("Unable to read property beanContext") + .hasStackTraceContaining("Failed to convert from type [java.util.ImmutableCollections$ListN] to type" + + " [com.google.cloud.spring.data.datastore.core.convert.TestDatastoreItemCollections$ComparableBeanContextSupport]"); } @Test @@ -550,7 +550,7 @@ void testCollectionFieldsUnsupported() { assertThatThrownBy(() -> ENTITY_CONVERTER.write(item, builder)) .isInstanceOf(DatastoreDataException.class) .hasMessageContaining("Unable to write collectionOfUnsupportedTypes.unsupportedElts") - .hasMessageContaining("Unable to convert " + .hasStackTraceContaining("Unable to convert " + "class com.google.cloud.spring.data.datastore.core.convert." + "TestItemUnsupportedFields$NewType to Datastore supported type."); } @@ -600,12 +600,12 @@ void testCollectionFieldsUnsupportedWriteReadException() { Class parameter = TestItemUnsupportedFields.CollectionOfUnsupportedTypes.class; assertThatThrownBy(() -> entityConverter.read(parameter, entity)) - .hasMessageContaining("Unable to read property unsupportedElts") - .hasMessageContaining("Unable process elements of a collection") - .hasMessageContaining("No converter found capable of converting from type [java.lang.Integer] " + .hasStackTraceContaining("Unable to read property unsupportedElts") + .hasStackTraceContaining("Unable process elements of a collection") + .hasStackTraceContaining("No converter found capable of converting from type [java.lang.Integer] " + "to type [com.google.cloud.spring.data.datastore.core.convert." + "TestItemUnsupportedFields$NewType]") - .hasMessageContaining("Unable to read com.google.cloud.spring.data.datastore.core.convert." + .hasStackTraceContaining("Unable to read com.google.cloud.spring.data.datastore.core.convert." + "TestItemUnsupportedFields$CollectionOfUnsupportedTypes entity") .isInstanceOf(DatastoreDataException.class); } @@ -882,7 +882,7 @@ void privateCustomMapExceptionTest() { entityConverter.read(ServiceConfigurationPrivateCustomMap.class, entity); }) .isInstanceOf(DatastoreDataException.class) - .hasMessageContaining( + .hasStackTraceContaining( "Unable to create an instance of a custom map type: " + "class com.google.cloud.spring.data.datastore.core.convert." + "DefaultDatastoreEntityConverterTests$PrivateCustomMap " @@ -896,7 +896,7 @@ void testMismatchedStringIdLongProperty() { assertThatThrownBy(() -> ENTITY_CONVERTER.read(LongIdEntity.class, testEntity)) .isInstanceOf(ConversionFailedException.class) - .hasMessageContaining("The given key doesn't have a numeric ID but a conversion to Long was attempted"); + .hasStackTraceContaining("The given key doesn't have a numeric ID but a conversion to Long was attempted"); } @Test @@ -906,7 +906,7 @@ void testMismatchedLongIdStringProperty() { assertThatThrownBy(() -> ENTITY_CONVERTER.read(StringIdEntity.class, testEntity)) .isInstanceOf(ConversionFailedException.class) - .hasMessageContaining("The given key doesn't have a String name value but a conversion to String was attempted"); + .hasStackTraceContaining("The given key doesn't have a String name value but a conversion to String was attempted"); } private Entity.Builder getEntityBuilder() { diff --git a/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/convert/EntityPropertyValueProviderTests.java b/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/convert/EntityPropertyValueProviderTests.java index ce57c28ee7..0ffa69fa51 100644 --- a/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/convert/EntityPropertyValueProviderTests.java +++ b/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/convert/EntityPropertyValueProviderTests.java @@ -127,8 +127,10 @@ void testException() { assertThatThrownBy(() -> provider.getPropertyValue(testDpe)) .isInstanceOf(DatastoreDataException.class) - .hasMessage("Unable to read property boolField; nested exception is " - + "com.google.cloud.spring.data.datastore.core.mapping.DatastoreDataException: " - + "Unable to convert class java.lang.Long to class java.lang.Boolean"); + // .hasMessage("Unable to read property boolField; nested exception is " + // + "com.google.cloud.spring.data.datastore.core.mapping.DatastoreDataException: " + // + "Unable to convert class java.lang.Long to class java.lang.Boolean") + .hasMessageContaining("Unable to read property boolField") + .hasStackTraceContaining("Unable to convert class java.lang.Long to class java.lang.Boolean"); } } diff --git a/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/convert/TestDatastoreItemCollections.java b/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/convert/TestDatastoreItemCollections.java index 4e8a609335..c627ed5e60 100644 --- a/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/convert/TestDatastoreItemCollections.java +++ b/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/convert/TestDatastoreItemCollections.java @@ -41,7 +41,7 @@ public class TestDatastoreItemCollections { public TestDatastoreItemCollections( List intList, - ComparableBeanContextSupport beanContext, + ComparableBeanContextSupport beanContext, String[] stringArray, boolean[] boolArray, byte[][] bytes, @@ -133,7 +133,7 @@ private boolean equal(Object a, Object b) { * BeanContextSupport does not provide an equals() implementation. This subclass overrides {@code * equals/hashCode} and keeps a simple list of values to enable test verification. */ - static class ComparableBeanContextSupport extends BeanContextSupport { + static class ComparableBeanContextSupport extends BeanContextSupport { private Set values = new HashSet<>(); @Override From 26f82a0f61ce4b2ab5533586d6800074bb832d0f Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 1 Nov 2022 14:02:10 -0400 Subject: [PATCH 034/179] log nested exception message explicitly --- .../inbound/PubSubInboundChannelAdapter.java | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/integration/inbound/PubSubInboundChannelAdapter.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/integration/inbound/PubSubInboundChannelAdapter.java index f8532254ee..14ad6ad288 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/integration/inbound/PubSubInboundChannelAdapter.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/integration/inbound/PubSubInboundChannelAdapter.java @@ -29,6 +29,7 @@ import org.apache.commons.logging.LogFactory; import org.springframework.integration.endpoint.MessageProducerSupport; import org.springframework.integration.mapping.HeaderMapper; +import org.springframework.messaging.MessageDeliveryException; import org.springframework.util.Assert; /** @@ -156,21 +157,30 @@ private void consumeMessage(ConvertedBasicAcknowledgeablePubsubMessage messag } catch (RuntimeException re) { if (this.ackMode == AckMode.AUTO) { message.nack(); - LOGGER.warn( - "Sending Spring message [" - + message.getPubsubMessage().getMessageId() - + "] failed; message nacked automatically.", - re); + logWarning(message, re, "message nacked automatically."); } else { - LOGGER.warn( - "Sending Spring message [" - + message.getPubsubMessage().getMessageId() - + "] failed; message neither acked nor nacked.", - re); + logWarning(message, re, "message neither acked nor nacked."); } } } + private void logWarning( + ConvertedBasicAcknowledgeablePubsubMessage message, + RuntimeException re, + String actionMessage) { + LOGGER.warn(String.format("Sending Spring message [%s] failed; %s", + message.getPubsubMessage().getMessageId(), actionMessage)); + // Starting from Spring 3.0, nested exception message is NOT included in stacktrace. + // However, customers may still rely on messages in nested exception to troubleshoot, + // so we explicitly log failure messages. + // See https://github.com/spring-projects/spring-framework/issues/25162 for more info. + if (re instanceof MessageDeliveryException messageDeliveryException) { + LOGGER.warn(messageDeliveryException.getFailedMessage()); + } else { + LOGGER.warn(re.getMessage()); + } + } + private void addToHealthRegistry() { if (healthCheckEnabled()) { healthTrackerRegistry.registerTracker(subscriptionName); From 6d76791a47cdc6c57af2b757c8092ee2e605d62c Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 1 Nov 2022 14:02:58 -0400 Subject: [PATCH 035/179] refactor test code --- .../PubSubInboundChannelAdapterTests.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/integration/inbound/PubSubInboundChannelAdapterTests.java b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/integration/inbound/PubSubInboundChannelAdapterTests.java index 855ac1f4a2..05289026e6 100644 --- a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/integration/inbound/PubSubInboundChannelAdapterTests.java +++ b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/integration/inbound/PubSubInboundChannelAdapterTests.java @@ -59,15 +59,15 @@ class PubSubInboundChannelAdapterTests { private final TestUtils.TestApplicationContext context = TestUtils.createTestApplicationContext(); - PubSubInboundChannelAdapter adapter; + private PubSubInboundChannelAdapter adapter; - static final String EXCEPTION_MESSAGE = "Simulated downstream message processing failure"; + private static final String EXCEPTION_MESSAGE = "Simulated downstream message processing failure"; - @Mock PubSubSubscriberOperations mockPubSubSubscriberOperations; + @Mock private PubSubSubscriberOperations mockPubSubSubscriberOperations; - @Mock MessageChannel mockMessageChannel; + @Mock private MessageChannel mockMessageChannel; - @Mock ConvertedBasicAcknowledgeablePubsubMessage mockAcknowledgeableMessage; + @Mock private ConvertedBasicAcknowledgeablePubsubMessage mockAcknowledgeableMessage; @BeforeEach @SuppressWarnings("unchecked") @@ -80,7 +80,7 @@ void setUp() { } - void setupSubscribeAndConvert() { + private void setupSubscribeAndConvert() { when(this.mockMessageChannel.send(any())).thenReturn(true); when(mockAcknowledgeableMessage.getPubsubMessage()) @@ -160,7 +160,6 @@ void testAckModeAuto_nacksWhenDownstreamProcessingFailsWhenContextShutdown(Captu this.adapter.stop(); throw new RuntimeException(EXCEPTION_MESSAGE); }); - this.adapter.start(); verify(mockAcknowledgeableMessage).nack(); @@ -168,7 +167,6 @@ void testAckModeAuto_nacksWhenDownstreamProcessingFailsWhenContextShutdown(Captu // original message handling exception assertThat(capturedOutput).contains("failed; message nacked automatically").contains(EXCEPTION_MESSAGE); - } @Test @@ -283,7 +281,7 @@ private void verifyOriginalMessage() { MessageHeaders headers = argument.getValue().getHeaders(); assertThat(headers).containsKey(GcpPubSubHeaders.ORIGINAL_MESSAGE); assertThat(headers.get(GcpPubSubHeaders.ORIGINAL_MESSAGE)).isNotNull(); - assertThat(headers.get(GcpPubSubHeaders.ORIGINAL_MESSAGE)) - .isEqualTo(mockAcknowledgeableMessage); + assertThat(headers) + .containsEntry(GcpPubSubHeaders.ORIGINAL_MESSAGE, mockAcknowledgeableMessage); } } From 5c91a7baef677e0d64bd062be2ed53d3dfc453c3 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 1 Nov 2022 14:24:47 -0400 Subject: [PATCH 036/179] remove deprecated class `ClassTypeInformation` --- .../datastore/core/DatastoreTemplate.java | 4 +- .../DefaultDatastoreEntityConverter.java | 5 +-- .../mapping/DatastoreMappingContextTests.java | 5 +-- .../DatastorePersistentEntityImplTests.java | 15 ++++--- .../query/PartTreeDatastoreQueryTests.java | 4 +- ...verterAwareMappingSpannerEntityReader.java | 16 +++---- .../mapping/SpannerCompositeKeyProperty.java | 3 +- .../SpannerPersistentPropertyImpl.java | 22 ++++++++- .../core/SpannerTransactionManagerTests.java | 12 ++--- ...rAwareMappingSpannerEntityReaderTests.java | 38 ++++++++-------- .../core/mapping/SpannerKeyPropertyTests.java | 4 +- .../mapping/SpannerMappingContextTests.java | 5 +-- .../SpannerPersistentEntityImplTests.java | 45 ++++++++++--------- 13 files changed, 99 insertions(+), 79 deletions(-) diff --git a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/DatastoreTemplate.java b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/DatastoreTemplate.java index f5e4cf06de..59129c021b 100644 --- a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/DatastoreTemplate.java +++ b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/DatastoreTemplate.java @@ -84,7 +84,7 @@ import org.springframework.data.mapping.AssociationHandler; import org.springframework.data.mapping.PersistentProperty; import org.springframework.data.mapping.PersistentPropertyAccessor; -import org.springframework.data.util.ClassTypeInformation; +import org.springframework.data.util.TypeInformation; import org.springframework.lang.NonNull; import org.springframework.lang.Nullable; import org.springframework.transaction.support.TransactionSynchronizationManager; @@ -470,7 +470,7 @@ public Map findByIdAsMap(Key key, Class valueType) { Entity entity = getDatastoreReadWriter().get(key); return this.datastoreEntityConverter.readAsMap( - String.class, ClassTypeInformation.from(valueType), entity); + String.class, TypeInformation.of(valueType), entity); } @Override diff --git a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DefaultDatastoreEntityConverter.java b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DefaultDatastoreEntityConverter.java index abf6e4a695..2d403effc8 100644 --- a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DefaultDatastoreEntityConverter.java +++ b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DefaultDatastoreEntityConverter.java @@ -42,7 +42,6 @@ import org.springframework.data.mapping.model.EntityInstantiators; import org.springframework.data.mapping.model.ParameterValueProvider; import org.springframework.data.mapping.model.PersistentEntityParameterValueProvider; -import org.springframework.data.util.ClassTypeInformation; import org.springframework.data.util.TypeInformation; import org.springframework.util.Assert; @@ -123,7 +122,7 @@ public Map readAsMap( if (entity == null) { return null; } - return readAsMap(entity, ClassTypeInformation.from(HashMap.class)); + return readAsMap(entity, TypeInformation.of(HashMap.class)); } public DatastorePersistentEntity getDiscriminationPersistentEntity( @@ -213,7 +212,7 @@ private boolean isDiscriminationFieldMatch( propertyValueProvider.getPropertyValue( entity.getDiscriminationFieldName(), NOT_EMBEDDED, - ClassTypeInformation.from(String[].class))) + TypeInformation.of(String[].class))) [0].equals(entity.getDiscriminatorValue()); } diff --git a/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/mapping/DatastoreMappingContextTests.java b/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/mapping/DatastoreMappingContextTests.java index 85cf212693..c8540b9294 100644 --- a/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/mapping/DatastoreMappingContextTests.java +++ b/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/mapping/DatastoreMappingContextTests.java @@ -25,7 +25,6 @@ import com.google.cloud.Timestamp; import org.junit.jupiter.api.Test; import org.springframework.context.ApplicationContext; -import org.springframework.data.util.ClassTypeInformation; import org.springframework.data.util.TypeInformation; /** Tests for the `DatastoreMappingContext`. */ @@ -37,7 +36,7 @@ void testApplicationContextPassing() { ApplicationContext applicationContext = mock(ApplicationContext.class); context.setApplicationContext(applicationContext); - context.createPersistentEntity(ClassTypeInformation.from(Object.class)); + context.createPersistentEntity(TypeInformation.of(Object.class)); verify(mockEntity, times(1)).setApplicationContext(applicationContext); } @@ -47,7 +46,7 @@ void testApplicationContextIsNotSet() { DatastorePersistentEntityImpl mockEntity = mock(DatastorePersistentEntityImpl.class); DatastoreMappingContext context = createDatastoreMappingContextWith(mockEntity); - context.createPersistentEntity(ClassTypeInformation.from(Object.class)); + context.createPersistentEntity(TypeInformation.of(Object.class)); verifyNoMoreInteractions(mockEntity); } diff --git a/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/mapping/DatastorePersistentEntityImplTests.java b/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/mapping/DatastorePersistentEntityImplTests.java index 2d17b21c9c..b1a20fd466 100644 --- a/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/mapping/DatastorePersistentEntityImplTests.java +++ b/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/mapping/DatastorePersistentEntityImplTests.java @@ -28,6 +28,7 @@ import org.springframework.data.mapping.PersistentPropertyAccessor; import org.springframework.data.mapping.SimplePropertyHandler; import org.springframework.data.util.ClassTypeInformation; +import org.springframework.data.util.TypeInformation; import org.springframework.expression.spel.SpelEvaluationException; /** Tests for the Datastore Persistent Entity. */ @@ -38,7 +39,7 @@ class DatastorePersistentEntityImplTests { @Test void testTableName() { DatastorePersistentEntityImpl entity = - new DatastorePersistentEntityImpl<>(ClassTypeInformation.from(TestEntity.class), null); + new DatastorePersistentEntityImpl<>(TypeInformation.of(TestEntity.class), null); assertThat(entity.kindName()).isEqualTo("custom_test_kind"); } @@ -46,7 +47,7 @@ void testTableName() { void testRawTableName() { DatastorePersistentEntityImpl entity = new DatastorePersistentEntityImpl<>( - ClassTypeInformation.from(EntityNoCustomName.class), null); + TypeInformation.of(EntityNoCustomName.class), null); assertThat(entity.kindName()).isEqualTo("entityNoCustomName"); } @@ -55,7 +56,7 @@ void testRawTableName() { void testEmptyCustomTableName() { DatastorePersistentEntityImpl entity = new DatastorePersistentEntityImpl<>( - ClassTypeInformation.from(EntityEmptyCustomName.class), null); + TypeInformation.of(EntityEmptyCustomName.class), null); assertThat(entity.kindName()).isEqualTo("entityEmptyCustomName"); } @@ -64,9 +65,9 @@ void testEmptyCustomTableName() { void testExpressionResolutionWithoutApplicationContext() { DatastorePersistentEntityImpl entity = new DatastorePersistentEntityImpl<>( - ClassTypeInformation.from(EntityWithExpression.class), null); + TypeInformation.of(EntityWithExpression.class), null); - assertThatThrownBy(() -> entity.kindName()) + assertThatThrownBy(entity::kindName) .isInstanceOf(SpelEvaluationException.class) .hasMessageContaining("Property or field 'kindPostfix' cannot be found on null"); } @@ -75,7 +76,7 @@ void testExpressionResolutionWithoutApplicationContext() { void testExpressionResolutionFromApplicationContext() { DatastorePersistentEntityImpl entity = new DatastorePersistentEntityImpl<>( - ClassTypeInformation.from(EntityWithExpression.class), null); + TypeInformation.of(EntityWithExpression.class), null); ApplicationContext applicationContext = mock(ApplicationContext.class); when(applicationContext.getBean("kindPostfix")).thenReturn("something"); @@ -103,7 +104,7 @@ void testGetIdPropertyOrFail() { DatastorePersistentEntity testEntity = new DatastoreMappingContext().getPersistentEntity(EntityWithNoId.class); - assertThatThrownBy(() -> testEntity.getIdPropertyOrFail()) + assertThatThrownBy(testEntity::getIdPropertyOrFail) .isInstanceOf(DatastoreDataException.class) .hasMessage("An ID property was required but does not exist for the type: " + "class com.google.cloud.spring.data.datastore.core.mapping." diff --git a/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/repository/query/PartTreeDatastoreQueryTests.java b/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/repository/query/PartTreeDatastoreQueryTests.java index 29d18390b4..5bd326fc47 100644 --- a/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/repository/query/PartTreeDatastoreQueryTests.java +++ b/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/repository/query/PartTreeDatastoreQueryTests.java @@ -73,7 +73,7 @@ import org.springframework.data.projection.SpelAwareProxyProjectionFactory; import org.springframework.data.repository.core.support.DefaultRepositoryMetadata; import org.springframework.data.repository.query.DefaultParameters; -import org.springframework.data.util.ClassTypeInformation; +import org.springframework.data.util.TypeInformation; import org.springframework.lang.Nullable; /** Tests for Part-Tree Datastore Query Methods. */ @@ -1062,7 +1062,7 @@ private void queryWithMockResult( if (mockOptionalNullable) { DefaultRepositoryMetadata mockMetadata = mock(DefaultRepositoryMetadata.class); doReturn(m.getReturnType()).when(mockMetadata).getReturnedDomainClass(m); - doReturn(ClassTypeInformation.fromReturnTypeOf(m)).when(mockMetadata).getReturnType(m); + doReturn(TypeInformation.fromReturnTypeOf(m)).when(mockMetadata).getReturnType(m); DatastoreQueryMethod datastoreQueryMethod = new DatastoreQueryMethod(m, mockMetadata, mock(SpelAwareProxyProjectionFactory.class)); doReturn(datastoreQueryMethod.isOptionalReturnType()) diff --git a/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/convert/ConverterAwareMappingSpannerEntityReader.java b/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/convert/ConverterAwareMappingSpannerEntityReader.java index c171bf6988..ed42f46fd4 100644 --- a/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/convert/ConverterAwareMappingSpannerEntityReader.java +++ b/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/convert/ConverterAwareMappingSpannerEntityReader.java @@ -22,8 +22,8 @@ import com.google.cloud.spring.data.spanner.core.mapping.SpannerPersistentEntity; import com.google.cloud.spring.data.spanner.core.mapping.SpannerPersistentProperty; import java.util.Set; +import org.springframework.data.mapping.InstanceCreatorMetadata; import org.springframework.data.mapping.PersistentPropertyAccessor; -import org.springframework.data.mapping.PreferredConstructor; import org.springframework.data.mapping.PropertyHandler; import org.springframework.data.mapping.model.EntityInstantiator; import org.springframework.data.mapping.model.EntityInstantiators; @@ -39,9 +39,9 @@ class ConverterAwareMappingSpannerEntityReader implements SpannerEntityReader { private final SpannerMappingContext spannerMappingContext; - private EntityInstantiators instantiators; + private final EntityInstantiators instantiators; - private SpannerReadConverter converter; + private final SpannerReadConverter converter; ConverterAwareMappingSpannerEntityReader( SpannerMappingContext spannerMappingContext, SpannerReadConverter spannerReadConverter) { @@ -75,8 +75,8 @@ public R read( StructPropertyValueProvider propertyValueProvider = new StructPropertyValueProvider(structAccessor, this.converter, this, allowMissingColumns); - PreferredConstructor persistenceConstructor = - persistentEntity.getPersistenceConstructor(); + InstanceCreatorMetadata instanceCreatorMetadata = + persistentEntity.getInstanceCreatorMetadata(); // @formatter:off ParameterValueProvider parameterValueProvider = @@ -105,7 +105,7 @@ public R read( includeColumns, readAllColumns, allowMissingColumns, - persistenceConstructor)) { + instanceCreatorMetadata)) { Object value = propertyValueProvider.getPropertyValue(spannerPersistentProperty); accessor.setProperty(spannerPersistentProperty, value); @@ -122,7 +122,7 @@ private boolean shouldSkipProperty( Set includeColumns, boolean readAllColumns, boolean allowMissingColumns, - PreferredConstructor persistenceConstructor) { + InstanceCreatorMetadata persistenceConstructor) { String columnName = spannerPersistentProperty.getColumnName(); boolean notRequiredByPartialRead = !readAllColumns && !includeColumns.contains(columnName); @@ -130,7 +130,7 @@ private boolean shouldSkipProperty( || notRequiredByPartialRead || isMissingColumn(struct, allowMissingColumns, columnName) || struct.isNull(columnName) - || persistenceConstructor.isConstructorParameter(spannerPersistentProperty); + || persistenceConstructor.isCreatorParameter(spannerPersistentProperty); } private boolean isMissingColumn( diff --git a/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerCompositeKeyProperty.java b/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerCompositeKeyProperty.java index 64178cbc23..a0c85b22a3 100644 --- a/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerCompositeKeyProperty.java +++ b/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerCompositeKeyProperty.java @@ -30,7 +30,6 @@ import org.springframework.data.mapping.Association; import org.springframework.data.mapping.PersistentEntity; import org.springframework.data.mapping.PersistentPropertyAccessor; -import org.springframework.data.util.ClassTypeInformation; import org.springframework.data.util.TypeInformation; import org.springframework.lang.Nullable; import org.springframework.util.Assert; @@ -176,7 +175,7 @@ public Class getType() { @Override public TypeInformation getTypeInformation() { - return ClassTypeInformation.from(getType()); + return TypeInformation.of(getType()); } @Nullable diff --git a/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentPropertyImpl.java b/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentPropertyImpl.java index deacabe4fb..20919d3640 100644 --- a/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentPropertyImpl.java +++ b/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentPropertyImpl.java @@ -19,6 +19,7 @@ import com.google.cloud.spanner.Type.Code; import com.google.spanner.v1.TypeCode; import java.util.List; +import java.util.Objects; import java.util.OptionalInt; import java.util.OptionalLong; import org.springframework.data.mapping.Association; @@ -42,7 +43,7 @@ public class SpannerPersistentPropertyImpl extends AnnotationBasedPersistentProperty implements SpannerPersistentProperty { - private FieldNamingStrategy fieldNamingStrategy; + private final FieldNamingStrategy fieldNamingStrategy; /** * Creates a new {@link SpannerPersistentPropertyImpl}. @@ -203,4 +204,23 @@ private String getAnnotatedColumnName() { return null; } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof SpannerPersistentPropertyImpl that)) { + return false; + } + if (!super.equals(o)) { + return false; + } + return fieldNamingStrategy.equals(that.fieldNamingStrategy); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), fieldNamingStrategy); + } } diff --git a/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/SpannerTransactionManagerTests.java b/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/SpannerTransactionManagerTests.java index c2c658d0b6..1f4786a001 100644 --- a/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/SpannerTransactionManagerTests.java +++ b/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/SpannerTransactionManagerTests.java @@ -184,9 +184,9 @@ void testDoCommitRollbackExceptions() { tx.transactionManager = transactionManager; assertThatThrownBy(() -> manager.doCommit(status)) - .isInstanceOf(UnexpectedRollbackException.class) - .hasMessage("Transaction Got Rolled Back; " - + "nested exception is com.google.cloud.spanner.AbortedException"); + .isInstanceOf(UnexpectedRollbackException.class) + .hasMessage("Transaction Got Rolled Back") + .hasCauseExactlyInstanceOf(AbortedException.class); } @Test @@ -202,9 +202,9 @@ void testDoCommitDupeException() { tx.transactionManager = transactionManager; assertThatThrownBy(() -> manager.doCommit(status)) - .isInstanceOf(DuplicateKeyException.class) - .hasMessage("ALREADY_EXISTS; nested exception is " - + "com.google.cloud.spanner.SpannerException: ALREADY_EXISTS: this is from a test"); + .isInstanceOf(DuplicateKeyException.class) + .hasMessage("ALREADY_EXISTS") + .hasStackTraceContaining("ALREADY_EXISTS: this is from a test"); } @Test diff --git a/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/convert/ConverterAwareMappingSpannerEntityReaderTests.java b/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/convert/ConverterAwareMappingSpannerEntityReaderTests.java index cd21907ad7..0e6b39a5fa 100644 --- a/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/convert/ConverterAwareMappingSpannerEntityReaderTests.java +++ b/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/convert/ConverterAwareMappingSpannerEntityReaderTests.java @@ -41,6 +41,7 @@ import com.google.cloud.spring.data.spanner.core.mapping.SpannerMappingContext; import com.google.gson.Gson; import java.util.Arrays; +import java.util.List; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.core.convert.ConversionFailedException; @@ -72,7 +73,7 @@ void readNestedStructTest() { .to(Value.string("key1")) .set("innerTestEntities") .toStructArray( - Type.struct(StructField.of("value", Type.string())), Arrays.asList(innerStruct)) + Type.struct(StructField.of("value", Type.string())), List.of(innerStruct)) .build(); OuterTestEntity result = @@ -143,18 +144,18 @@ void readSingularArrayMismatchTest() { .to(Value.string("key1")) .set("innerLengths") .toStructArray( - Type.struct(StructField.of("string_col", Type.string())), Arrays.asList(colStruct)) + Type.struct(StructField.of("string_col", Type.string())), List.of(colStruct)) .build(); ConverterAwareMappingSpannerEntityReader testReader = new ConverterAwareMappingSpannerEntityReader(new SpannerMappingContext(), new SpannerReadConverter( - Arrays.asList( - new Converter() { - @Nullable - @Override - public Integer convert(Struct source) { - return source.getString("string_col").length(); - } - }))); + List.of( + new Converter() { + @Nullable + @Override + public Integer convert(Struct source) { + return source.getString("string_col").length(); + } + }))); assertThatThrownBy(() -> testReader.read(OuterTestEntityFlatFaulty.class, rowStruct)) .isInstanceOf(SpannerDataException.class) .hasMessage("The value in column with name innerLengths could not be converted to the corresponding" @@ -178,7 +179,7 @@ void readConvertedNestedStructTest() { new ConverterAwareMappingSpannerEntityReader( new SpannerMappingContext(), new SpannerReadConverter( - Arrays.asList( + List.of( new Converter() { @Nullable @Override @@ -255,10 +256,11 @@ void readUnconvertableValueTest() { assertThatThrownBy(() -> this.spannerEntityReader.read(TestEntity.class, struct)) - .isInstanceOf(ConversionFailedException.class) - .hasMessage("Failed to convert from type [java.lang.String] to type " - + "[java.lang.Double] for value 'UNCONVERTABLE VALUE'; nested exception is " - + "java.lang.NumberFormatException: For input string: \"UNCONVERTABLEVALUE\""); + .isInstanceOf(ConversionFailedException.class) + .hasMessage("Failed to convert from type [java.lang.String] to type " + + "[java.lang.Double] for value 'UNCONVERTABLE VALUE'") + .hasStackTraceContaining( + "java.lang.NumberFormatException: For input string: \"UNCONVERTABLEVALUE\""); } @Test @@ -289,7 +291,7 @@ void readNestedStructWithConstructor() { .to(Value.string("key1")) .set("innerTestEntities") .toStructArray( - Type.struct(StructField.of("value", Type.string())), Arrays.asList(innerStruct)) + Type.struct(StructField.of("value", Type.string())), List.of(innerStruct)) .build(); TestEntities.OuterTestEntityWithConstructor result = @@ -327,7 +329,7 @@ void ensureConstructorArgsAreReadOnce() { Struct row = mock(Struct.class); when(row.getString("id")).thenReturn("1234"); when(row.getType()) - .thenReturn(Type.struct(Arrays.asList(Type.StructField.of("id", Type.string())))); + .thenReturn(Type.struct(List.of(StructField.of("id", Type.string())))); when(row.getColumnType("id")).thenReturn(Type.string()); TestEntities.SimpleConstructorTester result = @@ -362,7 +364,7 @@ void zeroArgsListShouldThrowError() { Struct struct = Struct.newBuilder() .set("zeroArgsListOfObjects") - .to(Value.stringArray(Arrays.asList("hello", "world"))) + .to(Value.stringArray(List.of("hello", "world"))) .build(); assertThatThrownBy(() -> this.spannerEntityReader.read(TestEntities.TestEntityWithListWithZeroTypeArgs.class, struct)) diff --git a/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerKeyPropertyTests.java b/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerKeyPropertyTests.java index a27d47df40..8d94ebe2dd 100644 --- a/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerKeyPropertyTests.java +++ b/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerKeyPropertyTests.java @@ -24,7 +24,7 @@ import java.lang.annotation.Annotation; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.springframework.data.util.ClassTypeInformation; +import org.springframework.data.util.TypeInformation; /** Tests for the Spanner custom key property. */ class SpannerKeyPropertyTests { @@ -91,7 +91,7 @@ void getTypeTest() { @Test void getTypeInformationTest() { assertThat(this.spannerKeyProperty.getTypeInformation()) - .isEqualTo(ClassTypeInformation.from(Key.class)); + .isEqualTo(TypeInformation.of(Key.class)); } @Test diff --git a/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerMappingContextTests.java b/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerMappingContextTests.java index 703c145b85..5798eb9432 100644 --- a/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerMappingContextTests.java +++ b/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerMappingContextTests.java @@ -28,7 +28,6 @@ import org.springframework.context.ApplicationContext; import org.springframework.data.mapping.model.FieldNamingStrategy; import org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy; -import org.springframework.data.util.ClassTypeInformation; import org.springframework.data.util.TypeInformation; import org.springframework.test.context.junit.jupiter.SpringExtension; @@ -60,7 +59,7 @@ void testApplicationContextPassing() { ApplicationContext applicationContext = mock(ApplicationContext.class); context.setApplicationContext(applicationContext); - context.createPersistentEntity(ClassTypeInformation.from(Object.class)); + context.createPersistentEntity(TypeInformation.of(Object.class)); verify(mockEntity, times(1)).setApplicationContext(applicationContext); } @@ -70,7 +69,7 @@ void testApplicationContextIsNotSet() { SpannerPersistentEntityImpl mockEntity = mock(SpannerPersistentEntityImpl.class); SpannerMappingContext context = createSpannerMappingContextWith(mockEntity); - context.createPersistentEntity(ClassTypeInformation.from(Object.class)); + context.createPersistentEntity(TypeInformation.of(Object.class)); verifyNoMoreInteractions(mockEntity); } diff --git a/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentEntityImplTests.java b/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentEntityImplTests.java index f7278b309d..207a39f784 100644 --- a/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentEntityImplTests.java +++ b/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentEntityImplTests.java @@ -36,7 +36,7 @@ import org.springframework.data.mapping.PersistentPropertyAccessor; import org.springframework.data.mapping.PropertyHandler; import org.springframework.data.mapping.SimplePropertyHandler; -import org.springframework.data.util.ClassTypeInformation; +import org.springframework.data.util.TypeInformation; /** Tests for the Spanner persistent entity. */ class SpannerPersistentEntityImplTests { @@ -54,7 +54,7 @@ class SpannerPersistentEntityImplTests { @Test void testTableName() { SpannerPersistentEntityImpl entity = - new SpannerPersistentEntityImpl<>(ClassTypeInformation.from(TestEntity.class), + new SpannerPersistentEntityImpl<>(TypeInformation.of(TestEntity.class), this.spannerMappingContext, this.spannerEntityProcessor); assertThat(entity.tableName()).isEqualTo("custom_test_table"); @@ -63,7 +63,7 @@ void testTableName() { @Test void testRawTableName() { SpannerPersistentEntityImpl entity = - new SpannerPersistentEntityImpl<>(ClassTypeInformation.from(EntityNoCustomName.class), + new SpannerPersistentEntityImpl<>(TypeInformation.of(EntityNoCustomName.class), this.spannerMappingContext, this.spannerEntityProcessor); assertThat(entity.tableName()).isEqualTo("entityNoCustomName"); @@ -72,7 +72,7 @@ void testRawTableName() { @Test void testEmptyCustomTableName() { SpannerPersistentEntityImpl entity = - new SpannerPersistentEntityImpl<>(ClassTypeInformation.from(EntityEmptyCustomName.class), + new SpannerPersistentEntityImpl<>(TypeInformation.of(EntityEmptyCustomName.class), this.spannerMappingContext, this.spannerEntityProcessor); assertThat(entity.tableName()).isEqualTo("entityEmptyCustomName"); @@ -88,17 +88,18 @@ void testColumns() { void testExpressionResolutionWithoutApplicationContext() { SpannerPersistentEntityImpl entity = - new SpannerPersistentEntityImpl<>(ClassTypeInformation.from(EntityWithExpression.class), + new SpannerPersistentEntityImpl<>(TypeInformation.of(EntityWithExpression.class), this.spannerMappingContext, this.spannerEntityProcessor); - assertThatThrownBy(() -> entity.tableName()) - .isInstanceOf(SpannerDataException.class) - .hasMessage("Error getting table name for EntityWithExpression; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'tablePostfix' cannot be found on null"); + assertThatThrownBy(entity::tableName) + .isInstanceOf(SpannerDataException.class) + .hasMessage("Error getting table name for EntityWithExpression") + .hasStackTraceContaining("EL1007E: Property or field 'tablePostfix' cannot be found on null"); } @Test void testExpressionResolutionFromApplicationContext() { SpannerPersistentEntityImpl entity = - new SpannerPersistentEntityImpl<>(ClassTypeInformation.from(EntityWithExpression.class), + new SpannerPersistentEntityImpl<>(TypeInformation.of(EntityWithExpression.class), this.spannerMappingContext, this.spannerEntityProcessor); ApplicationContext applicationContext = mock(ApplicationContext.class); @@ -215,21 +216,21 @@ void testIgnoredProperty() { void testInvalidTableName() { SpannerPersistentEntityImpl entity = - new SpannerPersistentEntityImpl<>(ClassTypeInformation.from(EntityBadName.class), + new SpannerPersistentEntityImpl<>(TypeInformation.of(EntityBadName.class), this.spannerMappingContext, this.spannerEntityProcessor); - assertThatThrownBy(() -> entity.tableName()) - .isInstanceOf(SpannerDataException.class) - .hasMessage("Error getting table name for EntityBadName; nested exception is com.google.cloud.spring.data.spanner.core.mapping.SpannerDataException: Only" - + " letters, numbers, and underscores are allowed in table names: ;DROP TABLE" - + " your_table;"); + assertThatThrownBy(entity::tableName) + .isInstanceOf(SpannerDataException.class) + .hasMessage("Error getting table name for EntityBadName") + .hasStackTraceContaining( + "Only letters, numbers, and underscores are allowed in table names: ;DROP TABLE your_table;"); } @Test void testSpelInvalidName() { SpannerPersistentEntityImpl entity = - new SpannerPersistentEntityImpl<>(ClassTypeInformation.from(EntityWithExpression.class), + new SpannerPersistentEntityImpl<>(TypeInformation.of(EntityWithExpression.class), this.spannerMappingContext, this.spannerEntityProcessor); ApplicationContext applicationContext = mock(ApplicationContext.class); @@ -238,12 +239,12 @@ void testSpelInvalidName() { entity.setApplicationContext(applicationContext); - assertThatThrownBy(() -> entity.tableName()) - .isInstanceOf(SpannerDataException.class) - .hasMessage("Error getting table name for EntityWithExpression; nested exception is " - + "com.google.cloud.spring.data.spanner.core.mapping.SpannerDataException: " - + "Only letters, numbers, and underscores are allowed in table names: " - + "table_; DROP TABLE your_table;"); + assertThatThrownBy(entity::tableName) + .isInstanceOf(SpannerDataException.class) + .hasMessage("Error getting table name for EntityWithExpression") + .hasStackTraceContaining( + "Only letters, numbers, and underscores are allowed in table names: " + + "table_; DROP TABLE your_table;"); } From 32910e3147af89db833982bd58a347cc37e32af4 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 3 Nov 2022 10:36:38 -0400 Subject: [PATCH 037/179] fix broken unit test --- .../firestore/FirestoreTemplateTests.java | 42 +++++++++---------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/spring-cloud-gcp-data-firestore/src/test/java/com/google/cloud/spring/data/firestore/FirestoreTemplateTests.java b/spring-cloud-gcp-data-firestore/src/test/java/com/google/cloud/spring/data/firestore/FirestoreTemplateTests.java index 448b653737..4e388b01ca 100644 --- a/spring-cloud-gcp-data-firestore/src/test/java/com/google/cloud/spring/data/firestore/FirestoreTemplateTests.java +++ b/spring-cloud-gcp-data-firestore/src/test/java/com/google/cloud/spring/data/firestore/FirestoreTemplateTests.java @@ -69,7 +69,7 @@ void setup() { this.firestoreTemplate = new FirestoreTemplate( this.firestoreStub, - this.parent, + parent, new FirestoreDefaultClassMapper(mappingContext), mappingContext); } @@ -91,7 +91,7 @@ void findAllTest() { .build(); RunQueryRequest request = RunQueryRequest.newBuilder() - .setParent(this.parent) + .setParent(parent) .setStructuredQuery(structuredQuery) .build(); @@ -311,7 +311,7 @@ void findByIdTest() { .verifyComplete(); GetDocumentRequest request = - GetDocumentRequest.newBuilder().setName(this.parent + "/testEntities/" + "e1").build(); + GetDocumentRequest.newBuilder().setName(parent + "/testEntities/" + "e1").build(); verify(this.firestoreStub, times(1)).getDocument(eq(request), any()); } @@ -332,12 +332,12 @@ void findByIdErrorTest() { .expectErrorMatches( e -> e instanceof FirestoreDataException - && e.getMessage().contains("Firestore error") + && e.getCause().getMessage().contains("Firestore error") && e.getMessage().contains("Error while reading entries by id")) .verify(); GetDocumentRequest request = - GetDocumentRequest.newBuilder().setName(this.parent + "/testEntities/" + "e1").build(); + GetDocumentRequest.newBuilder().setName(parent + "/testEntities/" + "e1").build(); verify(this.firestoreStub, times(1)).getDocument(eq(request), any()); } @@ -360,7 +360,7 @@ void findByIdNotFoundTest() { .verifyComplete(); GetDocumentRequest request = - GetDocumentRequest.newBuilder().setName(this.parent + "/testEntities/" + "e1").build(); + GetDocumentRequest.newBuilder().setName(parent + "/testEntities/" + "e1").build(); verify(this.firestoreStub, times(1)).getDocument(eq(request), any()); } @@ -368,13 +368,13 @@ void findByIdNotFoundTest() { @Test void findAllByIdTest() { GetDocumentRequest request1 = - GetDocumentRequest.newBuilder().setName(this.parent + "/testEntities/e1").build(); + GetDocumentRequest.newBuilder().setName(parent + "/testEntities/e1").build(); GetDocumentRequest request2 = - GetDocumentRequest.newBuilder().setName(this.parent + "/testEntities/e2").build(); + GetDocumentRequest.newBuilder().setName(parent + "/testEntities/e2").build(); GetDocumentRequest request3 = - GetDocumentRequest.newBuilder().setName(this.parent + "/testEntities/e3").build(); + GetDocumentRequest.newBuilder().setName(parent + "/testEntities/e3").build(); doAnswer( invocation -> { @@ -443,7 +443,7 @@ void countTest() { .build(); RunQueryRequest request = RunQueryRequest.newBuilder() - .setParent(this.parent) + .setParent(parent) .setStructuredQuery(structuredQuery) .build(); @@ -479,7 +479,7 @@ void countWithQueryTest() { RunQueryRequest request = RunQueryRequest.newBuilder() - .setParent(this.parent) + .setParent(parent) .setStructuredQuery(expectedBuilder) .build(); @@ -507,7 +507,7 @@ private void addWhere(StructuredQuery.Builder builder) { void existsByIdTest() { GetDocumentRequest request = GetDocumentRequest.newBuilder() - .setName(this.parent + "/testEntities/" + "e1") + .setName(parent + "/testEntities/" + "e1") .setMask(DocumentMask.newBuilder().addFieldPaths("__name__").build()) .build(); @@ -535,7 +535,7 @@ void existsByIdTest() { void existsByIdNotFoundTest() { GetDocumentRequest request = GetDocumentRequest.newBuilder() - .setName(this.parent + "/testEntities/" + "e1") + .setName(parent + "/testEntities/" + "e1") .setMask(DocumentMask.newBuilder().addFieldPaths("__name__").build()) .build(); @@ -579,7 +579,7 @@ void withParentTest_entityReference() { GetDocumentRequest request = GetDocumentRequest.newBuilder() - .setName(this.parent + "/testEntities/parent/testEntities/child") + .setName(parent + "/testEntities/parent/testEntities/child") .build(); verify(this.firestoreStub, times(1)).getDocument(eq(request), any()); @@ -605,7 +605,7 @@ void withParentTest_idClassReference() { GetDocumentRequest request = GetDocumentRequest.newBuilder() - .setName(this.parent + "/testEntities/parent/testEntities/child") + .setName(parent + "/testEntities/parent/testEntities/child") .build(); verify(this.firestoreStub, times(1)).getDocument(eq(request), any()); @@ -704,7 +704,7 @@ public int hashCode() { } @Document(collectionName = "testEntities") - class TestEntityUpdateTimeVersion { + static class TestEntityUpdateTimeVersion { @DocumentId public String id; @UpdateTime(version = true) @@ -724,12 +724,10 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof TestEntityUpdateTimeVersion)) { + if (!(o instanceof TestEntityUpdateTimeVersion that)) { return false; } - TestEntityUpdateTimeVersion that = (TestEntityUpdateTimeVersion) o; - if (!Objects.equals(id, that.id)) { return false; } @@ -745,7 +743,7 @@ public int hashCode() { } @Document(collectionName = "testEntities") - class TestEntityUpdateTime { + static class TestEntityUpdateTime { @DocumentId public String id; @UpdateTime public Timestamp updateTime; @@ -764,12 +762,10 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof TestEntityUpdateTime)) { + if (!(o instanceof TestEntityUpdateTime that)) { return false; } - TestEntityUpdateTime that = (TestEntityUpdateTime) o; - if (!Objects.equals(id, that.id)) { return false; } From 9b052badd8238f1f9f09d8b4b1fa392c063c2a61 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 3 Nov 2022 11:02:02 -0400 Subject: [PATCH 038/179] remove usage of `ClassTypeInformation.class` --- .../mapping/FirestorePersistentEntityImplTests.java | 6 +++--- .../mapping/FirestorePersistentPropertyImplTest.java | 4 ++-- .../repository/query/SpannerQueryMethodTests.java | 9 ++++----- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/spring-cloud-gcp-data-firestore/src/test/java/com/google/cloud/spring/data/firestore/mapping/FirestorePersistentEntityImplTests.java b/spring-cloud-gcp-data-firestore/src/test/java/com/google/cloud/spring/data/firestore/mapping/FirestorePersistentEntityImplTests.java index 53e3daef4c..1ea8d1b49f 100644 --- a/spring-cloud-gcp-data-firestore/src/test/java/com/google/cloud/spring/data/firestore/mapping/FirestorePersistentEntityImplTests.java +++ b/spring-cloud-gcp-data-firestore/src/test/java/com/google/cloud/spring/data/firestore/mapping/FirestorePersistentEntityImplTests.java @@ -20,7 +20,7 @@ import com.google.cloud.spring.data.firestore.Document; import org.junit.jupiter.api.Test; -import org.springframework.data.util.ClassTypeInformation; +import org.springframework.data.util.TypeInformation; /** Tests for {@link FirestorePersistentEntityImpl}. */ class FirestorePersistentEntityImplTests { @@ -28,14 +28,14 @@ class FirestorePersistentEntityImplTests { @Test void testSetCollectionName() { FirestorePersistentEntity firestorePersistentEntity = - new FirestorePersistentEntityImpl<>(ClassTypeInformation.from(Student.class)); + new FirestorePersistentEntityImpl<>(TypeInformation.of(Student.class)); assertThat(firestorePersistentEntity.collectionName()).isEqualTo("student"); } @Test void testInferCollectionName() { FirestorePersistentEntity firestorePersistentEntity = - new FirestorePersistentEntityImpl<>(ClassTypeInformation.from(Employee.class)); + new FirestorePersistentEntityImpl<>(TypeInformation.of(Employee.class)); assertThat(firestorePersistentEntity.collectionName()).isEqualTo("employee_table"); } diff --git a/spring-cloud-gcp-data-firestore/src/test/java/com/google/cloud/spring/data/firestore/mapping/FirestorePersistentPropertyImplTest.java b/spring-cloud-gcp-data-firestore/src/test/java/com/google/cloud/spring/data/firestore/mapping/FirestorePersistentPropertyImplTest.java index 9de04f9dde..e45f52b307 100644 --- a/spring-cloud-gcp-data-firestore/src/test/java/com/google/cloud/spring/data/firestore/mapping/FirestorePersistentPropertyImplTest.java +++ b/spring-cloud-gcp-data-firestore/src/test/java/com/google/cloud/spring/data/firestore/mapping/FirestorePersistentPropertyImplTest.java @@ -28,7 +28,7 @@ import org.springframework.data.mapping.PersistentEntity; import org.springframework.data.mapping.model.Property; import org.springframework.data.mapping.model.SimpleTypeHolder; -import org.springframework.data.util.ClassTypeInformation; +import org.springframework.data.util.TypeInformation; import org.springframework.test.context.junit.jupiter.SpringExtension; /** Tests for {@link FirestorePersistentPropertyImpl}. */ @@ -46,7 +46,7 @@ void testGetFieldName_isIdProperty() throws NoSuchFieldException { when(mockProperty.getName()).thenReturn("id"); when(mockProperty.getField()).thenReturn(Optional.of(TestEntity.class.getField("id"))); when(mockPersistentEntity.getTypeInformation()) - .thenReturn(ClassTypeInformation.from(TestEntity.class)); + .thenReturn(TypeInformation.of(TestEntity.class)); when(mockPersistentEntity.getType()).thenReturn(TestEntity.class); FirestorePersistentPropertyImpl firestorePersistentProperty = diff --git a/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/repository/query/SpannerQueryMethodTests.java b/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/repository/query/SpannerQueryMethodTests.java index a970e63f08..5f256691b4 100644 --- a/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/repository/query/SpannerQueryMethodTests.java +++ b/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/repository/query/SpannerQueryMethodTests.java @@ -19,15 +19,15 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; import java.lang.reflect.Method; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.data.projection.ProjectionFactory; import org.springframework.data.repository.core.RepositoryMetadata; -import org.springframework.data.util.ClassTypeInformation; +import org.springframework.data.util.TypeInformation; class SpannerQueryMethodTests { @@ -38,9 +38,8 @@ class SpannerQueryMethodTests { void setUp() throws Exception { this.mockMetadata = mock(RepositoryMetadata.class); this.mockProjectionFactory = mock(ProjectionFactory.class); - when(mockMetadata.getReturnType(any())) - .thenReturn( - ClassTypeInformation.fromReturnTypeOf(Example.class.getMethod("someAnnotatedMethod"))); + doReturn(TypeInformation.fromReturnTypeOf(Example.class.getMethod("someAnnotatedMethod"))) + .when(mockMetadata).getReturnType(any()); doAnswer(a -> String.class).when(mockMetadata).getReturnedDomainClass(any()); } From a17839f5b940514aa60a17a7692b9bb661958f44 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 3 Nov 2022 11:57:00 -0400 Subject: [PATCH 039/179] add generics so that unit tests can pass --- .../cloud/spring/autoconfigure/datastore/TestRepository.java | 2 +- .../cloud/spring/autoconfigure/spanner/TestRepository.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/datastore/TestRepository.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/datastore/TestRepository.java index 0607e35984..ac873e3515 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/datastore/TestRepository.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/datastore/TestRepository.java @@ -19,4 +19,4 @@ import com.google.cloud.spring.data.datastore.repository.DatastoreRepository; /** A repository for testing instantiation. */ -public interface TestRepository extends DatastoreRepository {} +public interface TestRepository extends DatastoreRepository {} diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/spanner/TestRepository.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/spanner/TestRepository.java index 8666f59f15..47ee3929d2 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/spanner/TestRepository.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/spanner/TestRepository.java @@ -21,4 +21,4 @@ /** A repository for testing instantiation. */ @Repository -public interface TestRepository extends SpannerRepository {} +public interface TestRepository extends SpannerRepository {} From 4a9df3e401a1cbb372f533712cb06d7741ed303a Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 3 Nov 2022 15:08:49 -0400 Subject: [PATCH 040/179] change name of an overridden method: `getPersistentEntityTypeInformation` --- .../core/mapping/SpannerPersistentPropertyImpl.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentPropertyImpl.java b/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentPropertyImpl.java index 20919d3640..8de60840ab 100644 --- a/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentPropertyImpl.java +++ b/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentPropertyImpl.java @@ -30,7 +30,9 @@ import org.springframework.data.mapping.model.Property; import org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy; import org.springframework.data.mapping.model.SimpleTypeHolder; +import org.springframework.data.util.StreamUtils; import org.springframework.data.util.TypeInformation; +import org.springframework.lang.NonNull; import org.springframework.util.StringUtils; /** @@ -65,7 +67,17 @@ public class SpannerPersistentPropertyImpl : PropertyNameFieldNamingStrategy.INSTANCE; } + /** Only provides types that are also annotated with {@link Table}. */ @Override + @NonNull + public Iterable> getPersistentEntityTypeInformation() { + return StreamUtils.createStreamFromIterator(super.getPersistentEntityTypeInformation().iterator()) + .filter(typeInfo -> typeInfo.getType().isAnnotationPresent(Table.class)) + .toList(); + } + + @Override + @NonNull protected Association createAssociation() { return new Association<>(this, null); } From 7f30232c20a6f5e6b074592cce2fcd3ee97d768f Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 3 Nov 2022 15:09:49 -0400 Subject: [PATCH 041/179] fix broken unit test --- ...nverterAwareMappingSpannerEntityReaderTests.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/convert/ConverterAwareMappingSpannerEntityReaderTests.java b/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/convert/ConverterAwareMappingSpannerEntityReaderTests.java index 0e6b39a5fa..c1853127ab 100644 --- a/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/convert/ConverterAwareMappingSpannerEntityReaderTests.java +++ b/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/core/convert/ConverterAwareMappingSpannerEntityReaderTests.java @@ -17,6 +17,7 @@ package com.google.cloud.spring.data.spanner.core.convert; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatNoException; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; @@ -359,18 +360,18 @@ void testPartialConstructorWithNotEnoughArgs() { } @Test - void zeroArgsListShouldThrowError() { + void zeroArgsListShouldNotThrowError() { Struct struct = Struct.newBuilder() .set("zeroArgsListOfObjects") .to(Value.stringArray(List.of("hello", "world"))) .build(); - - assertThatThrownBy(() -> this.spannerEntityReader.read(TestEntities.TestEntityWithListWithZeroTypeArgs.class, struct)) - .isInstanceOf(SpannerDataException.class) - .hasMessage("in field 'zeroArgsListOfObjects': Unsupported number of type parameters found: 0 Only" - + " collections of exactly 1 type parameter are supported."); + // Starting from Spring 3.0, Collection types without generics can be resolved to type with wildcard + // generics (i.e., "?"). For example, "zeroArgsListOfObjects" will be resolved to List, rather + // than List. + assertThatNoException() + .isThrownBy(() -> this.spannerEntityReader.read(TestEntities.TestEntityWithListWithZeroTypeArgs.class, struct)); } @Test From 79a2727798a1ade1926b2e9f475e45e8c8b6a1f3 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 3 Nov 2022 15:23:17 -0400 Subject: [PATCH 042/179] remove spring native support module --- pom.xml | 1 - spring-cloud-gcp-native-support/pom.xml | 51 --------- .../FirestoreDocumentComponentProcessor.java | 57 ---------- .../firestore/FirestoreNativeConfig.java | 59 ----------- ...FirestoreRepositoryComponentProcessor.java | 33 ------ ...gframework.nativex.type.ComponentProcessor | 2 - ...framework.nativex.type.NativeConfiguration | 1 - .../nativex/firestore/NativeSupportTest.java | 100 ------------------ .../nativex/firestore/TestDocument.java | 37 ------- .../firestore/TestDocumentRepository.java | 26 ----- 10 files changed, 367 deletions(-) delete mode 100644 spring-cloud-gcp-native-support/pom.xml delete mode 100644 spring-cloud-gcp-native-support/src/main/java/com/google/cloud/spring/nativex/firestore/FirestoreDocumentComponentProcessor.java delete mode 100644 spring-cloud-gcp-native-support/src/main/java/com/google/cloud/spring/nativex/firestore/FirestoreNativeConfig.java delete mode 100644 spring-cloud-gcp-native-support/src/main/java/com/google/cloud/spring/nativex/firestore/FirestoreRepositoryComponentProcessor.java delete mode 100644 spring-cloud-gcp-native-support/src/main/resources/META-INF/services/org.springframework.nativex.type.ComponentProcessor delete mode 100644 spring-cloud-gcp-native-support/src/main/resources/META-INF/services/org.springframework.nativex.type.NativeConfiguration delete mode 100644 spring-cloud-gcp-native-support/src/test/java/com/google/cloud/spring/nativex/firestore/NativeSupportTest.java delete mode 100644 spring-cloud-gcp-native-support/src/test/java/com/google/cloud/spring/nativex/firestore/TestDocument.java delete mode 100644 spring-cloud-gcp-native-support/src/test/java/com/google/cloud/spring/nativex/firestore/TestDocumentRepository.java diff --git a/pom.xml b/pom.xml index 3c94e6bb1b..59877a7110 100644 --- a/pom.xml +++ b/pom.xml @@ -361,7 +361,6 @@ spring-cloud-gcp-security-firebase spring-cloud-gcp-vision spring-cloud-gcp-kms - spring-cloud-gcp-native-support generated diff --git a/spring-cloud-gcp-native-support/pom.xml b/spring-cloud-gcp-native-support/pom.xml deleted file mode 100644 index bf680716a8..0000000000 --- a/spring-cloud-gcp-native-support/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - spring-cloud-gcp - com.google.cloud - 3.5.0-SNAPSHOT - - 4.0.0 - - spring-cloud-gcp-native-support - - - - org.springframework.experimental - spring-native-configuration - - - - - com.google.cloud - spring-cloud-gcp-autoconfigure - true - - - com.google.cloud - spring-cloud-gcp-data-firestore - true - - - - org.projectlombok - lombok - 1.18.24 - true - test - - - - - - spring-releases - Spring Releases - https://repo.spring.io/release - - false - - - - diff --git a/spring-cloud-gcp-native-support/src/main/java/com/google/cloud/spring/nativex/firestore/FirestoreDocumentComponentProcessor.java b/spring-cloud-gcp-native-support/src/main/java/com/google/cloud/spring/nativex/firestore/FirestoreDocumentComponentProcessor.java deleted file mode 100644 index 6fc8fc5a2f..0000000000 --- a/spring-cloud-gcp-native-support/src/main/java/com/google/cloud/spring/nativex/firestore/FirestoreDocumentComponentProcessor.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2017-2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.spring.nativex.firestore; - -import java.util.List; -import org.springframework.nativex.type.ComponentProcessor; -import org.springframework.nativex.type.NativeContext; -import org.springframework.nativex.type.Type; -import org.springframework.nativex.type.TypeProcessor; - -/** - * Native Component processor adding reflection support for classes annotated with {@link - * com.google.cloud.spring.data.firestore.Document}. These classes will be found by spring aot if - * spring-context-indexer was used to index such classes. - * - * @see JpaComponentProcessor - */ -public class FirestoreDocumentComponentProcessor implements ComponentProcessor { - - private static final String FIRESTORE_DOCUMENT_FQN = - "com.google.cloud.spring.data.firestore.Document"; - - private final TypeProcessor typeProcessor = - TypeProcessor.namedProcessor("FirestoreDocumentComponentProcessor"); - - @Override - public boolean handle( - NativeContext imageContext, String componentType, List classifiers) { - if (classifiers.contains(FIRESTORE_DOCUMENT_FQN)) { - return true; - } - Type type = imageContext.getTypeSystem().resolveName(componentType); - return type.getAnnotations().stream() - .anyMatch(tag -> tag.getDottedName().equals(FIRESTORE_DOCUMENT_FQN)); - } - - @Override - public void process(NativeContext imageContext, String componentType, List classifiers) { - Type domainType = imageContext.getTypeSystem().resolveName(componentType); - typeProcessor.use(imageContext).toProcessType(domainType); - } -} diff --git a/spring-cloud-gcp-native-support/src/main/java/com/google/cloud/spring/nativex/firestore/FirestoreNativeConfig.java b/spring-cloud-gcp-native-support/src/main/java/com/google/cloud/spring/nativex/firestore/FirestoreNativeConfig.java deleted file mode 100644 index ed9b325731..0000000000 --- a/spring-cloud-gcp-native-support/src/main/java/com/google/cloud/spring/nativex/firestore/FirestoreNativeConfig.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2017-2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.spring.nativex.firestore; - -import com.google.cloud.spring.autoconfigure.datastore.GcpDatastoreEmulatorAutoConfiguration; -import com.google.cloud.spring.autoconfigure.firestore.FirestoreRepositoriesAutoConfiguration; -import com.google.cloud.spring.data.firestore.SimpleFirestoreReactiveRepository; -import com.google.cloud.spring.data.firestore.repository.support.FirestoreRepositoryFactoryBean; -import org.springframework.nativex.hint.AccessBits; -import org.springframework.nativex.hint.JdkProxyHint; -import org.springframework.nativex.hint.NativeHint; -import org.springframework.nativex.hint.TypeHint; -import org.springframework.nativex.type.NativeConfiguration; - -/** - * Native hints for {@link FirestoreRepositoriesAutoConfiguration}. Inspired by - * org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesHints - * - * @see JpaRepositoriesHints - */ -@NativeHint( - trigger = FirestoreRepositoriesAutoConfiguration.class, - types = - @TypeHint( - types = { - FirestoreRepositoryFactoryBean.class, - SimpleFirestoreReactiveRepository.class, - GcpDatastoreEmulatorAutoConfiguration.class - }, - typeNames = {"com.google.cloud.spring.data.firestore.mapping.FirestoreMappingContext"}, - access = - AccessBits.CLASS - | AccessBits.DECLARED_METHODS - | AccessBits.DECLARED_CONSTRUCTORS - | AccessBits.RESOURCE), - jdkProxies = - @JdkProxyHint( - typeNames = { - "com.google.cloud.spring.data.firestore.FirestoreReactiveRepository", - "org.springframework.aop.SpringProxy", - "org.springframework.aop.framework.Advised", - "org.springframework.core.DecoratingProxy" - })) -public class FirestoreNativeConfig implements NativeConfiguration {} diff --git a/spring-cloud-gcp-native-support/src/main/java/com/google/cloud/spring/nativex/firestore/FirestoreRepositoryComponentProcessor.java b/spring-cloud-gcp-native-support/src/main/java/com/google/cloud/spring/nativex/firestore/FirestoreRepositoryComponentProcessor.java deleted file mode 100644 index db11871c51..0000000000 --- a/spring-cloud-gcp-native-support/src/main/java/com/google/cloud/spring/nativex/firestore/FirestoreRepositoryComponentProcessor.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2017-2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.spring.nativex.firestore; - -import java.util.Collections; -import java.util.Set; -import org.springframework.data.SpringDataComponentProcessor; - -/** - * Extend {@link SpringDataComponentProcessor} to add required native support for Firestore - * Repositories. - */ -public class FirestoreRepositoryComponentProcessor extends SpringDataComponentProcessor { - @Override - protected Set storeSpecificRepositoryDeclarationNames() { - return Collections.singleton( - "com.google.cloud.spring.data.firestore.FirestoreReactiveRepository"); - } -} diff --git a/spring-cloud-gcp-native-support/src/main/resources/META-INF/services/org.springframework.nativex.type.ComponentProcessor b/spring-cloud-gcp-native-support/src/main/resources/META-INF/services/org.springframework.nativex.type.ComponentProcessor deleted file mode 100644 index 0a232b3b56..0000000000 --- a/spring-cloud-gcp-native-support/src/main/resources/META-INF/services/org.springframework.nativex.type.ComponentProcessor +++ /dev/null @@ -1,2 +0,0 @@ -com.google.cloud.spring.nativex.firestore.FirestoreDocumentComponentProcessor -com.google.cloud.spring.nativex.firestore.FirestoreRepositoryComponentProcessor diff --git a/spring-cloud-gcp-native-support/src/main/resources/META-INF/services/org.springframework.nativex.type.NativeConfiguration b/spring-cloud-gcp-native-support/src/main/resources/META-INF/services/org.springframework.nativex.type.NativeConfiguration deleted file mode 100644 index 300920bcc6..0000000000 --- a/spring-cloud-gcp-native-support/src/main/resources/META-INF/services/org.springframework.nativex.type.NativeConfiguration +++ /dev/null @@ -1 +0,0 @@ -com.google.cloud.spring.nativex.firestore.FirestoreNativeConfig diff --git a/spring-cloud-gcp-native-support/src/test/java/com/google/cloud/spring/nativex/firestore/NativeSupportTest.java b/spring-cloud-gcp-native-support/src/test/java/com/google/cloud/spring/nativex/firestore/NativeSupportTest.java deleted file mode 100644 index 81cb4dbdc0..0000000000 --- a/spring-cloud-gcp-native-support/src/test/java/com/google/cloud/spring/nativex/firestore/NativeSupportTest.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2017-2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.spring.nativex.firestore; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -import com.google.cloud.spring.data.firestore.Document; -import java.io.File; -import java.util.Arrays; -import java.util.Collections; -import java.util.ServiceLoader; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.springframework.data.repository.Repository; -import org.springframework.nativex.type.ComponentProcessor; -import org.springframework.nativex.type.NativeConfiguration; -import org.springframework.nativex.type.NativeContext; -import org.springframework.nativex.type.TypeSystem; - -class NativeSupportTest { - - private NativeContext nativeContext; - private TypeSystem typeSystem; - - private final FirestoreDocumentComponentProcessor documentsComponentProcessor = - new FirestoreDocumentComponentProcessor(); - private final FirestoreRepositoryComponentProcessor repositoryComponentProcessor = - new FirestoreRepositoryComponentProcessor(); - - @BeforeEach - void setup() { - nativeContext = mock(NativeContext.class); - typeSystem = - new TypeSystem( - Arrays.asList( - new File("./target/classes").toString(), - new File("./target/test-classes").toString())); - - when(nativeContext.getTypeSystem()).thenReturn(typeSystem); - } - - @Test - void shouldConfigureComponentProcessorJavaSpi() { - assertThat(ServiceLoader.load(ComponentProcessor.class)) - .anyMatch(FirestoreDocumentComponentProcessor.class::isInstance) - .anyMatch(FirestoreRepositoryComponentProcessor.class::isInstance); - } - - @Test - void shouldConfigureNativeConfigurationJavaSpi() { - assertThat(ServiceLoader.load(NativeConfiguration.class)) - .anyMatch(FirestoreNativeConfig.class::isInstance); - } - - @Test - void shouldHandleComponentIndexedFirestoreDocuments() { - assertThat( - documentsComponentProcessor.handle( - nativeContext, - typeSystem.resolve(TestDocument.class).getDottedName(), - Collections.singletonList(typeSystem.resolve(Document.class).getDottedName()))) - .isTrue(); - } - - @Test - void shouldHandleNoneIndexedFirestoreDocuments() { - assertThat( - documentsComponentProcessor.handle( - nativeContext, - typeSystem.resolve(TestDocument.class).getDottedName(), - Collections.emptyList())) - .isTrue(); - } - - @Test - void shouldHandleFirestoreRepositories() { - assertThat( - repositoryComponentProcessor.handle( - nativeContext, - typeSystem.resolve(TestDocumentRepository.class).getDottedName(), - Collections.singletonList(typeSystem.resolve(Repository.class).getDottedName()))) - .isTrue(); - } -} diff --git a/spring-cloud-gcp-native-support/src/test/java/com/google/cloud/spring/nativex/firestore/TestDocument.java b/spring-cloud-gcp-native-support/src/test/java/com/google/cloud/spring/nativex/firestore/TestDocument.java deleted file mode 100644 index 500965ab82..0000000000 --- a/spring-cloud-gcp-native-support/src/test/java/com/google/cloud/spring/nativex/firestore/TestDocument.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2017-2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.spring.nativex.firestore; - -import com.google.cloud.firestore.annotation.DocumentId; -import com.google.cloud.spring.data.firestore.Document; -import java.util.List; -import lombok.Data; -import lombok.Value; - -@Document(collectionName = "usersCollection") -@Data -public class TestDocument { - @DocumentId private String id; - private String name; - private List
addresses; - - @Value - public static class Address { - String streetAddress; - String country; - } -} diff --git a/spring-cloud-gcp-native-support/src/test/java/com/google/cloud/spring/nativex/firestore/TestDocumentRepository.java b/spring-cloud-gcp-native-support/src/test/java/com/google/cloud/spring/nativex/firestore/TestDocumentRepository.java deleted file mode 100644 index ce917e8148..0000000000 --- a/spring-cloud-gcp-native-support/src/test/java/com/google/cloud/spring/nativex/firestore/TestDocumentRepository.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2017-2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.spring.nativex.firestore; - -import com.google.cloud.spring.data.firestore.FirestoreReactiveRepository; -import org.springframework.stereotype.Repository; -import reactor.core.publisher.Flux; - -@Repository -public interface TestDocumentRepository extends FirestoreReactiveRepository { - Flux findAllByName(String name); -} From e62807e500a15bc0376c753c42035ba3ce37eccd Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 7 Nov 2022 15:14:14 -0500 Subject: [PATCH 043/179] replace javax to jakarta --- .../src/main/java/com/example/House.java | 6 +++--- .../src/main/kotlin/com/example/data/Person.kt | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-jpa-sample/src/main/java/com/example/House.java b/spring-cloud-gcp-samples/spring-cloud-gcp-data-jpa-sample/src/main/java/com/example/House.java index 527a929e51..e509286869 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-jpa-sample/src/main/java/com/example/House.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-jpa-sample/src/main/java/com/example/House.java @@ -16,9 +16,9 @@ package com.example; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; /** A house entity for the sample application. */ @Entity diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/main/kotlin/com/example/data/Person.kt b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/main/kotlin/com/example/data/Person.kt index fd9bc38e5c..3fabed0a32 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/main/kotlin/com/example/data/Person.kt +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/main/kotlin/com/example/data/Person.kt @@ -16,9 +16,9 @@ package com.example.data -import javax.persistence.Entity -import javax.persistence.GeneratedValue -import javax.persistence.Id +import jakarta.persistence.Entity +import jakarta.persistence.GeneratedValue +import jakarta.persistence.Id /** * Data object representing a registered person. From afe7b9a968b318892e1a3378f57088a44a3cdb9d Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 7 Nov 2022 15:17:00 -0500 Subject: [PATCH 044/179] change package for `LocalServerPort` --- .../SpannerRepositoryIntegrationTests.java | 5 ++-- ...gingSampleApplicationIntegrationTests.java | 5 ++-- ...ricsSampleApplicationIntegrationTests.java | 9 +++---- ...iveReceiverApplicationIntegrationTest.java | 5 ++-- ...bSubSampleApplicationIntegrationTests.java | 5 ++-- ...raceSampleApplicationIntegrationTests.java | 24 +++++++++---------- 6 files changed, 29 insertions(+), 24 deletions(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/src/test/java/com/example/SpannerRepositoryIntegrationTests.java b/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/src/test/java/com/example/SpannerRepositoryIntegrationTests.java index e3c6cc91c9..e247343116 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/src/test/java/com/example/SpannerRepositoryIntegrationTests.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/src/test/java/com/example/SpannerRepositoryIntegrationTests.java @@ -37,7 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.boot.web.server.LocalServerPort; +import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.core.ParameterizedTypeReference; import org.springframework.data.domain.PageRequest; import org.springframework.hateoas.PagedModel; @@ -55,7 +55,8 @@ @TestPropertySource("classpath:application-test.properties") @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) class SpannerRepositoryIntegrationTests { - @LocalServerPort private int port; + @LocalServerPort + private int port; @Autowired private TraderRepository traderRepository; diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-logging-sample/src/test/java/com.example/LoggingSampleApplicationIntegrationTests.java b/spring-cloud-gcp-samples/spring-cloud-gcp-logging-sample/src/test/java/com.example/LoggingSampleApplicationIntegrationTests.java index 2ee6dd7dd0..59a7d3b08e 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-logging-sample/src/test/java/com.example/LoggingSampleApplicationIntegrationTests.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-logging-sample/src/test/java/com.example/LoggingSampleApplicationIntegrationTests.java @@ -39,7 +39,7 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.boot.web.server.LocalServerPort; +import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; @@ -61,7 +61,8 @@ class LoggingSampleApplicationIntegrationTests { @Autowired private TestRestTemplate testRestTemplate; - @LocalServerPort private int port; + @LocalServerPort + private int port; private Logging logClient; diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-metrics-sample/src/test/java/com/example/MetricsSampleApplicationIntegrationTests.java b/spring-cloud-gcp-samples/spring-cloud-gcp-metrics-sample/src/test/java/com/example/MetricsSampleApplicationIntegrationTests.java index cfd94e685a..46a45a127c 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-metrics-sample/src/test/java/com/example/MetricsSampleApplicationIntegrationTests.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-metrics-sample/src/test/java/com/example/MetricsSampleApplicationIntegrationTests.java @@ -30,10 +30,10 @@ import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.actuate.metrics.AutoConfigureMetrics; +import org.springframework.boot.test.autoconfigure.actuate.observability.AutoConfigureObservability; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.boot.web.server.LocalServerPort; +import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.http.ResponseEntity; import org.springframework.test.context.junit.jupiter.SpringExtension; @@ -43,14 +43,15 @@ @SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = MetricsApplication.class) -@AutoConfigureMetrics // needed to enable metrics export in Spring Boot tests +@AutoConfigureObservability // needed to enable metrics export in Spring Boot tests class MetricsSampleApplicationIntegrationTests { @Autowired private GcpProjectIdProvider projectIdProvider; @Autowired private TestRestTemplate testRestTemplate; - @LocalServerPort private int port; + @LocalServerPort + private int port; private MetricServiceClient metricClient; diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-reactive-sample/src/test/java/com/example/ReactiveReceiverApplicationIntegrationTest.java b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-reactive-sample/src/test/java/com/example/ReactiveReceiverApplicationIntegrationTest.java index 5e2a48886d..16b2adafa3 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-reactive-sample/src/test/java/com/example/ReactiveReceiverApplicationIntegrationTest.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-reactive-sample/src/test/java/com/example/ReactiveReceiverApplicationIntegrationTest.java @@ -24,7 +24,7 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.web.server.LocalServerPort; +import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.http.MediaType; import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.web.reactive.server.FluxExchangeResult; @@ -43,7 +43,8 @@ classes = ReactiveReceiverApplication.class) class ReactiveReceiverApplicationIntegrationTest { - @LocalServerPort private int port; + @LocalServerPort + private int port; @Autowired private WebTestClient webTestClient; diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/src/test/java/com/example/PubSubSampleApplicationIntegrationTests.java b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/src/test/java/com/example/PubSubSampleApplicationIntegrationTests.java index 3b46c217f0..785df8aa17 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/src/test/java/com/example/PubSubSampleApplicationIntegrationTests.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/src/test/java/com/example/PubSubSampleApplicationIntegrationTests.java @@ -50,7 +50,7 @@ import org.springframework.boot.test.system.CapturedOutput; import org.springframework.boot.test.system.OutputCaptureExtension; import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.boot.web.server.LocalServerPort; +import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.http.ResponseEntity; import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.web.util.UriComponentsBuilder; @@ -93,7 +93,8 @@ class PubSubSampleApplicationIntegrationTests { private static String projectName; - @LocalServerPort private int port; + @LocalServerPort + private int port; @Autowired private TestRestTemplate testRestTemplate; diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java index 1b7c9fd8b1..bb6ebfad11 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java @@ -58,7 +58,7 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.boot.web.server.LocalServerPort; +import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; @@ -83,7 +83,8 @@ static void registerProperties(DynamicPropertyRegistry registry) { private final Logger log = LoggerFactory.getLogger(this.getClass()); - @LocalServerPort private int port; + @LocalServerPort + private int port; private static GcpProjectIdProvider projectIdProvider; @@ -91,9 +92,9 @@ static void registerProperties(DynamicPropertyRegistry registry) { private String url; - private static String SAMPLE_TOPIC = "traceTopic-" + UUID.randomUUID(); + private static final String SAMPLE_TOPIC = "traceTopic-" + UUID.randomUUID(); - private static String SAMPLE_SUBSCRIPTION = "traceSubscription-" + UUID.randomUUID(); + private static final String SAMPLE_SUBSCRIPTION = "traceSubscription-" + UUID.randomUUID(); private TestRestTemplate testRestTemplate; @@ -138,7 +139,7 @@ void setupTraceClient() throws IOException { this.logClient = LoggingOptions.newBuilder() - .setProjectId(this.projectIdProvider.getProjectId()) + .setProjectId(projectIdProvider.getProjectId()) .setCredentials(this.credentialsProvider.getCredentials()) .build() .getService(); @@ -166,7 +167,7 @@ void testTracesAreLoggedCorrectly() { GetTraceRequest getTraceRequest = GetTraceRequest.newBuilder() - .setProjectId(this.projectIdProvider.getProjectId()) + .setProjectId(projectIdProvider.getProjectId()) .setTraceId(uuidString) .build(); @@ -174,9 +175,9 @@ void testTracesAreLoggedCorrectly() { String.format( "trace=projects/%s/traces/%s AND logName=projects/%s/logs/spring.log AND" + " timestamp>=\"%s\"", - this.projectIdProvider.getProjectId(), + projectIdProvider.getProjectId(), uuidString, - this.projectIdProvider.getProjectId(), + projectIdProvider.getProjectId(), startDateTime.toStringRfc3339()); await() @@ -194,8 +195,7 @@ void testTracesAreLoggedCorrectly() { + trace.getSpansCount() + " spans (" + trace.getSpansList().stream() - .map(TraceSpan::getName) - .collect(Collectors.toList()) + .map(TraceSpan::getName).toList() + ")."); assertThat(trace.getTraceId()).isEqualTo(uuidString); @@ -207,7 +207,7 @@ void testTracesAreLoggedCorrectly() { log.debug("Trace spans match."); // verify custom tags - assertThat(trace.getSpans(0).getLabelsMap().get("environment")).isEqualTo("QA"); + assertThat(trace.getSpans(0).getLabelsMap()).containsEntry("environment", "QA"); assertThat(trace.getSpans(0).getLabelsMap().get("session-id")).isNotNull(); log.debug("Trace labels match."); @@ -236,7 +236,7 @@ void testTracesAreLoggedCorrectly() { String wantTraceRegex = "projects/" - + this.projectIdProvider.getProjectId() + + projectIdProvider.getProjectId() + "/traces/([a-z0-9]){32}"; log.debug("Want trace " + wantTraceRegex + " and got " + le.getTrace()); assertThat(le.getTrace()).matches(wantTraceRegex); From 9c98ec91fd8146b351e2f9a7ac35e55b73c22ee4 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 7 Nov 2022 15:18:47 -0500 Subject: [PATCH 045/179] remove deprecated class `WebSecurityConfigurerAdapter` --- .../com/example/SecurityConfiguration.java | 21 +++++++++++-------- .../java/com/example/SecurityConfigurer.java | 18 +++++++++------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-security-firebase-sample/src/main/java/com/example/SecurityConfiguration.java b/spring-cloud-gcp-samples/spring-cloud-gcp-security-firebase-sample/src/main/java/com/example/SecurityConfiguration.java index db2beaca48..6b177e9afe 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-security-firebase-sample/src/main/java/com/example/SecurityConfiguration.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-security-firebase-sample/src/main/java/com/example/SecurityConfiguration.java @@ -16,10 +16,11 @@ package com.example; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.authentication.Http403ForbiddenEntryPoint; /** @@ -27,23 +28,25 @@ */ @Configuration @EnableWebSecurity -public class SecurityConfiguration extends WebSecurityConfigurerAdapter { +public class SecurityConfiguration { - @Override - protected void configure(HttpSecurity http) throws Exception { - http.authorizeRequests() - .antMatchers("/") + @Bean + public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { + http.authorizeHttpRequests() + .requestMatchers("/") .permitAll() - .antMatchers("/css/**") + .requestMatchers("/css/**") .permitAll() - .antMatchers("/templates/**") + .requestMatchers("/templates/**") .permitAll() - .antMatchers("/answer") + .requestMatchers("/answer") .authenticated() .and() .oauth2ResourceServer() .jwt() .and() .authenticationEntryPoint(new Http403ForbiddenEntryPoint()); + + return http.build(); } } diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-security-iap-sample/src/main/java/com/example/SecurityConfigurer.java b/spring-cloud-gcp-samples/spring-cloud-gcp-security-iap-sample/src/main/java/com/example/SecurityConfigurer.java index 69d04803ab..4455398452 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-security-iap-sample/src/main/java/com/example/SecurityConfigurer.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-security-iap-sample/src/main/java/com/example/SecurityConfigurer.java @@ -16,14 +16,15 @@ package com.example; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.authentication.Http403ForbiddenEntryPoint; /** - * Sample custom {@link WebSecurityConfigurerAdapter} that applies OAuth Resource Server + * Sample custom {@link SecurityFilterChain} that applies OAuth Resource Server * pre-authentication, and rejects unauthenticated requests to a single page, {@code /topsecret}. * All other pages are unsecured. * @@ -35,16 +36,19 @@ */ @Configuration @EnableWebSecurity -public class SecurityConfigurer extends WebSecurityConfigurerAdapter { - @Override - protected void configure(HttpSecurity http) throws Exception { - http.authorizeRequests() - .antMatchers("/topsecret") +public class SecurityConfigurer { + + @Bean + public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { + http.authorizeHttpRequests() + .requestMatchers("/topsecret") .authenticated() .and() .oauth2ResourceServer() .jwt() .and() .authenticationEntryPoint(new Http403ForbiddenEntryPoint()); + + return http.build(); } } From dad079430bef74b67edffdb9c4ad74ca0e99f8fa Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 7 Nov 2022 17:36:04 -0500 Subject: [PATCH 046/179] implement new auto configuration style --- .../GcpBigQueryAutoConfiguration.java | 4 +-- .../GcpConfigBootstrapConfiguration.java | 4 +-- .../core/GcpContextAutoConfiguration.java | 4 +-- ...atastoreRepositoriesAutoConfiguration.java | 4 +-- ...reTransactionManagerAutoConfiguration.java | 3 +- .../GcpDatastoreAutoConfiguration.java | 4 +-- ...GcpDatastoreEmulatorAutoConfiguration.java | 4 +-- ...storeHealthIndicatorAutoConfiguration.java | 4 +-- ...irestoreRepositoriesAutoConfiguration.java | 4 +-- ...reTransactionManagerAutoConfiguration.java | 4 +-- .../GcpFirestoreAutoConfiguration.java | 4 +-- ...GcpFirestoreEmulatorAutoConfiguration.java | 4 +-- .../kms/GcpKmsAutoConfiguration.java | 4 +-- .../StackdriverLoggingAutoConfiguration.java | 4 +-- ...cpStackdriverMetricsAutoConfiguration.java | 4 +-- .../pubsub/GcpPubSubAutoConfiguration.java | 4 +-- .../GcpPubSubEmulatorAutoConfiguration.java | 4 +-- .../GcpPubSubReactiveAutoConfiguration.java | 4 +-- ...ubSubHealthIndicatorAutoConfiguration.java | 4 +-- ...ptionHealthIndicatorAutoConfiguration.java | 4 +-- ...rebaseAuthenticationAutoConfiguration.java | 4 +-- .../IapAuthenticationAutoConfiguration.java | 4 +-- .../spanner/GcpSpannerAutoConfiguration.java | 4 +-- .../GcpSpannerEmulatorAutoConfiguration.java | 4 +-- .../SpannerRepositoriesAutoConfiguration.java | 4 +-- ...erTransactionManagerAutoConfiguration.java | 3 +- ...annerHealthIndicatorAutoConfiguration.java | 4 +-- .../storage/GcpStorageAutoConfiguration.java | 4 +-- .../StackdriverTraceAutoConfiguration.java | 5 +-- .../pubsub/TracePubSubAutoConfiguration.java | 4 +-- .../main/resources/META-INF/spring.factories | 31 ------------------- ...ot.autoconfigure.AutoConfiguration.imports | 29 +++++++++++++++++ 32 files changed, 90 insertions(+), 89 deletions(-) create mode 100644 spring-cloud-gcp-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/bigquery/GcpBigQueryAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/bigquery/GcpBigQueryAutoConfiguration.java index f9d11d06a5..f23dd4f79e 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/bigquery/GcpBigQueryAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/bigquery/GcpBigQueryAutoConfiguration.java @@ -30,17 +30,17 @@ import java.util.HashMap; import java.util.Map; import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; /** Provides client objects for interfacing with BigQuery. */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @AutoConfigureAfter(GcpContextAutoConfiguration.class) @ConditionalOnProperty(value = "spring.cloud.gcp.bigquery.enabled", matchIfMissing = true) @ConditionalOnClass({BigQuery.class, BigQueryTemplate.class}) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/config/GcpConfigBootstrapConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/config/GcpConfigBootstrapConfiguration.java index 537531be39..9158372cb2 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/config/GcpConfigBootstrapConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/config/GcpConfigBootstrapConfiguration.java @@ -19,18 +19,18 @@ import com.google.cloud.spring.core.DefaultCredentialsProvider; import com.google.cloud.spring.core.DefaultGcpProjectIdProvider; import java.io.IOException; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; /** * Bootstrap auto configuration for Google Cloud Runtime Configurator Starter. * * @since 1.1 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnProperty(prefix = "spring.cloud.gcp.config", name = "enabled", havingValue = "true") @EnableConfigurationProperties(GcpConfigProperties.class) public class GcpConfigBootstrapConfiguration { diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/core/GcpContextAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/core/GcpContextAutoConfiguration.java index c1fd6607b4..8c93ec46a1 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/core/GcpContextAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/core/GcpContextAutoConfiguration.java @@ -25,17 +25,17 @@ import java.io.IOException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; /** * Base starter for Google Cloud Projects. Provides defaults for {@link * com.google.auth.oauth2.GoogleCredentials}. Binds properties from {@link GcpProperties}. */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnProperty( name = "spring.cloud.gcp.core.enabled", havingValue = "true", diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/DatastoreRepositoriesAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/DatastoreRepositoriesAutoConfiguration.java index bb6e0dc18a..8d7d7c30b8 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/DatastoreRepositoriesAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/DatastoreRepositoriesAutoConfiguration.java @@ -19,11 +19,11 @@ import com.google.cloud.spring.data.datastore.repository.DatastoreRepository; import com.google.cloud.spring.data.datastore.repository.config.DatastoreRepositoryConfigurationExtension; import com.google.cloud.spring.data.datastore.repository.support.DatastoreRepositoryFactoryBean; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; /** @@ -32,7 +32,7 @@ * * @since 1.1 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnClass(DatastoreRepository.class) @ConditionalOnMissingBean({ DatastoreRepositoryFactoryBean.class, diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/DatastoreTransactionManagerAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/DatastoreTransactionManagerAutoConfiguration.java index 41d1c980c9..d1fb68e7ee 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/DatastoreTransactionManagerAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/DatastoreTransactionManagerAutoConfiguration.java @@ -18,6 +18,7 @@ import com.google.cloud.spring.data.datastore.core.DatastoreTransactionManager; import org.springframework.beans.factory.ObjectProvider; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -33,7 +34,7 @@ * * @since 1.1 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnClass(DatastoreTransactionManager.class) @ConditionalOnProperty(value = "spring.cloud.gcp.datastore.enabled", matchIfMissing = true) @AutoConfigureBefore(TransactionAutoConfiguration.class) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/GcpDatastoreAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/GcpDatastoreAutoConfiguration.java index 1f3b36e6b3..512914998b 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/GcpDatastoreAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/GcpDatastoreAutoConfiguration.java @@ -43,13 +43,13 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.ObjectProvider; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.data.rest.webmvc.spi.BackendIdConverter; /** @@ -57,7 +57,7 @@ * * @since 1.1 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @AutoConfigureAfter(GcpContextAutoConfiguration.class) @ConditionalOnProperty(value = "spring.cloud.gcp.datastore.enabled", matchIfMissing = true) @ConditionalOnClass({DatastoreOperations.class, Datastore.class}) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/GcpDatastoreEmulatorAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/GcpDatastoreEmulatorAutoConfiguration.java index 6bcac6eaa2..041cb65cc1 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/GcpDatastoreEmulatorAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/GcpDatastoreEmulatorAutoConfiguration.java @@ -21,13 +21,13 @@ import java.util.concurrent.TimeoutException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.SmartLifecycle; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; /** * If spring.cloud.gcp.datastore.emulator.enabled is set to true the emulator will be started as a @@ -35,7 +35,7 @@ * * @since 1.2 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnProperty("spring.cloud.gcp.datastore.emulator.enabled") @AutoConfigureBefore(GcpDatastoreAutoConfiguration.class) @EnableConfigurationProperties(GcpDatastoreProperties.class) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/health/DatastoreHealthIndicatorAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/health/DatastoreHealthIndicatorAutoConfiguration.java index e2c801c8d9..2f57773f8b 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/health/DatastoreHealthIndicatorAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/health/DatastoreHealthIndicatorAutoConfiguration.java @@ -23,13 +23,13 @@ import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.health.HealthIndicator; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; /** * {@link HealthContributorAutoConfiguration Auto-configuration} for {@link @@ -37,7 +37,7 @@ * * @since 1.2 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnClass({Datastore.class, HealthIndicator.class}) @ConditionalOnBean(value = Datastore.class, parameterizedContainer = Supplier.class) @ConditionalOnEnabledHealthIndicator("datastore") diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/firestore/FirestoreRepositoriesAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/firestore/FirestoreRepositoriesAutoConfiguration.java index f445d3fe6f..6f2443d92e 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/firestore/FirestoreRepositoriesAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/firestore/FirestoreRepositoriesAutoConfiguration.java @@ -19,11 +19,11 @@ import com.google.cloud.spring.data.firestore.FirestoreReactiveRepository; import com.google.cloud.spring.data.firestore.repository.config.FirestoreRepositoryConfigurationExtension; import com.google.cloud.spring.data.firestore.repository.support.FirestoreRepositoryFactoryBean; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; /** @@ -31,7 +31,7 @@ * * @since 1.2 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnClass(FirestoreReactiveRepository.class) @ConditionalOnMissingBean({ FirestoreRepositoryFactoryBean.class, diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/firestore/FirestoreTransactionManagerAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/firestore/FirestoreTransactionManagerAutoConfiguration.java index ef7c509f94..8b2f6dd2fc 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/firestore/FirestoreTransactionManagerAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/firestore/FirestoreTransactionManagerAutoConfiguration.java @@ -20,6 +20,7 @@ import com.google.cloud.spring.data.firestore.mapping.FirestoreClassMapper; import com.google.cloud.spring.data.firestore.transaction.ReactiveFirestoreTransactionManager; import com.google.firestore.v1.FirestoreGrpc; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; @@ -27,7 +28,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import reactor.core.publisher.Flux; /** @@ -35,7 +35,7 @@ * * @since 2.0.5 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnClass({ ReactiveFirestoreTransactionManager.class, FirestoreGrpc.FirestoreStub.class, diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/firestore/GcpFirestoreAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/firestore/GcpFirestoreAutoConfiguration.java index 15a615583c..bfbc1a230e 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/firestore/GcpFirestoreAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/firestore/GcpFirestoreAutoConfiguration.java @@ -35,13 +35,13 @@ import io.grpc.auth.MoreCallCredentials; import java.io.IOException; import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import reactor.core.publisher.Flux; /** @@ -49,7 +49,7 @@ * * @since 1.2 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @AutoConfigureAfter(GcpContextAutoConfiguration.class) @ConditionalOnProperty(value = "spring.cloud.gcp.firestore.enabled", matchIfMissing = true) @ConditionalOnClass({Firestore.class}) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/firestore/GcpFirestoreEmulatorAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/firestore/GcpFirestoreEmulatorAutoConfiguration.java index 9921a67444..9d8cb7c23e 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/firestore/GcpFirestoreEmulatorAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/firestore/GcpFirestoreEmulatorAutoConfiguration.java @@ -33,13 +33,13 @@ import java.util.List; import java.util.Map; import org.apache.commons.lang3.StringUtils; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import reactor.core.publisher.Flux; /** @@ -47,7 +47,7 @@ * * @since 1.2.3 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnProperty("spring.cloud.gcp.firestore.emulator.enabled") @AutoConfigureBefore(GcpFirestoreAutoConfiguration.class) @EnableConfigurationProperties(GcpFirestoreProperties.class) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/kms/GcpKmsAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/kms/GcpKmsAutoConfiguration.java index b266fb3ac9..8c45e90f27 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/kms/GcpKmsAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/kms/GcpKmsAutoConfiguration.java @@ -24,15 +24,15 @@ import com.google.cloud.spring.core.UserAgentHeaderProvider; import com.google.cloud.spring.kms.KmsTemplate; import java.io.IOException; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; /** Autoconfiguration for GCP KMS which enables data encryption and decryption. */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @EnableConfigurationProperties(GcpKmsProperties.class) @ConditionalOnClass({KeyManagementServiceClient.class, KmsTemplate.class}) @ConditionalOnProperty(value = "spring.cloud.gcp.kms.enabled", matchIfMissing = true) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/logging/StackdriverLoggingAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/logging/StackdriverLoggingAutoConfiguration.java index a983d93226..b4e7f857f4 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/logging/StackdriverLoggingAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/logging/StackdriverLoggingAutoConfiguration.java @@ -22,6 +22,7 @@ import com.google.cloud.spring.logging.TraceIdLoggingWebMvcInterceptor; import com.google.cloud.spring.logging.extractors.CloudTraceIdExtractor; import com.google.cloud.spring.logging.extractors.TraceIdExtractor; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -29,7 +30,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.web.servlet.HandlerInterceptor; @@ -38,7 +38,7 @@ * configuration is turned on only if Trace support is not used and Web MVC is used. Otherwise, the * MDC context will be used by the Logback appenders. */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnClass({HandlerInterceptor.class, LoggingAppender.class, TraceIdExtractor.class}) @ConditionalOnMissingBean(name = "stackdriverTracingCustomizer") @AutoConfigureAfter(StackdriverTraceAutoConfiguration.class) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/metrics/GcpStackdriverMetricsAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/metrics/GcpStackdriverMetricsAutoConfiguration.java index 9f6fe30c61..9904318985 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/metrics/GcpStackdriverMetricsAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/metrics/GcpStackdriverMetricsAutoConfiguration.java @@ -29,6 +29,7 @@ import org.springframework.boot.actuate.autoconfigure.metrics.export.ConditionalOnEnabledMetricsExport; import org.springframework.boot.actuate.autoconfigure.metrics.export.stackdriver.StackdriverMetricsExportAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.metrics.export.stackdriver.StackdriverProperties; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; @@ -37,14 +38,13 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; /** * Provides auto-detection for `project-id` and `credentials`. * * @since 1.2.4 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @AutoConfigureBefore(StackdriverMetricsExportAutoConfiguration.class) @AutoConfigureAfter(MetricsAutoConfiguration.class) @ConditionalOnClass(StackdriverMeterRegistry.class) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubAutoConfiguration.java index b2280476ce..4274c947b8 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubAutoConfiguration.java @@ -67,6 +67,7 @@ import org.springframework.beans.factory.ObjectProvider; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.support.BeanDefinitionBuilder; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -74,14 +75,13 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.context.support.GenericApplicationContext; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; import org.threeten.bp.Duration; /** Auto-config for Pub/Sub. */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @AutoConfigureAfter(GcpContextAutoConfiguration.class) @ConditionalOnProperty(value = "spring.cloud.gcp.pubsub.enabled", matchIfMissing = true) @ConditionalOnClass(PubSubTemplate.class) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubEmulatorAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubEmulatorAutoConfiguration.java index 1dd0c17d0f..580cebc6eb 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubEmulatorAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubEmulatorAutoConfiguration.java @@ -23,19 +23,19 @@ import io.grpc.ManagedChannel; import io.grpc.ManagedChannelBuilder; import javax.annotation.PreDestroy; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; /** * If spring.cloud.gcp.pubsub.emulator-host is set, spring stream will connect to a * running pub/sub emulator. */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnClass({ManagedChannel.class, PubSubTemplate.class}) @ConditionalOnProperty(prefix = "spring.cloud.gcp.pubsub", name = "enabled", matchIfMissing = true) @AutoConfigureBefore(GcpPubSubAutoConfiguration.class) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubReactiveAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubReactiveAutoConfiguration.java index 0f05d07f85..419e33d62f 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubReactiveAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubReactiveAutoConfiguration.java @@ -20,12 +20,12 @@ import com.google.cloud.spring.pubsub.reactive.PubSubReactiveFactory; import java.util.Optional; import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import reactor.core.publisher.Flux; import reactor.core.scheduler.Scheduler; import reactor.core.scheduler.Schedulers; @@ -35,7 +35,7 @@ * * @since 1.2 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @AutoConfigureAfter(GcpPubSubAutoConfiguration.class) @ConditionalOnClass({Flux.class, PubSubSubscriberTemplate.class}) @ConditionalOnProperty( diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/health/PubSubHealthIndicatorAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/health/PubSubHealthIndicatorAutoConfiguration.java index 47bb339c90..31cd6b81af 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/health/PubSubHealthIndicatorAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/health/PubSubHealthIndicatorAutoConfiguration.java @@ -24,6 +24,7 @@ import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.health.HealthContributor; import org.springframework.boot.actuate.health.HealthIndicator; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; @@ -31,7 +32,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.util.Assert; /** @@ -39,7 +39,7 @@ * * @since 1.2.2 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnClass({HealthIndicator.class, PubSubTemplate.class}) @ConditionalOnBean(PubSubTemplate.class) @ConditionalOnEnabledHealthIndicator("pubsub") diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/health/PubSubSubscriptionHealthIndicatorAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/health/PubSubSubscriptionHealthIndicatorAutoConfiguration.java index 6c3ec6b4eb..95f4243ccf 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/health/PubSubSubscriptionHealthIndicatorAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/health/PubSubSubscriptionHealthIndicatorAutoConfiguration.java @@ -30,19 +30,19 @@ import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.health.HealthIndicator; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; /** * @since 2.0.6 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnClass({HealthIndicator.class, MetricServiceClient.class}) @ConditionalOnEnabledHealthIndicator("pubsub-subscriber") @ConditionalOnProperty({ diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/security/FirebaseAuthenticationAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/security/FirebaseAuthenticationAutoConfiguration.java index 46b2144295..da689572de 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/security/FirebaseAuthenticationAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/security/FirebaseAuthenticationAutoConfiguration.java @@ -22,6 +22,7 @@ import com.google.cloud.spring.security.firebase.FirebaseTokenValidator; import java.util.ArrayList; import java.util.List; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; @@ -30,7 +31,6 @@ import org.springframework.boot.autoconfigure.security.oauth2.resource.servlet.OAuth2ResourceServerAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.http.client.SimpleClientHttpRequestFactory; import org.springframework.security.oauth2.core.DelegatingOAuth2TokenValidator; import org.springframework.security.oauth2.core.OAuth2TokenValidator; @@ -44,7 +44,7 @@ /** * @since 1.2.2 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnClass(FirebaseTokenValidator.class) @ConditionalOnProperty(value = "spring.cloud.gcp.security.firebase.enabled", matchIfMissing = true) @AutoConfigureBefore(OAuth2ResourceServerAutoConfiguration.class) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/security/IapAuthenticationAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/security/IapAuthenticationAutoConfiguration.java index c96b77b67b..fc8c7751b9 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/security/IapAuthenticationAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/security/IapAuthenticationAutoConfiguration.java @@ -28,6 +28,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; @@ -36,7 +37,6 @@ import org.springframework.boot.autoconfigure.security.oauth2.resource.servlet.OAuth2ResourceServerAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.security.oauth2.core.DelegatingOAuth2TokenValidator; import org.springframework.security.oauth2.core.OAuth2TokenValidator; import org.springframework.security.oauth2.jose.jws.SignatureAlgorithm; @@ -68,7 +68,7 @@ * * @since 1.1 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnProperty(value = "spring.cloud.gcp.security.iap.enabled", matchIfMissing = true) @ConditionalOnClass({AudienceValidator.class}) @AutoConfigureBefore(OAuth2ResourceServerAutoConfiguration.class) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/GcpSpannerAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/GcpSpannerAutoConfiguration.java index f91748f455..eb2648b0dd 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/GcpSpannerAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/GcpSpannerAutoConfiguration.java @@ -44,18 +44,18 @@ import java.io.IOException; import java.util.Optional; import java.util.function.Supplier; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Scope; import org.springframework.data.rest.webmvc.spi.BackendIdConverter; /** Provides Spring Data classes to use with Cloud Spanner. */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @AutoConfigureAfter(GcpContextAutoConfiguration.class) @ConditionalOnProperty(value = "spring.cloud.gcp.spanner.enabled", matchIfMissing = true) @ConditionalOnClass({ diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/GcpSpannerEmulatorAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/GcpSpannerEmulatorAutoConfiguration.java index e27cbde2a1..ba554ab537 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/GcpSpannerEmulatorAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/GcpSpannerEmulatorAutoConfiguration.java @@ -23,12 +23,12 @@ import com.google.cloud.spring.core.GcpProjectIdProvider; import java.io.IOException; import java.util.Optional; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.util.Assert; /** @@ -36,7 +36,7 @@ * * @since 1.2.3 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @AutoConfigureBefore({GcpSpannerAutoConfiguration.class, GcpContextAutoConfiguration.class}) @EnableConfigurationProperties(GcpSpannerProperties.class) @ConditionalOnProperty( diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/SpannerRepositoriesAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/SpannerRepositoriesAutoConfiguration.java index 9b302b4bad..c3a1fa9e43 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/SpannerRepositoriesAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/SpannerRepositoriesAutoConfiguration.java @@ -19,18 +19,18 @@ import com.google.cloud.spring.data.spanner.repository.SpannerRepository; import com.google.cloud.spring.data.spanner.repository.config.SpannerRepositoryConfigurationExtension; import com.google.cloud.spring.data.spanner.repository.support.SpannerRepositoryFactoryBean; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; /** * Enables autoconfiguration for {@link * com.google.cloud.spring.data.spanner.repository.config.EnableSpannerRepositories}. */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnClass(SpannerRepository.class) @ConditionalOnMissingBean({ SpannerRepositoryFactoryBean.class, diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/SpannerTransactionManagerAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/SpannerTransactionManagerAutoConfiguration.java index a38e3a0b5b..53a74dcd1a 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/SpannerTransactionManagerAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/SpannerTransactionManagerAutoConfiguration.java @@ -20,6 +20,7 @@ import com.google.cloud.spring.data.spanner.core.SpannerTransactionManager; import java.util.function.Supplier; import org.springframework.beans.factory.ObjectProvider; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -35,7 +36,7 @@ * * @since 1.1 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnClass(SpannerTransactionManager.class) @ConditionalOnProperty(value = "spring.cloud.gcp.spanner.enabled", matchIfMissing = true) @AutoConfigureBefore(TransactionAutoConfiguration.class) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/health/SpannerHealthIndicatorAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/health/SpannerHealthIndicatorAutoConfiguration.java index a4ab723539..f3e9df35d9 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/health/SpannerHealthIndicatorAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/health/SpannerHealthIndicatorAutoConfiguration.java @@ -24,6 +24,7 @@ import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.health.HealthContributor; import org.springframework.boot.actuate.health.HealthIndicator; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; @@ -31,7 +32,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.util.Assert; /** @@ -39,7 +39,7 @@ * * @since 2.0.6 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnClass({SpannerTemplate.class, HealthIndicator.class}) @ConditionalOnBean(SpannerTemplate.class) @ConditionalOnEnabledHealthIndicator("spanner") diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/storage/GcpStorageAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/storage/GcpStorageAutoConfiguration.java index b4df1f886c..7bd6f36fda 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/storage/GcpStorageAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/storage/GcpStorageAutoConfiguration.java @@ -26,12 +26,12 @@ import com.google.cloud.storage.Storage; import com.google.cloud.storage.StorageOptions; import java.io.IOException; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; /** @@ -41,7 +41,7 @@ * * @see GoogleStorageProtocolResolver */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnClass({GoogleStorageProtocolResolverSettings.class, Storage.class}) @ConditionalOnProperty(value = "spring.cloud.gcp.storage.enabled", matchIfMissing = true) @EnableConfigurationProperties({GcpProperties.class, GcpStorageProperties.class}) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java index 32ff1b107f..d9c3d9ff2e 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java @@ -43,6 +43,7 @@ import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.actuate.autoconfigure.tracing.BraveAutoConfiguration; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -63,10 +64,10 @@ import zipkin2.reporter.stackdriver.StackdriverSender.Builder; /** Config for Stackdriver Trace. */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @EnableConfigurationProperties({GcpTraceProperties.class}) @ConditionalOnProperty( - value = {"spring.sleuth.enabled", "spring.cloud.gcp.trace.enabled"}, + value = {"spring.cloud.gcp.trace.enabled"}, matchIfMissing = true) @ConditionalOnClass(StackdriverSender.class) @AutoConfigureBefore(BraveAutoConfiguration.class) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java index 7bb86bf61e..39b6ef81de 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java @@ -24,6 +24,7 @@ import com.google.cloud.spring.pubsub.support.PublisherFactory; import org.springframework.beans.factory.BeanFactory; import org.springframework.boot.actuate.autoconfigure.tracing.BraveAutoConfiguration; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; @@ -31,11 +32,10 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnBean(Tracing.class) @ConditionalOnProperty(value = "spring.cloud.gcp.trace.pubsub.enabled") @ConditionalOnClass({PublisherFactory.class, MessagingTracing.class}) diff --git a/spring-cloud-gcp-autoconfigure/src/main/resources/META-INF/spring.factories b/spring-cloud-gcp-autoconfigure/src/main/resources/META-INF/spring.factories index a3ff19996e..9a39527331 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/resources/META-INF/spring.factories +++ b/spring-cloud-gcp-autoconfigure/src/main/resources/META-INF/spring.factories @@ -1,34 +1,3 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ -com.google.cloud.spring.autoconfigure.pubsub.GcpPubSubEmulatorAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.core.GcpContextAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.logging.StackdriverLoggingAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.pubsub.GcpPubSubAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.pubsub.GcpPubSubReactiveAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.spanner.GcpSpannerAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.spanner.GcpSpannerEmulatorAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.spanner.health.SpannerHealthIndicatorAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.spanner.SpannerTransactionManagerAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.datastore.GcpDatastoreAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.firestore.GcpFirestoreAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.firestore.FirestoreTransactionManagerAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.firestore.GcpFirestoreEmulatorAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.datastore.health.DatastoreHealthIndicatorAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.storage.GcpStorageAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.trace.StackdriverTraceAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.trace.pubsub.TracePubSubAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.datastore.DatastoreRepositoriesAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.spanner.SpannerRepositoriesAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.security.IapAuthenticationAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.security.FirebaseAuthenticationAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.vision.CloudVisionAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.datastore.GcpDatastoreEmulatorAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.bigquery.GcpBigQueryAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.datastore.DatastoreTransactionManagerAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.firestore.FirestoreRepositoriesAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.pubsub.health.PubSubSubscriptionHealthIndicatorAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.pubsub.health.PubSubHealthIndicatorAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.metrics.GcpStackdriverMetricsAutoConfiguration,\ -com.google.cloud.spring.autoconfigure.kms.GcpKmsAutoConfiguration org.springframework.cloud.bootstrap.BootstrapConfiguration=\ com.google.cloud.spring.autoconfigure.config.GcpConfigBootstrapConfiguration,\ com.google.cloud.spring.autoconfigure.secretmanager.GcpSecretManagerBootstrapConfiguration diff --git a/spring-cloud-gcp-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-cloud-gcp-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000000..8395a2bcc6 --- /dev/null +++ b/spring-cloud-gcp-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1,29 @@ +com.google.cloud.spring.autoconfigure.pubsub.GcpPubSubEmulatorAutoConfiguration +com.google.cloud.spring.autoconfigure.core.GcpContextAutoConfiguration +com.google.cloud.spring.autoconfigure.logging.StackdriverLoggingAutoConfiguration +com.google.cloud.spring.autoconfigure.pubsub.GcpPubSubAutoConfiguration +com.google.cloud.spring.autoconfigure.pubsub.GcpPubSubReactiveAutoConfiguration +com.google.cloud.spring.autoconfigure.spanner.GcpSpannerAutoConfiguration +com.google.cloud.spring.autoconfigure.spanner.GcpSpannerEmulatorAutoConfiguration +com.google.cloud.spring.autoconfigure.spanner.health.SpannerHealthIndicatorAutoConfiguration +com.google.cloud.spring.autoconfigure.spanner.SpannerTransactionManagerAutoConfiguration +com.google.cloud.spring.autoconfigure.datastore.GcpDatastoreAutoConfiguration +com.google.cloud.spring.autoconfigure.firestore.GcpFirestoreAutoConfiguration +com.google.cloud.spring.autoconfigure.firestore.GcpFirestoreEmulatorAutoConfiguration +com.google.cloud.spring.autoconfigure.datastore.health.DatastoreHealthIndicatorAutoConfiguration +com.google.cloud.spring.autoconfigure.storage.GcpStorageAutoConfiguration +com.google.cloud.spring.autoconfigure.trace.StackdriverTraceAutoConfiguration +com.google.cloud.spring.autoconfigure.trace.pubsub.TracePubSubAutoConfiguration +com.google.cloud.spring.autoconfigure.datastore.DatastoreRepositoriesAutoConfiguration +com.google.cloud.spring.autoconfigure.spanner.SpannerRepositoriesAutoConfiguration +com.google.cloud.spring.autoconfigure.security.IapAuthenticationAutoConfiguration +com.google.cloud.spring.autoconfigure.security.FirebaseAuthenticationAutoConfiguration +com.google.cloud.spring.autoconfigure.vision.CloudVisionAutoConfiguration +com.google.cloud.spring.autoconfigure.datastore.GcpDatastoreEmulatorAutoConfiguration +com.google.cloud.spring.autoconfigure.bigquery.GcpBigQueryAutoConfiguration +com.google.cloud.spring.autoconfigure.datastore.DatastoreTransactionManagerAutoConfiguration +com.google.cloud.spring.autoconfigure.firestore.FirestoreRepositoriesAutoConfiguration +com.google.cloud.spring.autoconfigure.pubsub.health.PubSubSubscriptionHealthIndicatorAutoConfiguration +com.google.cloud.spring.autoconfigure.pubsub.health.PubSubHealthIndicatorAutoConfiguration +com.google.cloud.spring.autoconfigure.metrics.GcpStackdriverMetricsAutoConfiguration +com.google.cloud.spring.autoconfigure.kms.GcpKmsAutoConfiguration From 6c16903c8976c3c337c11ffe9247f861670e8689 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 8 Nov 2022 12:06:59 -0500 Subject: [PATCH 047/179] experiment with samples --- .../pubsub/TracePubSubAutoConfiguration.java | 23 ++++++++++++++ spring-cloud-gcp-samples/pom.xml | 4 +-- .../main/java/com/example/PollableSink.java | 31 ------------------- .../main/java/com/example/SinkExample.java | 2 -- .../main/java/com/example/SourceExample.java | 15 ++++++--- .../java/com/example/ExampleController.java | 2 +- .../spring-cloud-gcp-trace-sample/pom.xml | 2 -- .../main/java/com/example/Application.java | 15 ++++----- .../java/com/example/ExampleController.java | 10 +++--- .../main/java/com/example/WorkService.java | 14 ++++++--- .../src/main/resources/application.properties | 11 ++----- ...raceSampleApplicationIntegrationTests.java | 21 +++++++++++-- .../spring-cloud-gcp-starter-trace/pom.xml | 2 +- 13 files changed, 80 insertions(+), 72 deletions(-) delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/PollableSink.java diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java index 39b6ef81de..9b2a4067ab 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java @@ -16,6 +16,8 @@ package com.google.cloud.spring.autoconfigure.trace.pubsub; +import brave.CurrentSpanCustomizer; +import brave.SpanCustomizer; import brave.Tracing; import brave.messaging.MessagingTracing; import com.google.cloud.pubsub.v1.Publisher; @@ -34,6 +36,9 @@ import org.springframework.context.annotation.Bean; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; +import zipkin2.Span; +import zipkin2.codec.BytesEncoder; +import zipkin2.codec.SpanBytesEncoder; @AutoConfiguration @ConditionalOnBean(Tracing.class) @@ -63,4 +68,22 @@ PublisherCustomizer tracePublisherCustomizer(PubSubTracing pubSubTracing) { return (Publisher.Builder publisherBuilder, String topic) -> publisherBuilder.setTransform(msg -> helper.instrumentMessage(msg, topic)); } + + @Bean + @ConditionalOnMissingBean + public SpanCustomizer spanCustomizer(Tracing tracing) { + return CurrentSpanCustomizer.create(tracing); + } + + @Bean + @ConditionalOnMissingBean + public MessagingTracing messagingTracing(Tracing tracing) { + return MessagingTracing.create(tracing); + } + + @Bean + @ConditionalOnMissingBean + public BytesEncoder spanBytesEncoder() { + return SpanBytesEncoder.PROTO3; + } } diff --git a/spring-cloud-gcp-samples/pom.xml b/spring-cloud-gcp-samples/pom.xml index e6f8847e8a..c11cc247f9 100644 --- a/spring-cloud-gcp-samples/pom.xml +++ b/spring-cloud-gcp-samples/pom.xml @@ -66,8 +66,8 @@ spring-cloud-gcp-pubsub-bus-config-sample spring-cloud-gcp-pubsub-stream-dead-letter-sample spring-cloud-gcp-pubsub-stream-functional-sample - spring-cloud-gcp-pubsub-stream-polling-sample - spring-cloud-gcp-pubsub-stream-sample + + spring-cloud-gcp-pubsub-reactive-sample spring-cloud-gcp-integration-pubsub-json-sample spring-cloud-gcp-security-iap-sample diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/PollableSink.java b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/PollableSink.java deleted file mode 100644 index c04a2c9e71..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/PollableSink.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2017-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example; - -import org.springframework.cloud.stream.annotation.Input; -import org.springframework.cloud.stream.binder.PollableMessageSource; - -/** - * Binds "input" stream to a pollable channel. - * - * @since 1.2 - */ -public interface PollableSink { - - @Input("input") - PollableMessageSource input(); -} diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/SinkExample.java b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/SinkExample.java index 8090e0839e..e795eb1d42 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/SinkExample.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/SinkExample.java @@ -21,7 +21,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.cloud.stream.annotation.EnableBinding; import org.springframework.cloud.stream.binder.PollableMessageSource; import org.springframework.core.ParameterizedTypeReference; import org.springframework.messaging.Message; @@ -33,7 +32,6 @@ * * @since 1.2 */ -@EnableBinding(PollableSink.class) public class SinkExample { private static final Log LOGGER = LogFactory.getLog(SinkExample.class); diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/SourceExample.java b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/SourceExample.java index d3f2f55078..c922d0ead8 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/SourceExample.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/SourceExample.java @@ -17,9 +17,10 @@ package com.example; import java.time.LocalDateTime; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.cloud.stream.annotation.EnableBinding; -import org.springframework.cloud.stream.messaging.Source; +import java.util.function.Consumer; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.context.annotation.Bean; import org.springframework.messaging.support.GenericMessage; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -31,11 +32,10 @@ * * @since 1.2 */ -@EnableBinding(Source.class) @RestController public class SourceExample { - @Autowired private Source source; + private static final Log LOGGER = LogFactory.getLog(SourceExample.class); @PostMapping("/newMessage") public UserMessage sendMessage( @@ -45,4 +45,9 @@ public UserMessage sendMessage( this.source.output().send(new GenericMessage<>(userMessage)); return userMessage; } + + @Bean + public Consumer consumer() { + return str -> LOGGER.info("received " + str); + } } diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-security-iap-sample/src/main/java/com/example/ExampleController.java b/spring-cloud-gcp-samples/spring-cloud-gcp-security-iap-sample/src/main/java/com/example/ExampleController.java index 6c1a89c802..494ea93ec3 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-security-iap-sample/src/main/java/com/example/ExampleController.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-security-iap-sample/src/main/java/com/example/ExampleController.java @@ -16,11 +16,11 @@ package com.example; +import jakarta.servlet.http.HttpServletRequest; import java.util.Collections; import java.util.Map; import java.util.function.Function; import java.util.stream.Collectors; -import javax.servlet.http.HttpServletRequest; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.oauth2.jwt.Jwt; diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/pom.xml index 45f24acb79..d99c4e7e92 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/pom.xml @@ -3,7 +3,6 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.google.cloud spring-cloud-gcp-trace-sample Spring Cloud GCP Code Sample - Trace @@ -82,7 +81,6 @@ grpc-google-cloud-trace-v1 test - diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/Application.java b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/Application.java index 8be6b2ee78..d6ec2c0346 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/Application.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/Application.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2018 the original author or authors. + * Copyright 2017-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,11 +23,10 @@ import com.google.cloud.spring.pubsub.integration.outbound.PubSubMessageHandler; import com.google.cloud.spring.pubsub.support.BasicAcknowledgeablePubsubMessage; import com.google.cloud.spring.pubsub.support.GcpPubSubHeaders; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; @@ -56,19 +55,21 @@ public class Application implements WebMvcConfigurer { @Value("${sampleTopic}") private String sampleTopic; - @Autowired PubSubTemplate pubSubTemplate; + private final SpanCustomizer spanCustomizer; public static void main(String[] args) { SpringApplication.run(Application.class, args); } + public Application(SpanCustomizer spanCustomizer) { + this.spanCustomizer = spanCustomizer; + } + @Bean public RestTemplate restTemplate() { return new RestTemplate(); } - @Autowired private SpanCustomizer spanCustomizer; - @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor( diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/ExampleController.java b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/ExampleController.java index d87cc9d74d..4ede3e355f 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/ExampleController.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/ExampleController.java @@ -18,10 +18,9 @@ import com.google.cloud.spring.pubsub.core.PubSubTemplate; import com.google.pubsub.v1.PubsubMessage; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -38,10 +37,11 @@ public class ExampleController { private final WorkService workService; - @Autowired PubSubTemplate pubSubTemplate; + private final PubSubTemplate pubSubTemplate; - public ExampleController(WorkService workService) { + public ExampleController(WorkService workService, PubSubTemplate pubSubTemplate) { this.workService = workService; + this.pubSubTemplate = pubSubTemplate; } @GetMapping("/") @@ -64,7 +64,7 @@ public String meet() throws InterruptedException { } @RequestMapping("/pull") - public String pull() throws InterruptedException { + public String pull() { String result = "nothing"; PubsubMessage message = pubSubTemplate.pullNext(sampleSubscription); diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/WorkService.java b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/WorkService.java index 09932b907e..209e2f55b8 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/WorkService.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/WorkService.java @@ -18,11 +18,10 @@ import com.google.cloud.spring.pubsub.core.PubSubTemplate; import com.google.cloud.spring.pubsub.support.GcpPubSubHeaders; +import io.micrometer.tracing.annotation.NewSpan; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import org.springframework.cloud.sleuth.annotation.NewSpan; import org.springframework.integration.support.MessageBuilder; import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; @@ -40,12 +39,17 @@ public class WorkService { private final RestTemplate restTemplate; - @Autowired private PubSubTemplate pubSubTemplate; + private final PubSubTemplate pubSubTemplate; - @Autowired private MessageChannel pubsubOutputChannel; + private final MessageChannel pubsubOutputChannel; - public WorkService(RestTemplate restTemplate) { + public WorkService( + RestTemplate restTemplate, + PubSubTemplate pubSubTemplate, + MessageChannel pubsubOutputChannel) { this.restTemplate = restTemplate; + this.pubSubTemplate = pubSubTemplate; + this.pubsubOutputChannel = pubsubOutputChannel; } @NewSpan diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/resources/application.properties b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/resources/application.properties index c7675ced4c..6b0d47a5e6 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/resources/application.properties +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/resources/application.properties @@ -1,18 +1,11 @@ # To send 100% of traces to Stackdriver Trace -spring.sleuth.sampler.probability=1.0 +management.tracing.probability=1.0 # To ignore some frequently used URL patterns that are not useful in trace -spring.sleuth.web.skipPattern=(^cleanup.*|.+favicon.*) - -# avoid "async" traces -spring.sleuth.scheduled.enabled=false +#spring.sleuth.web.skipPattern=(^cleanup.*|.+favicon.*) # Enable Pub/Sub tracing using this property spring.cloud.gcp.trace.pubsub.enabled=true -# You should disable Spring Integration instrumentation by Sleuth as it's unnecessary when Pub/Sub tracing is enabled -spring.sleuth.integration.enabled=false - - sampleTopic = traceTopic sampleSubscription = traceSubscription \ No newline at end of file diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java index bb6ebfad11..15fb53245a 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java @@ -55,6 +55,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.test.autoconfigure.actuate.observability.AutoConfigureObservability; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.web.client.TestRestTemplate; @@ -73,6 +75,7 @@ @SpringBootTest( webEnvironment = WebEnvironment.RANDOM_PORT, classes = {Application.class}) +@AutoConfigureObservability class TraceSampleApplicationIntegrationTests { @DynamicPropertySource @@ -194,8 +197,7 @@ void testTracesAreLoggedCorrectly() { + " with " + trace.getSpansCount() + " spans (" - + trace.getSpansList().stream() - .map(TraceSpan::getName).toList() + + trace.getSpansList().stream().map(TraceSpan::getName).toList() + ")."); assertThat(trace.getTraceId()).isEqualTo(uuidString); @@ -203,6 +205,21 @@ void testTracesAreLoggedCorrectly() { // get /, visit-meet-endpoint, get, get /meet, get, get /meet, get, get /meet, // send-message-spring-integration, publish, send-message-pub-sub-template, publish, // next-message, on-message, next-message, on-message + + // One of the next problems is that the spans no longer have the same names as before. + // 14:41:07.857 [awaitility-thread] INFO c.e.TraceSampleApplicationIntegrationTests - + // Found trace! 2f732b09b8e94bcc8d9c4db2ccefafcb with 11 spans ([http get, + // messagesender.serviceactivator receive, messagesender receive, publish, publish, + // next-message, on-message, application.messagereceiver.serviceactivator receive, + // next-message, on-message, application.messagereceiver.serviceactivator receive]). + + // The other problem is: z.r.AsyncReporter$BoundedAsyncReporter - Dropped 1 spans due + // to AssertionError(com.google.protobuf.InvalidProtocolBufferException: Protocol + // message contained an invalid tag (zero).) + // java.lang.AssertionError: com.google.protobuf.InvalidProtocolBufferException: + // Protocol message contained an invalid tag (zero). + // at + // zipkin2.reporter.stackdriver.StackdriverSender.parseTraceIdPrefixedSpan(StackdriverSender.java:220) assertThat(trace.getSpansCount()).isGreaterThanOrEqualTo(16); log.debug("Trace spans match."); diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml index a8bd4f5ffb..34091fe4d7 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml @@ -20,7 +20,7 @@ org.springframework.boot - spring-boot-actuator + spring-boot-starter-actuator io.micrometer From 7bb67b710321533528a99be7639da2e44a45cb91 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 8 Nov 2022 20:01:27 -0500 Subject: [PATCH 048/179] merge dependencies pom --- .../main/java/com/google/cloud/spring/core/util/MapBuilder.java | 2 ++ spring-cloud-gcp-dependencies/pom.xml | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-cloud-gcp-core/src/main/java/com/google/cloud/spring/core/util/MapBuilder.java b/spring-cloud-gcp-core/src/main/java/com/google/cloud/spring/core/util/MapBuilder.java index 7ab27d2f07..1e89b61ba4 100644 --- a/spring-cloud-gcp-core/src/main/java/com/google/cloud/spring/core/util/MapBuilder.java +++ b/spring-cloud-gcp-core/src/main/java/com/google/cloud/spring/core/util/MapBuilder.java @@ -16,6 +16,7 @@ package com.google.cloud.spring.core.util; +import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.util.Collections; import java.util.HashMap; import java.util.Map; @@ -43,6 +44,7 @@ public final class MapBuilder { * @param value non-null value * @return itself for chaining */ + @CanIgnoreReturnValue public MapBuilder put(K key, V value) { Assert.notNull(key, "Map key cannot be null."); Assert.notNull(value, "Map value cannot be null."); diff --git a/spring-cloud-gcp-dependencies/pom.xml b/spring-cloud-gcp-dependencies/pom.xml index 1488d91aed..73139f09a6 100644 --- a/spring-cloud-gcp-dependencies/pom.xml +++ b/spring-cloud-gcp-dependencies/pom.xml @@ -287,7 +287,6 @@ cloud-sql-connector-r2dbc-mysql ${cloud-sql-socket-factory.version} - From 00a8381b83ff1f8fb6d15ca89e74954bbf8b16ce Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Wed, 9 Nov 2022 11:47:24 -0500 Subject: [PATCH 049/179] change sampling property --- .../src/main/resources/application.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/resources/application.properties b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/resources/application.properties index 6b0d47a5e6..6d08028307 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/resources/application.properties +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/resources/application.properties @@ -1,5 +1,5 @@ # To send 100% of traces to Stackdriver Trace -management.tracing.probability=1.0 +management.tracing.sampling.probability=1.0 # To ignore some frequently used URL patterns that are not useful in trace #spring.sleuth.web.skipPattern=(^cleanup.*|.+favicon.*) From d5116e5642399241492883ff212d4116f3ad469b Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Wed, 9 Nov 2022 11:48:09 -0500 Subject: [PATCH 050/179] exclude `ZipkinAutoConfiguration` --- .../trace/pubsub/TracePubSubAutoConfiguration.java | 9 --------- .../src/main/java/com/example/Application.java | 8 ++++++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java index 9b2a4067ab..d52779d26c 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java @@ -36,9 +36,6 @@ import org.springframework.context.annotation.Bean; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; -import zipkin2.Span; -import zipkin2.codec.BytesEncoder; -import zipkin2.codec.SpanBytesEncoder; @AutoConfiguration @ConditionalOnBean(Tracing.class) @@ -80,10 +77,4 @@ public SpanCustomizer spanCustomizer(Tracing tracing) { public MessagingTracing messagingTracing(Tracing tracing) { return MessagingTracing.create(tracing); } - - @Bean - @ConditionalOnMissingBean - public BytesEncoder spanBytesEncoder() { - return SpanBytesEncoder.PROTO3; - } } diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/Application.java b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/Application.java index d6ec2c0346..622c0d65a8 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/Application.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/Application.java @@ -30,6 +30,7 @@ import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; +import org.springframework.boot.actuate.autoconfigure.tracing.zipkin.ZipkinAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; import org.springframework.integration.annotation.ServiceActivator; @@ -44,7 +45,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; /** Sample spring boot application. */ -@SpringBootApplication +@SpringBootApplication(exclude = ZipkinAutoConfiguration.class) @Component public class Application implements WebMvcConfigurer { private static final Logger LOGGER = LoggerFactory.getLogger(Application.class); @@ -57,12 +58,15 @@ public class Application implements WebMvcConfigurer { private final SpanCustomizer spanCustomizer; + private final PubSubTemplate pubSubTemplate; + public static void main(String[] args) { SpringApplication.run(Application.class, args); } - public Application(SpanCustomizer spanCustomizer) { + public Application(SpanCustomizer spanCustomizer, PubSubTemplate pubSubTemplate) { this.spanCustomizer = spanCustomizer; + this.pubSubTemplate = pubSubTemplate; } @Bean From 1935ca9a5ff363a5ec9bf2fd43b835c134e8e630 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 10 Nov 2022 10:17:56 -0500 Subject: [PATCH 051/179] add firestore transaction manager --- ....springframework.boot.autoconfigure.AutoConfiguration.imports | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-cloud-gcp-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-cloud-gcp-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 8395a2bcc6..ce06be901f 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/spring-cloud-gcp-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -9,6 +9,7 @@ com.google.cloud.spring.autoconfigure.spanner.health.SpannerHealthIndicatorAutoC com.google.cloud.spring.autoconfigure.spanner.SpannerTransactionManagerAutoConfiguration com.google.cloud.spring.autoconfigure.datastore.GcpDatastoreAutoConfiguration com.google.cloud.spring.autoconfigure.firestore.GcpFirestoreAutoConfiguration +com.google.cloud.spring.autoconfigure.firestore.FirestoreTransactionManagerAutoConfiguration com.google.cloud.spring.autoconfigure.firestore.GcpFirestoreEmulatorAutoConfiguration com.google.cloud.spring.autoconfigure.datastore.health.DatastoreHealthIndicatorAutoConfiguration com.google.cloud.spring.autoconfigure.storage.GcpStorageAutoConfiguration From 84a057245eef46646a9cd751ff416821aad8a77c Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 10 Nov 2022 10:19:19 -0500 Subject: [PATCH 052/179] change org of `r2dbc-postgresql` --- spring-cloud-gcp-dependencies/pom.xml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/spring-cloud-gcp-dependencies/pom.xml b/spring-cloud-gcp-dependencies/pom.xml index 73139f09a6..1524da40d4 100644 --- a/spring-cloud-gcp-dependencies/pom.xml +++ b/spring-cloud-gcp-dependencies/pom.xml @@ -303,11 +303,8 @@ cloud-sql-connector-r2dbc-postgres ${cloud-sql-socket-factory.version} - - io.r2dbc + org.postgres r2dbc-postgresql ${r2dbc-postgres-driver.version} From 49904272746fc06d3916b6b1a0f1618d46637564 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 10 Nov 2022 10:51:49 -0500 Subject: [PATCH 053/179] update spring-shell-starter to 3.0.0-M1 --- .../spring-cloud-gcp-data-datastore-basic-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml index 7a02b85546..dedf3733c0 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml @@ -39,7 +39,7 @@ org.springframework.shell spring-shell-starter - 2.1.4 + 3.0.0-M1 From 484f7f90b7e0627b6c66ffd4e5cb5afe8d87ebac Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 10 Nov 2022 12:04:21 -0500 Subject: [PATCH 054/179] refactor datastore basic example --- .../main/java/com/example/DatastoreBookshelfExample.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/main/java/com/example/DatastoreBookshelfExample.java b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/main/java/com/example/DatastoreBookshelfExample.java index 97edd25f26..f668d03e15 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/main/java/com/example/DatastoreBookshelfExample.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/main/java/com/example/DatastoreBookshelfExample.java @@ -28,7 +28,11 @@ @ShellComponent @SpringBootApplication public class DatastoreBookshelfExample { - @Autowired BookRepository bookRepository; + private final BookRepository bookRepository; + + public DatastoreBookshelfExample(BookRepository bookRepository) { + this.bookRepository = bookRepository; + } public static void main(String[] args) { SpringApplication.run(DatastoreBookshelfExample.class, args); From bf7f47752698190b22d74af4bc4b700d0be0e646 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 10 Nov 2022 13:59:52 -0500 Subject: [PATCH 055/179] polish datastore example --- .../example/DatastoreRepositoryExample.java | 23 +++++++------ ...toreSampleApplicationIntegrationTests.java | 32 ++++++++----------- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-sample/src/main/java/com/example/DatastoreRepositoryExample.java b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-sample/src/main/java/com/example/DatastoreRepositoryExample.java index 1de4466593..3c70b2177e 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-sample/src/main/java/com/example/DatastoreRepositoryExample.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-sample/src/main/java/com/example/DatastoreRepositoryExample.java @@ -23,9 +23,7 @@ import java.util.HashSet; import java.util.List; import java.util.TreeSet; -import java.util.stream.Collectors; import java.util.stream.Stream; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -40,9 +38,16 @@ @SpringBootApplication public class DatastoreRepositoryExample { - @Autowired private SingerRepository singerRepository; + private final SingerRepository singerRepository; - @Autowired private TransactionalRepositoryService transactionalRepositoryService; + private final TransactionalRepositoryService transactionalRepositoryService; + + public DatastoreRepositoryExample( + SingerRepository singerRepository, + TransactionalRepositoryService transactionalRepositoryService) { + this.singerRepository = singerRepository; + this.transactionalRepositoryService = transactionalRepositoryService; + } public static void main(String[] args) { SpringApplication.run(DatastoreRepositoryExample.class, args); @@ -54,7 +59,7 @@ public CommandLineRunner commandLineRunner() { System.out.println("Remove all records from 'singers' kind"); this.singerRepository.deleteAll(); - this.singerRepository.save(new Singer("singer1", "John", "Doe", new HashSet())); + this.singerRepository.save(new Singer("singer1", "John", "Doe", new HashSet<>())); Singer janeDoe = new Singer( @@ -70,7 +75,7 @@ public CommandLineRunner commandLineRunner() { "singer3", "Richard", "Roe", - new HashSet<>(Arrays.asList(new Album("c", LocalDate.of(2000, Month.AUGUST, 31))))); + new HashSet<>(List.of(new Album("c", LocalDate.of(2000, Month.AUGUST, 31))))); richardRoe.setMessage("Hello, dear fans!".getBytes(StandardCharsets.UTF_8)); this.singerRepository.saveAll(Arrays.asList(janeDoe, richardRoe)); @@ -122,7 +127,7 @@ private void retrieveAndPrintSingers() { System.out.println("Fluent Query by example"); List singerNames = this.singerRepository.findBy( - example, q -> q.stream().map(Singer::firstAndLastName).collect(Collectors.toList())); + example, q -> q.stream().map(Singer::firstAndLastName).toList()); singerNames.forEach(System.out::println); // Pageable parameter @@ -169,14 +174,14 @@ private void createRelationshipsInTransaction(Singer singerA, Singer singerB) { List singers = this.singerRepository.findSingersByFirstBand(band3).stream() .map(Singer::getFirstName) - .collect(Collectors.toList()); + .toList(); System.out.println(singers); System.out.println("Find by reference"); List singers2 = this.singerRepository.findByFirstBand(band3).stream() .map(Singer::getFirstName) - .collect(Collectors.toList()); + .toList(); System.out.println(singers2); } } diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-sample/src/test/java/com/example/DatastoreSampleApplicationIntegrationTests.java b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-sample/src/test/java/com/example/DatastoreSampleApplicationIntegrationTests.java index 67f2604e61..8e0ad4a93c 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-sample/src/test/java/com/example/DatastoreSampleApplicationIntegrationTests.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-sample/src/test/java/com/example/DatastoreSampleApplicationIntegrationTests.java @@ -39,7 +39,6 @@ import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.CommandLineRunner; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.http.HttpEntity; @@ -65,23 +64,19 @@ webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) class DatastoreSampleApplicationIntegrationTests { - private static PrintStream systemOut; - private static ByteArrayOutputStream baos; final ObjectMapper mapper = new ObjectMapper(); @Autowired private TestRestTemplate restTemplate; - @Autowired private CommandLineRunner commandLineRunner; - @Autowired private SingerRepository singerRepository; @Autowired DatastoreTemplate datastoreTemplate; @BeforeAll static void checkToRun() { - systemOut = System.out; + PrintStream systemOut = System.out; baos = new ByteArrayOutputStream(); TeeOutputStream out = new TeeOutputStream(systemOut, baos); System.setOut(new PrintStream(out)); @@ -179,25 +174,24 @@ void basicTest() throws Exception { assertThat(baos.toString()) .contains( - "Query by example\n" - + "Singer{singerId='singer1', firstName='John', lastName='Doe', " - + "albums=[], firstBand=null, bands=, personalInstruments=}\n" - + "Singer{singerId='singer2', firstName='Jane', lastName='Doe', " - + "albums=[Album{albumName='a', date=2012-01-20}"); + """ + Query by example + Singer{singerId='singer1', firstName='John', lastName='Doe', albums=[], firstBand=null, bands=, personalInstruments=} + Singer{singerId='singer2', firstName='Jane', lastName='Doe', albums=[Album{albumName='a', date=2012-01-20}"""); assertThat(baos.toString()) .contains( - "Fluent Query by example\n" - + "Singer{singerId='singer1', firstName='John', lastName='Doe}\n" - + "Singer{singerId='singer2', firstName='Jane', lastName='Doe}"); + """ + Fluent Query by example + Singer{singerId='singer1', firstName='John', lastName='Doe} + Singer{singerId='singer2', firstName='Jane', lastName='Doe}"""); assertThat(baos.toString()) .contains( - "Using Pageable parameter\n" - + "Singer{singerId='singer1', firstName='John', lastName='Doe', " - + "albums=[], firstBand=null, bands=, personalInstruments=}\n" - + "Singer{singerId='singer2', firstName='Jane', lastName='Doe', " - + "albums=[Album{albumName='a', date=2012-01-20}"); + """ + Using Pageable parameter + Singer{singerId='singer1', firstName='John', lastName='Doe', albums=[], firstBand=null, bands=, personalInstruments=} + Singer{singerId='singer2', firstName='Jane', lastName='Doe', albums=[Album{albumName='a', date=2012-01-20}"""); assertThat(baos.toString()).contains("Find by reference with query\n" + "[Richard]"); From de3d74971892557d2dcc647979d53375e88a5b1a Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 10 Nov 2022 15:33:16 -0500 Subject: [PATCH 056/179] change table name --- .../src/main/java/com/example/Trader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-multi-sample/src/main/java/com/example/Trader.java b/spring-cloud-gcp-samples/spring-cloud-gcp-data-multi-sample/src/main/java/com/example/Trader.java index 8080efeec3..0f8232ab67 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-multi-sample/src/main/java/com/example/Trader.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-multi-sample/src/main/java/com/example/Trader.java @@ -21,7 +21,7 @@ import com.google.cloud.spring.data.spanner.core.mapping.Table; /** A sample entity. */ -@Table(name = "traders") +@Table(name = "traders_repository") public class Trader { @PrimaryKey @Column(name = "trader_id") From 211858c5d24b6776f9802e18e582b1827c1e1590 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 10 Nov 2022 17:15:24 -0500 Subject: [PATCH 057/179] change java version in ci --- .github/workflows/integrationTests.yaml | 4 ++-- .github/workflows/sonar.yaml | 4 ++-- .github/workflows/unitTests.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/integrationTests.yaml b/.github/workflows/integrationTests.yaml index cb0d6bfc2b..199da9b201 100644 --- a/.github/workflows/integrationTests.yaml +++ b/.github/workflows/integrationTests.yaml @@ -50,11 +50,11 @@ jobs: id: date run: echo "::set-output name=date::$(date +'%Y-%m-%d' --utc)" - uses: actions/checkout@v2 - - name: Setup Java 11 + - name: Setup Java 17 uses: actions/setup-java@v1 if: matrix.it != 'native' with: - java-version: 11 + java-version: 17 - name: Setup GraalVM uses: DeLaGuardo/setup-graalvm@4.0 if: matrix.it == 'native' # note that this is no longer in the matrix diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index 051cf91f00..2c166d3546 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -21,10 +21,10 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Cache SonarCloud packages uses: actions/cache@v2 with: diff --git a/.github/workflows/unitTests.yaml b/.github/workflows/unitTests.yaml index 4b40ce9dcb..e7421c9f40 100644 --- a/.github/workflows/unitTests.yaml +++ b/.github/workflows/unitTests.yaml @@ -103,7 +103,7 @@ jobs: - uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - uses: actions/cache@v2 id: mvn-cache From 5369490c3f23c73ba6e1a742931f98aef45c6131 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 10 Nov 2022 17:27:45 -0500 Subject: [PATCH 058/179] update failsafe plugin to 3.0.0-M7 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 59877a7110..f334e94a63 100644 --- a/pom.xml +++ b/pom.xml @@ -49,7 +49,7 @@ 3.8.1 2.8.2 - 2.22.1 + 3.0.0-M7 1.3.0 3.0.1 3.3.0 From 30f84c8e282fed2f425b85bb5a15b8a160d0b604 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 10 Nov 2022 17:49:17 -0500 Subject: [PATCH 059/179] remove java 8 and 11 --- .github/workflows/unitTests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unitTests.yaml b/.github/workflows/unitTests.yaml index e7421c9f40..9495f5817d 100644 --- a/.github/workflows/unitTests.yaml +++ b/.github/workflows/unitTests.yaml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - java: [8, 11, 17] + java: [17] steps: - name: Get current date id: date From 8b9e8007b9cdcb13ee92deb1bd5d697c5d36c6af Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 10 Nov 2022 17:56:09 -0500 Subject: [PATCH 060/179] remove unused import --- .../src/main/java/com/example/DatastoreBookshelfExample.java | 1 - 1 file changed, 1 deletion(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/main/java/com/example/DatastoreBookshelfExample.java b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/main/java/com/example/DatastoreBookshelfExample.java index f668d03e15..8e2f2cd7e7 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/main/java/com/example/DatastoreBookshelfExample.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/main/java/com/example/DatastoreBookshelfExample.java @@ -18,7 +18,6 @@ import java.util.ArrayList; import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.shell.standard.ShellComponent; From 6573b712ca890dd2dcc2fb7201059fa2935b4f01 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 10 Nov 2022 18:06:01 -0500 Subject: [PATCH 061/179] change javadoc plugin source --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f334e94a63..5eb158f03e 100644 --- a/pom.xml +++ b/pom.xml @@ -388,7 +388,7 @@ ${project.artifactId} - 8 + 17 From ba5d04f738f175ce2ea4133b2b8962977f3acd9d Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 10 Nov 2022 18:12:28 -0500 Subject: [PATCH 062/179] fix checkstyle error --- .../example/TraceSampleApplicationIntegrationTests.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java index 15fb53245a..3425d1a805 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java @@ -212,14 +212,6 @@ void testTracesAreLoggedCorrectly() { // messagesender.serviceactivator receive, messagesender receive, publish, publish, // next-message, on-message, application.messagereceiver.serviceactivator receive, // next-message, on-message, application.messagereceiver.serviceactivator receive]). - - // The other problem is: z.r.AsyncReporter$BoundedAsyncReporter - Dropped 1 spans due - // to AssertionError(com.google.protobuf.InvalidProtocolBufferException: Protocol - // message contained an invalid tag (zero).) - // java.lang.AssertionError: com.google.protobuf.InvalidProtocolBufferException: - // Protocol message contained an invalid tag (zero). - // at - // zipkin2.reporter.stackdriver.StackdriverSender.parseTraceIdPrefixedSpan(StackdriverSender.java:220) assertThat(trace.getSpansCount()).isGreaterThanOrEqualTo(16); log.debug("Trace spans match."); From 6ebfe0e185e3117bdaa6433e65bd61df907e4aaa Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 10 Nov 2022 18:18:47 -0500 Subject: [PATCH 063/179] upgrade javadoc plugin source to 17 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 5eb158f03e..860eacab00 100644 --- a/pom.xml +++ b/pom.xml @@ -379,7 +379,7 @@ docFX - 11 + 17 @@ -691,7 +691,7 @@ - 8 + 17 com.example, com.example.*, From 3eb1121b8be818cb68bbfbcf65c68e3f70bc30b9 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Fri, 11 Nov 2022 10:46:11 -0500 Subject: [PATCH 064/179] upgrade spring boot to 3.0.0-RC2 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 860eacab00..2ecbad5c2d 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,7 @@ 2022.0.0-M4 - 3.0.0-RC1 + 3.0.0-RC2 1.0.4 2.4.1 0.10.5 From 5c6741e43e89f7a6a240d22a5c25882bc96b6891 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Fri, 11 Nov 2022 15:51:30 -0500 Subject: [PATCH 065/179] upgrade spring boot to 3.0.0-RC2 in samples --- spring-cloud-gcp-samples/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud-gcp-samples/pom.xml b/spring-cloud-gcp-samples/pom.xml index c11cc247f9..943c261d36 100644 --- a/spring-cloud-gcp-samples/pom.xml +++ b/spring-cloud-gcp-samples/pom.xml @@ -6,7 +6,7 @@ org.springframework.boot spring-boot-starter-parent - 3.0.0-RC1 + 3.0.0-RC2 From 3a0566fbaa18735e0a6574c2ed255a0d7d75d59c Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Fri, 11 Nov 2022 15:52:32 -0500 Subject: [PATCH 066/179] fix spanner repository sample --- .../com/example/SpannerRepositoryExample.java | 77 +++++++++++-------- .../src/main/java/com/example/Trader.java | 8 +- .../SpannerRepositoryIntegrationTests.java | 13 ++-- 3 files changed, 56 insertions(+), 42 deletions(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/src/main/java/com/example/SpannerRepositoryExample.java b/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/src/main/java/com/example/SpannerRepositoryExample.java index 963d0c6896..7edcbed4da 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/src/main/java/com/example/SpannerRepositoryExample.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/src/main/java/com/example/SpannerRepositoryExample.java @@ -23,7 +23,6 @@ import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.ApplicationRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -35,39 +34,59 @@ public class SpannerRepositoryExample { private static final Log LOGGER = LogFactory.getLog(SpannerRepositoryExample.class); - @Autowired private TraderRepository traderRepository; + private final TraderRepository traderRepository; - @Autowired private TradeRepository tradeRepository; + private final TradeRepository tradeRepository; - @Autowired private SpannerSchemaUtils spannerSchemaUtils; + private final SpannerSchemaUtils spannerSchemaUtils; - @Autowired private SpannerDatabaseAdminTemplate spannerDatabaseAdminTemplate; + private final SpannerDatabaseAdminTemplate spannerDatabaseAdminTemplate; + + private static final String DEMO_TRADER_1 = "demo_trader1"; + + private static final String DEMO_TRADER_2 = "demo_trader2"; + + private static final String DEMO_TRADER_3 = "demo_trader3"; + + private static final String STOCK_1 = "STOCK1"; + + private static final String STOCK_2 = "STOCK2"; + + public SpannerRepositoryExample(TraderRepository traderRepository, + TradeRepository tradeRepository, + SpannerSchemaUtils spannerSchemaUtils, + SpannerDatabaseAdminTemplate spannerDatabaseAdminTemplate) { + this.traderRepository = traderRepository; + this.tradeRepository = tradeRepository; + this.spannerSchemaUtils = spannerSchemaUtils; + this.spannerDatabaseAdminTemplate = spannerDatabaseAdminTemplate; + } public void runExample() { createTablesIfNotExists(); this.traderRepository.deleteAll(); this.tradeRepository.deleteAll(); - this.traderRepository.save(new Trader("demo_trader1", "John", "Doe")); - this.traderRepository.save(new Trader("demo_trader2", "Mary", "Jane")); - this.traderRepository.save(new Trader("demo_trader3", "Scott", "Smith")); + this.traderRepository.save(new Trader(DEMO_TRADER_1, "John", "Doe")); + this.traderRepository.save(new Trader(DEMO_TRADER_2, "Mary", "Jane")); + this.traderRepository.save(new Trader(DEMO_TRADER_3, "Scott", "Smith")); this.tradeRepository.save( - new Trade("1", "BUY", 100.0, 50.0, "STOCK1", "demo_trader1", Arrays.asList(99.0, 101.00))); + new Trade("1", "BUY", 100.0, 50.0, STOCK_1, DEMO_TRADER_1, Arrays.asList(99.0, 101.00))); this.tradeRepository.save( - new Trade("2", "BUY", 105.0, 60.0, "STOCK2", "demo_trader1", Arrays.asList(99.0, 101.00))); + new Trade("2", "BUY", 105.0, 60.0, STOCK_2, DEMO_TRADER_1, Arrays.asList(99.0, 101.00))); this.tradeRepository.save( - new Trade("3", "BUY", 100.0, 50.0, "STOCK1", "demo_trader1", Arrays.asList(99.0, 101.00))); + new Trade("3", "BUY", 100.0, 50.0, STOCK_1, DEMO_TRADER_1, Arrays.asList(99.0, 101.00))); this.tradeRepository.save( - new Trade("1", "BUY", 100.0, 70.0, "STOCK2", "demo_trader2", Arrays.asList(99.0, 101.00))); + new Trade("1", "BUY", 100.0, 70.0, STOCK_2, DEMO_TRADER_2, Arrays.asList(99.0, 101.00))); this.tradeRepository.save( - new Trade("2", "BUY", 103.0, 50.0, "STOCK1", "demo_trader2", Arrays.asList(99.0, 101.00))); + new Trade("2", "BUY", 103.0, 50.0, STOCK_1, DEMO_TRADER_2, Arrays.asList(99.0, 101.00))); this.tradeRepository.save( - new Trade("3", "SELL", 100.0, 52.0, "STOCK2", "demo_trader2", Arrays.asList(99.0, 101.00))); + new Trade("3", "SELL", 100.0, 52.0, STOCK_2, DEMO_TRADER_2, Arrays.asList(99.0, 101.00))); this.tradeRepository.save( - new Trade("1", "SELL", 98.0, 50.0, "STOCK1", "demo_trader3", Arrays.asList(99.0, 101.00))); + new Trade("1", "SELL", 98.0, 50.0, STOCK_1, DEMO_TRADER_3, Arrays.asList(99.0, 101.00))); this.tradeRepository.save( - new Trade("2", "SELL", 110.0, 50.0, "STOCK2", "demo_trader3", Arrays.asList(99.0, 101.00))); + new Trade("2", "SELL", 110.0, 50.0, STOCK_2, DEMO_TRADER_3, Arrays.asList(99.0, 101.00))); LOGGER.info( "The table for trades has been cleared and " @@ -84,7 +103,7 @@ public void runExample() { LOGGER.info("Make a pageable query:"); List tradesPageOne = this.tradeRepository.findByActionAndSymbol(PageRequest.of(0, 1), "BUY", - "STOCK1" + STOCK_1 ); for (Trade t : tradesPageOne) { LOGGER.info(t); @@ -105,10 +124,11 @@ public void runExample() { LOGGER.info(this.tradeRepository.getAnyOneTrade()); LOGGER.info("A query method can also select properties in entities:"); - this.tradeRepository.getTradeIds("BUY").stream().forEach(x -> LOGGER.info(x)); + this.tradeRepository.getTradeIds("BUY").forEach(LOGGER::info); LOGGER.info("Lazy-loading collection of trades for 'demo_trader1':"); - LOGGER.info(this.traderRepository.findById("demo_trader1").get().getTrades()); + this.traderRepository.findById(DEMO_TRADER_1) + .ifPresent(trader -> LOGGER.info(trader.getTrades())); LOGGER.info("Try http://localhost:8080/trades in the browser to see all trades."); @@ -133,17 +153,14 @@ public void runExample() { this.traderRepository.save(trader3); this.traderRepository.save(trader4); - LOGGER.info( - "Find trader by Id and print out JSON field 'workAddress' as string: " - + this.traderRepository.findById("demo_trader_json1").get().getWorkAddress()); + this.traderRepository.findById("demo_trader_json1") + .ifPresent(trader -> LOGGER.info(String.format("Find trader by Id and print out JSON field 'workAddress' as string: %s", trader.getWorkAddress()))); - LOGGER.info( - "Find trader by Id and print out JSON field 'unusedDetails' as string: " - + this.traderRepository.findById("demo_trader_json3").get().getHomeAddress()); + this.traderRepository.findById("demo_trader_json3") + .ifPresent(trader -> LOGGER.info(String.format("Find trader by Id and print out JSON field 'unusedDetails' as string: %s", trader.getHomeAddress()))); - LOGGER.info( - "Find trader by Id and print out ARRAY field 'addressList' as string: " - + this.traderRepository.findById("demo_trader_json4").get().getAddressList().toString()); + this.traderRepository.findById("demo_trader_json4") + .ifPresent(trader -> LOGGER.info(String.format("Find trader by Id and print out ARRAY field 'addressList' as string: %s", trader.getAddressList()))); long count = this.traderRepository.getCountActive("true"); LOGGER.info("A query method can query on the properties of JSON values"); @@ -158,12 +175,12 @@ public void runExample() { void createTablesIfNotExists() { if (!this.spannerDatabaseAdminTemplate.tableExists("trades_repository")) { this.spannerDatabaseAdminTemplate.executeDdlStrings( - Arrays.asList(this.spannerSchemaUtils.getCreateTableDdlString(Trade.class)), true); + List.of(this.spannerSchemaUtils.getCreateTableDdlString(Trade.class)), true); } if (!this.spannerDatabaseAdminTemplate.tableExists("traders_repository")) { this.spannerDatabaseAdminTemplate.executeDdlStrings( - Arrays.asList(this.spannerSchemaUtils.getCreateTableDdlString(Trader.class)), true); + List.of(this.spannerSchemaUtils.getCreateTableDdlString(Trader.class)), true); } } diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/src/main/java/com/example/Trader.java b/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/src/main/java/com/example/Trader.java index 76218ca998..beeadb8877 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/src/main/java/com/example/Trader.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/src/main/java/com/example/Trader.java @@ -40,12 +40,12 @@ public class Trader { private String lastName; @Column(name = "CREATED_ON") - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MMM-dd HH:mm:ss z") - private java.sql.Timestamp createdOn; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") + private Timestamp createdOn; @Column(name = "MODIFIED_ON") - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MMM-dd HH:mm:ss z") - private List modifiedOn; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") + private List modifiedOn; @Interleaved(lazy = true) private List trades; diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/src/test/java/com/example/SpannerRepositoryIntegrationTests.java b/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/src/test/java/com/example/SpannerRepositoryIntegrationTests.java index e247343116..c21051f550 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/src/test/java/com/example/SpannerRepositoryIntegrationTests.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/src/test/java/com/example/SpannerRepositoryIntegrationTests.java @@ -18,7 +18,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import com.google.cloud.spring.data.spanner.core.admin.SpannerDatabaseAdminTemplate; import com.google.cloud.spring.data.spanner.core.admin.SpannerSchemaUtils; import java.sql.Timestamp; import java.time.ZoneOffset; @@ -64,8 +63,6 @@ class SpannerRepositoryIntegrationTests { @Autowired private SpannerSchemaUtils spannerSchemaUtils; - @Autowired private SpannerDatabaseAdminTemplate spannerDatabaseAdminTemplate; - @Autowired private SpannerRepositoryExample spannerRepositoryExample; @BeforeEach @@ -83,10 +80,10 @@ void testRestEndpoint() { TestRestTemplate testRestTemplate = new TestRestTemplate(); ResponseEntity> tradesResponse = testRestTemplate.exchange( - String.format("http://localhost:%s/trades/", this.port), + String.format("http://localhost:%s/trades", this.port), HttpMethod.GET, null, - new ParameterizedTypeReference>() {}); + new ParameterizedTypeReference<>() {}); assertThat(tradesResponse.getBody().getMetadata().getTotalElements()).isEqualTo(8); } @@ -103,10 +100,10 @@ void testRestEndpointPut() { String.format("http://localhost:%s/traders/t123", this.port), HttpMethod.PUT, new HttpEntity<>( - "{\"firstName\": \"John\", \"lastName\": \"Smith\", \"createdOn\": \"2000-Jan-02" - + " 03:04:05 UTC\", \"modifiedOn\": [\"2000-Jan-02 03:04:05 UTC\"]}", + "{\"firstName\": \"John\", \"lastName\": \"Smith\", \"createdOn\": \"2000-01-02" + + "T03:04:05.000Z\", \"modifiedOn\": [\"2000-01-02T03:04:05.000Z\"]}", headers), - new ParameterizedTypeReference() {}); + new ParameterizedTypeReference<>() {}); ZonedDateTime expectedUtcDate = ZonedDateTime.of(2000, 1, 2, 3, 4, 5, 0, ZoneOffset.UTC); Timestamp expectedTimestamp = new Timestamp(expectedUtcDate.toEpochSecond() * 1000L); From 9218a708a8cf3d1f4650706570d1da856a6e200d Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 14 Nov 2022 13:44:44 -0500 Subject: [PATCH 067/179] refactor pubsub example --- .../main/java/com/example/WebController.java | 2 +- ...bSubSampleApplicationIntegrationTests.java | 20 +++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/src/main/java/com/example/WebController.java b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/src/main/java/com/example/WebController.java index c74a35de74..0e14cc44f8 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/src/main/java/com/example/WebController.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/src/main/java/com/example/WebController.java @@ -37,7 +37,7 @@ @RestController public class WebController { - private static final Log LOGGER = LogFactory.getLog(PubSubApplication.class); + private static final Log LOGGER = LogFactory.getLog(WebController.class); private final PubSubTemplate pubSubTemplate; diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/src/test/java/com/example/PubSubSampleApplicationIntegrationTests.java b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/src/test/java/com/example/PubSubSampleApplicationIntegrationTests.java index 785df8aa17..0c7a9e7512 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/src/test/java/com/example/PubSubSampleApplicationIntegrationTests.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/src/test/java/com/example/PubSubSampleApplicationIntegrationTests.java @@ -31,7 +31,9 @@ import com.google.pubsub.v1.PullResponse; import com.google.pubsub.v1.PushConfig; import com.google.pubsub.v1.Subscription; +import com.google.pubsub.v1.SubscriptionName; import com.google.pubsub.v1.Topic; +import com.google.pubsub.v1.TopicName; import java.io.IOException; import java.util.List; import java.util.UUID; @@ -107,23 +109,23 @@ static void prepare() throws IOException { topicAdminClient = TopicAdminClient.create(); subscriptionAdminClient = SubscriptionAdminClient.create(); - topicAdminClient.createTopic(ProjectTopicName.of(projectName, SAMPLE_TEST_TOPIC)); - topicAdminClient.createTopic(ProjectTopicName.of(projectName, SAMPLE_TEST_TOPIC2)); + topicAdminClient.createTopic(TopicName.of(projectName, SAMPLE_TEST_TOPIC)); + topicAdminClient.createTopic(TopicName.of(projectName, SAMPLE_TEST_TOPIC2)); subscriptionAdminClient.createSubscription( - ProjectSubscriptionName.of(projectName, SAMPLE_TEST_SUBSCRIPTION1), - ProjectTopicName.of(projectName, SAMPLE_TEST_TOPIC), + SubscriptionName.of(projectName, SAMPLE_TEST_SUBSCRIPTION1), + TopicName.of(projectName, SAMPLE_TEST_TOPIC), PushConfig.getDefaultInstance(), 10); subscriptionAdminClient.createSubscription( - ProjectSubscriptionName.of(projectName, SAMPLE_TEST_SUBSCRIPTION2), - ProjectTopicName.of(projectName, SAMPLE_TEST_TOPIC2), + SubscriptionName.of(projectName, SAMPLE_TEST_SUBSCRIPTION2), + TopicName.of(projectName, SAMPLE_TEST_TOPIC2), PushConfig.getDefaultInstance(), 10); subscriptionAdminClient.createSubscription( - ProjectSubscriptionName.of(projectName, SAMPLE_TEST_SUBSCRIPTION3), - ProjectTopicName.of(projectName, SAMPLE_TEST_TOPIC2), + SubscriptionName.of(projectName, SAMPLE_TEST_SUBSCRIPTION3), + TopicName.of(projectName, SAMPLE_TEST_TOPIC2), PushConfig.getDefaultInstance(), 10); } @@ -259,6 +261,7 @@ private void deleteTopic(String topicName) { .untilAsserted( () -> { List projectTopics = getTopicNamesFromProject(); + assertThat(projectTopics).isNotNull(); assertThat(projectTopics).doesNotContain(projectTopicName); }); } @@ -294,6 +297,7 @@ private void deleteSubscription(String subscriptionName) { .untilAsserted( () -> { List subscriptions = getSubscriptionNamesFromProject(); + assertThat(subscriptions).isNotNull(); assertThat(subscriptions).doesNotContain(projectSubscriptionName); }); } From 851fdd8c103f1d26442c4c8bd6e4a536446e9692 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 14 Nov 2022 21:38:55 -0500 Subject: [PATCH 068/179] remove `ListenableFuture` as it is deprecated --- .../pubsub/health/PubSubHealthIndicator.java | 7 +- ...cpPubSubReactiveAutoConfigurationTest.java | 4 +- ...HealthIndicatorAutoConfigurationTests.java | 18 +-- .../health/PubSubHealthIndicatorTests.java | 12 +- ...bSubAutoConfigurationIntegrationTests.java | 8 +- ...PubSubChannelAdaptersIntegrationTests.java | 33 ++--- ...TemplateDocumentationIntegrationTests.java | 20 +-- .../spring/pubsub/core/PubSubTemplate.java | 22 +-- .../publisher/PubSubPublisherOperations.java | 8 +- .../publisher/PubSubPublisherTemplate.java | 17 ++- .../PubSubSubscriberOperations.java | 16 +-- .../subscriber/PubSubSubscriberTemplate.java | 135 +++++++++--------- .../outbound/PubSubMessageHandler.java | 44 ++---- .../reactive/PubSubReactiveFactory.java | 42 +++--- .../support/AcknowledgeablePubsubMessage.java | 4 +- .../BasicAcknowledgeablePubsubMessage.java | 6 +- .../pubsub/core/PubSubTemplateTests.java | 16 +-- .../PubSubSubscriberTemplateTests.java | 113 +++++++-------- .../outbound/PubSubMessageHandlerTests.java | 52 ++----- .../reactive/PubSubReactiveFactoryTests.java | 24 ++-- 20 files changed, 275 insertions(+), 326 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/health/PubSubHealthIndicator.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/health/PubSubHealthIndicator.java index 6b3f426944..c887ed89da 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/health/PubSubHealthIndicator.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/health/PubSubHealthIndicator.java @@ -23,6 +23,7 @@ import com.google.cloud.spring.pubsub.support.AcknowledgeablePubsubMessage; import java.util.List; import java.util.UUID; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; @@ -31,7 +32,6 @@ import org.springframework.boot.actuate.health.Health; import org.springframework.util.Assert; import org.springframework.util.StringUtils; -import org.springframework.util.concurrent.ListenableFuture; /** * Default implementation of {@link org.springframework.boot.actuate.health.HealthIndicator} for @@ -117,7 +117,7 @@ private void doHealthCheck(Runnable up, Consumer down, Consumer> future = + CompletableFuture> future = pubSubTemplate.pullAsync(this.subscription, 1, true); List messages = future.get(timeoutMillis, TimeUnit.MILLISECONDS); if (this.acknowledgeMessages) { @@ -131,8 +131,7 @@ boolean isHealthyException(ExecutionException e) { private boolean isHealthyResponseForUnspecifiedSubscription(ExecutionException e) { Throwable t = e.getCause(); - if (t instanceof ApiException) { - ApiException aex = (ApiException) t; + if (t instanceof ApiException aex) { Code errorCode = aex.getStatusCode().getCode(); return errorCode == StatusCode.Code.NOT_FOUND || errorCode == Code.PERMISSION_DENIED; } diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubReactiveAutoConfigurationTest.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubReactiveAutoConfigurationTest.java index f1d7e93d20..52f9802b62 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubReactiveAutoConfigurationTest.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubReactiveAutoConfigurationTest.java @@ -28,6 +28,7 @@ import com.google.cloud.spring.pubsub.reactive.PubSubReactiveFactory; import com.google.cloud.spring.pubsub.support.AcknowledgeablePubsubMessage; import java.util.Arrays; +import java.util.concurrent.CompletableFuture; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -41,7 +42,6 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.scheduling.annotation.AsyncResult; import reactor.core.scheduler.Scheduler; import reactor.core.scheduler.Schedulers; import reactor.test.StepVerifier; @@ -130,7 +130,7 @@ private void setUpThreadPrefixVerification(String threadPrefix) { arg -> { assertThat(Thread.currentThread().getName()).startsWith(threadPrefix); - return AsyncResult.forValue(Arrays.asList(mockMessage, mockMessage, mockMessage)); + return CompletableFuture.completedFuture(Arrays.asList(mockMessage, mockMessage, mockMessage)); }); } diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/health/PubSubHealthIndicatorAutoConfigurationTests.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/health/PubSubHealthIndicatorAutoConfigurationTests.java index 2616428fa1..97504d05f5 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/health/PubSubHealthIndicatorAutoConfigurationTests.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/health/PubSubHealthIndicatorAutoConfigurationTests.java @@ -17,21 +17,16 @@ package com.google.cloud.spring.autoconfigure.pubsub.health; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatCode; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.grpc.GrpcStatusCode; -import com.google.api.gax.rpc.ApiException; import com.google.auth.Credentials; import com.google.cloud.spring.autoconfigure.pubsub.GcpPubSubAutoConfiguration; import com.google.cloud.spring.core.GcpProjectIdProvider; @@ -39,17 +34,14 @@ import com.google.cloud.spring.pubsub.support.AcknowledgeablePubsubMessage; import java.util.Collections; import java.util.List; -import java.util.Map; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; +import java.util.concurrent.CompletableFuture; import java.util.regex.Pattern; import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.BeanInitializationException; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.boot.actuate.health.CompositeHealthContributor; +import org.springframework.boot.actuate.health.NamedContributor; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.test.context.runner.ApplicationContextRunner; -import org.springframework.util.concurrent.ListenableFuture; /** Tests for Pub/Sub Health Indicator autoconfiguration. */ class PubSubHealthIndicatorAutoConfigurationTests { @@ -57,7 +49,7 @@ class PubSubHealthIndicatorAutoConfigurationTests { private static final Pattern UUID_PATTERN = Pattern.compile("spring-cloud-gcp-healthcheck-[a-f0-9]{8}(-[a-f0-9]{4}){4}[a-f0-9]{8}"); - private ApplicationContextRunner baseContextRunner = + private final ApplicationContextRunner baseContextRunner = new ApplicationContextRunner() .withConfiguration( AutoConfigurations.of( @@ -111,7 +103,7 @@ void healthIndicatorPresent_customConfig() { void compositeHealthIndicatorPresentMultiplePubSubTemplate() throws Exception { PubSubTemplate mockPubSubTemplate1 = mock(PubSubTemplate.class); PubSubTemplate mockPubSubTemplate2 = mock(PubSubTemplate.class); - ListenableFuture> future = mock(ListenableFuture.class); + CompletableFuture> future = mock(CompletableFuture.class); when(future.get(anyLong(), any())).thenReturn(Collections.emptyList()); when(mockPubSubTemplate1.pullAsync(anyString(), anyInt(), anyBoolean())).thenReturn(future); @@ -134,7 +126,7 @@ void compositeHealthIndicatorPresentMultiplePubSubTemplate() throws Exception { ctx.getBean("pubSubHealthContributor", CompositeHealthContributor.class); assertThat(healthContributor).isNotNull(); assertThat(healthContributor.stream()).hasSize(2); - assertThat(healthContributor.stream().map(c -> c.getName())) + assertThat(healthContributor.stream().map(NamedContributor::getName)) .containsExactlyInAnyOrder("pubSubTemplate1", "pubSubTemplate2"); }); } diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/health/PubSubHealthIndicatorTests.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/health/PubSubHealthIndicatorTests.java index f6b6ce238d..24ee9821cb 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/health/PubSubHealthIndicatorTests.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/health/PubSubHealthIndicatorTests.java @@ -17,7 +17,6 @@ package com.google.cloud.spring.autoconfigure.pubsub.health; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyInt; @@ -34,9 +33,9 @@ import com.google.cloud.spring.pubsub.core.PubSubTemplate; import com.google.cloud.spring.pubsub.support.AcknowledgeablePubsubMessage; import io.grpc.Status.Code; -import java.util.Arrays; import java.util.Collections; import java.util.List; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; import org.junit.jupiter.api.Test; @@ -45,9 +44,7 @@ import org.junit.jupiter.params.provider.ValueSource; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import org.springframework.beans.factory.BeanInitializationException; import org.springframework.boot.actuate.health.Status; -import org.springframework.util.concurrent.ListenableFuture; /** Tests for the Pub/Sub Health Indicator. */ @ExtendWith(MockitoExtension.class) @@ -55,7 +52,8 @@ class PubSubHealthIndicatorTests { @Mock private PubSubTemplate pubSubTemplate; - @Mock ListenableFuture> future; + @Mock + CompletableFuture> future; @Test void healthUp_customSubscription() throws Exception { @@ -70,7 +68,7 @@ void healthUp_customSubscription() throws Exception { @Test void acknowledgeEnabled() throws Exception { AcknowledgeablePubsubMessage msg = mock(AcknowledgeablePubsubMessage.class); - when(future.get(anyLong(), any())).thenReturn(Arrays.asList(msg)); + when(future.get(anyLong(), any())).thenReturn(List.of(msg)); when(pubSubTemplate.pullAsync(anyString(), anyInt(), anyBoolean())).thenReturn(future); PubSubHealthIndicator healthIndicator = @@ -82,7 +80,7 @@ void acknowledgeEnabled() throws Exception { @Test void acknowledgeDisabled() throws Exception { AcknowledgeablePubsubMessage msg = mock(AcknowledgeablePubsubMessage.class); - when(future.get(anyLong(), any())).thenReturn(Arrays.asList(msg)); + when(future.get(anyLong(), any())).thenReturn(List.of(msg)); when(pubSubTemplate.pullAsync(anyString(), anyInt(), anyBoolean())).thenReturn(future); PubSubHealthIndicator healthIndicator = diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubAutoConfigurationIntegrationTests.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubAutoConfigurationIntegrationTests.java index c070fc82c0..017d518a47 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubAutoConfigurationIntegrationTests.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubAutoConfigurationIntegrationTests.java @@ -50,10 +50,10 @@ class PubSubAutoConfigurationIntegrationTests { private static GcpProjectIdProvider projectIdProvider; - private String fullSubscriptionNameSub1 = "projects/" + projectIdProvider.getProjectId() + "/subscriptions/test-sub-1"; - private String fullSubscriptionNameSub2 = "projects/" + projectIdProvider.getProjectId() + "/subscriptions/test-sub-2"; + private final String fullSubscriptionNameSub1 = "projects/" + projectIdProvider.getProjectId() + "/subscriptions/test-sub-1"; + private final String fullSubscriptionNameSub2 = "projects/" + projectIdProvider.getProjectId() + "/subscriptions/test-sub-2"; - private ApplicationContextRunner contextRunner = + private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() .withPropertyValues( "spring.cloud.gcp.pubsub.subscriber.retryableCodes=INTERNAL", @@ -125,7 +125,7 @@ void testPull() { .build(); PubSubConfiguration.Retry retry = gcpPubSubProperties.computeSubscriberRetrySettings( - subscriptionName, projectId); + ProjectSubscriptionName.of(projectId, subscriptionName)); assertThat(retry.getTotalTimeoutSeconds()).isEqualTo(600L); assertThat(retry.getInitialRetryDelaySeconds()).isEqualTo(100L); assertThat(retry.getRetryDelayMultiplier()).isEqualTo(1.3); diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubChannelAdaptersIntegrationTests.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubChannelAdaptersIntegrationTests.java index 7456333e24..0a37808477 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubChannelAdaptersIntegrationTests.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubChannelAdaptersIntegrationTests.java @@ -17,8 +17,7 @@ package com.google.cloud.spring.autoconfigure.pubsub.it; import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.times; +import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import com.google.cloud.spring.autoconfigure.core.GcpContextAutoConfiguration; @@ -31,6 +30,7 @@ import com.google.cloud.spring.pubsub.integration.AckMode; import com.google.cloud.spring.pubsub.integration.inbound.PubSubInboundChannelAdapter; import com.google.cloud.spring.pubsub.integration.outbound.PubSubMessageHandler; +import com.google.cloud.spring.pubsub.integration.outbound.PubSubMessageHandler.SuccessCallback; import com.google.cloud.spring.pubsub.support.BasicAcknowledgeablePubsubMessage; import com.google.cloud.spring.pubsub.support.GcpPubSubHeaders; import java.io.IOException; @@ -45,7 +45,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.EnabledIfSystemProperty; -import org.mockito.Mockito; +import org.mockito.ArgumentCaptor; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.test.context.runner.ApplicationContextRunner; @@ -61,7 +61,6 @@ import org.springframework.messaging.PollableChannel; import org.springframework.messaging.SubscribableChannel; import org.springframework.messaging.support.MessageBuilder; -import org.springframework.util.concurrent.ListenableFutureCallback; /** Tests for Pub/Sub channel adapters. */ @EnabledIfSystemProperty(named = "it.pubsub", matches = "true") @@ -82,7 +81,7 @@ static void enableTests() throws IOException { pubSubAdmin = new PubSubAdmin( new DefaultGcpProjectIdProvider(), - new DefaultCredentialsProvider(() -> new Credentials())); + new DefaultCredentialsProvider(Credentials::new)); } @BeforeEach @@ -141,9 +140,9 @@ void sendAndReceiveMessageAsString() { assertThat(payload).isEqualTo("I am a message (sendAndReceiveMessageAsString)."); assertThat(message.getHeaders()).hasSize(6); - assertThat(message.getHeaders().get("storm")).isEqualTo("lift your skinny fists"); - assertThat(message.getHeaders().get("static")).isEqualTo("lift your skinny fists"); - assertThat(message.getHeaders().get("sleep")).isEqualTo("lift your skinny fists"); + assertThat(message.getHeaders()).containsEntry("storm", "lift your skinny fists"); + assertThat(message.getHeaders()).containsEntry("static", "lift your skinny fists"); + assertThat(message.getHeaders()).containsEntry("sleep", "lift your skinny fists"); assertThat(message.getHeaders().get(GcpPubSubHeaders.ORIGINAL_MESSAGE)).isNotNull(); }); } @@ -295,16 +294,8 @@ void sendAndReceiveMessagePublishCallback() { .withUserConfiguration(PollableConfiguration.class, CommonConfiguration.class) .run( context -> { - ListenableFutureCallback callbackSpy = - Mockito.spy( - new ListenableFutureCallback() { - @Override - public void onFailure(Throwable ex) {} - - @Override - public void onSuccess(String result) {} - }); - context.getBean(PubSubMessageHandler.class).setPublishCallback(callbackSpy); + SuccessCallback successCallback = mock(SuccessCallback.class); + context.getBean(PubSubMessageHandler.class).setSuccessCallback(successCallback); context .getBean("inputChannel", MessageChannel.class) .send( @@ -317,9 +308,13 @@ public void onSuccess(String result) {} .getBean("outputChannel", PollableChannel.class) .receive(RECEIVE_TIMEOUT_MS); assertThat(message).isNotNull(); + + ArgumentCaptor stringArgumentCaptor = ArgumentCaptor.forClass(String.class); + ArgumentCaptor> messageArgumentCaptor = ArgumentCaptor.forClass(Message.class); Awaitility.await() .atMost(1, TimeUnit.SECONDS) - .untilAsserted(() -> verify(callbackSpy, times(1)).onSuccess(any())); + .untilAsserted(() -> + verify(successCallback).onSuccess(stringArgumentCaptor.capture(), messageArgumentCaptor.capture())); }); } diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubTemplateDocumentationIntegrationTests.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubTemplateDocumentationIntegrationTests.java index 0a46535ea4..165331ab7b 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubTemplateDocumentationIntegrationTests.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubTemplateDocumentationIntegrationTests.java @@ -43,7 +43,6 @@ import java.util.UUID; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.EnabledIfSystemProperty; @@ -53,13 +52,12 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.messaging.support.GenericMessage; -import org.springframework.util.concurrent.ListenableFutureCallback; /** Documentation tests for Pub/Sub. */ @EnabledIfSystemProperty(named = "it.pubsub-docs", matches = "true") class PubSubTemplateDocumentationIntegrationTests { - private ApplicationContextRunner contextRunner = + private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() .withPropertyValues( "spring.cloud.gcp.pubsub.subscriber.max-ack-extension-period=0", @@ -179,12 +177,12 @@ private void pubSubTest(PubSubTest pubSubTest, Class... configClass) { List subscriptions = pubSubAdmin.listSubscriptions().stream() .map(Subscription::getName) - .collect(Collectors.toList()); + .toList(); // end::list_subscriptions[] // tag::list_topics[] List topics = - pubSubAdmin.listTopics().stream().map(Topic::getName).collect(Collectors.toList()); + pubSubAdmin.listTopics().stream().map(Topic::getName).toList(); // end::list_topics[] pubSubAdmin.deleteSubscription(subscriptionName); @@ -372,14 +370,8 @@ public PubSubMessageHandler pubSubMessageHandler(PubSubTemplate pubSubTemplate) // end::message_router[] // tag::adapter_callback[] - adapter.setPublishCallback( - new ListenableFutureCallback() { - @Override - public void onFailure(Throwable ex) {} - - @Override - public void onSuccess(String result) {} - }); + adapter.setSuccessCallback((ackId, message) -> {}); + adapter.setFailureCallback((cause, message) -> {}); // end::adapter_callback[] return adapter; @@ -421,7 +413,7 @@ void run( throws ExecutionException, InterruptedException; } - class Logger { + static class Logger { List messages = new ArrayList<>(); void info(String message) { diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/PubSubTemplate.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/PubSubTemplate.java index 92ce884c7c..8fff15c844 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/PubSubTemplate.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/PubSubTemplate.java @@ -30,9 +30,9 @@ import java.util.Collection; import java.util.List; import java.util.Map; +import java.util.concurrent.CompletableFuture; import java.util.function.Consumer; import org.springframework.util.Assert; -import org.springframework.util.concurrent.ListenableFuture; /** * Default implementation of {@link PubSubOperations}. @@ -105,18 +105,18 @@ public void setMessageConverter(PubSubMessageConverter messageConverter) { * PubsubMessage} and then publish it. */ @Override - public ListenableFuture publish( + public CompletableFuture publish( String topic, T payload, Map headers) { return this.pubSubPublisherTemplate.publish(topic, payload, headers); } @Override - public ListenableFuture publish(String topic, T payload) { + public CompletableFuture publish(String topic, T payload) { return this.pubSubPublisherTemplate.publish(topic, payload, null); } @Override - public ListenableFuture publish(final String topic, PubsubMessage pubsubMessage) { + public CompletableFuture publish(final String topic, PubsubMessage pubsubMessage) { return this.pubSubPublisherTemplate.publish(topic, pubsubMessage); } @@ -142,7 +142,7 @@ public List pull( } @Override - public ListenableFuture> pullAsync( + public CompletableFuture> pullAsync( String subscription, Integer maxMessages, Boolean returnImmediately) { return this.pubSubSubscriberTemplate.pullAsync(subscription, maxMessages, returnImmediately); } @@ -155,7 +155,7 @@ public List> pullAndConvert( } @Override - public ListenableFuture>> pullAndConvertAsync( + public CompletableFuture>> pullAndConvertAsync( String subscription, Integer maxMessages, Boolean returnImmediately, Class payloadType) { return this.pubSubSubscriberTemplate.pullAndConvertAsync( subscription, maxMessages, returnImmediately, payloadType); @@ -168,7 +168,7 @@ public List pullAndAck( } @Override - public ListenableFuture> pullAndAckAsync( + public CompletableFuture> pullAndAckAsync( String subscription, Integer maxMessages, Boolean returnImmediately) { return this.pubSubSubscriberTemplate.pullAndAckAsync( subscription, maxMessages, returnImmediately); @@ -180,24 +180,24 @@ public PubsubMessage pullNext(String subscription) { } @Override - public ListenableFuture pullNextAsync(String subscription) { + public CompletableFuture pullNextAsync(String subscription) { return this.pubSubSubscriberTemplate.pullNextAsync(subscription); } @Override - public ListenableFuture ack( + public CompletableFuture ack( Collection acknowledgeablePubsubMessages) { return this.pubSubSubscriberTemplate.ack(acknowledgeablePubsubMessages); } @Override - public ListenableFuture nack( + public CompletableFuture nack( Collection acknowledgeablePubsubMessages) { return this.pubSubSubscriberTemplate.nack(acknowledgeablePubsubMessages); } @Override - public ListenableFuture modifyAckDeadline( + public CompletableFuture modifyAckDeadline( Collection acknowledgeablePubsubMessages, int ackDeadlineSeconds) { return this.pubSubSubscriberTemplate.modifyAckDeadline( diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/publisher/PubSubPublisherOperations.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/publisher/PubSubPublisherOperations.java index ba48697f52..01bef19a26 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/publisher/PubSubPublisherOperations.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/publisher/PubSubPublisherOperations.java @@ -18,7 +18,7 @@ import com.google.pubsub.v1.PubsubMessage; import java.util.Map; -import org.springframework.util.concurrent.ListenableFuture; +import java.util.concurrent.CompletableFuture; /** * An abstraction for Google Cloud Pub/Sub publisher operations. @@ -37,7 +37,7 @@ public interface PubSubPublisherOperations { * @param the type of the payload to publish * @return the listenable future of the call */ - ListenableFuture publish(String topic, T payload, Map headers); + CompletableFuture publish(String topic, T payload, Map headers); /** * Send a message to Pub/Sub. @@ -48,7 +48,7 @@ public interface PubSubPublisherOperations { * @param the type of the payload to publish * @return the listenable future of the call */ - ListenableFuture publish(String topic, T payload); + CompletableFuture publish(String topic, T payload); /** * Send a message to Pub/Sub. @@ -58,5 +58,5 @@ public interface PubSubPublisherOperations { * @param pubsubMessage a Google Cloud Pub/Sub API message * @return the listenable future of the call */ - ListenableFuture publish(String topic, PubsubMessage pubsubMessage); + CompletableFuture publish(String topic, PubsubMessage pubsubMessage); } diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/publisher/PubSubPublisherTemplate.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/publisher/PubSubPublisherTemplate.java index e9b9a91487..d70d1faae0 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/publisher/PubSubPublisherTemplate.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/publisher/PubSubPublisherTemplate.java @@ -27,11 +27,10 @@ import com.google.cloud.spring.pubsub.support.converter.SimplePubSubMessageConverter; import com.google.pubsub.v1.PubsubMessage; import java.util.Map; +import java.util.concurrent.CompletableFuture; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.util.Assert; -import org.springframework.util.concurrent.ListenableFuture; -import org.springframework.util.concurrent.SettableListenableFuture; /** * Default implementation of {@link PubSubPublisherOperations}. @@ -76,28 +75,28 @@ public void setMessageConverter(PubSubMessageConverter pubSubMessageConverter) { * PubsubMessage} and then publish it. */ @Override - public ListenableFuture publish( + public CompletableFuture publish( String topic, T payload, Map headers) { return publish(topic, this.pubSubMessageConverter.toPubSubMessage(payload, headers)); } @Override - public ListenableFuture publish(String topic, T payload) { + public CompletableFuture publish(String topic, T payload) { return publish(topic, payload, null); } @Override - public ListenableFuture publish(final String topic, PubsubMessage pubsubMessage) { + public CompletableFuture publish(final String topic, PubsubMessage pubsubMessage) { Assert.hasText(topic, "The topic can't be null or empty."); Assert.notNull(pubsubMessage, "The pubsubMessage can't be null."); ApiFuture publishFuture = this.publisherFactory.createPublisher(topic).publish(pubsubMessage); - final SettableListenableFuture settableFuture = new SettableListenableFuture<>(); + final CompletableFuture settableFuture = new CompletableFuture<>(); ApiFutures.addCallback( publishFuture, - new ApiFutureCallback() { + new ApiFutureCallback<>() { @Override public void onFailure(Throwable throwable) { @@ -105,7 +104,7 @@ public void onFailure(Throwable throwable) { LOGGER.warn(errorMessage, throwable); PubSubDeliveryException pubSubDeliveryException = new PubSubDeliveryException(pubsubMessage, errorMessage, throwable); - settableFuture.setException(pubSubDeliveryException); + settableFuture.completeExceptionally(pubSubDeliveryException); } @Override @@ -113,7 +112,7 @@ public void onSuccess(String result) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Publishing to " + topic + " was successful. Message ID: " + result); } - settableFuture.set(result); + settableFuture.complete(result); } }, directExecutor()); diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberOperations.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberOperations.java index 4bc9bd1cc9..9872896d11 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberOperations.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberOperations.java @@ -24,8 +24,8 @@ import com.google.pubsub.v1.PubsubMessage; import java.util.Collection; import java.util.List; +import java.util.concurrent.CompletableFuture; import java.util.function.Consumer; -import org.springframework.util.concurrent.ListenableFuture; /** * An abstraction for Google Cloud Pub/Sub subscription / pulling operations. @@ -101,7 +101,7 @@ List pullAndAck( * acknowledgeable messages * @since 1.2.3 */ - ListenableFuture> pullAndAckAsync( + CompletableFuture> pullAndAckAsync( String subscription, Integer maxMessages, Boolean returnImmediately); /** @@ -135,7 +135,7 @@ List pull( * acknowledgeable messages * @since 1.2.3 */ - ListenableFuture> pullAsync( + CompletableFuture> pullAsync( String subscription, Integer maxMessages, Boolean returnImmediately); /** @@ -176,7 +176,7 @@ List> pullAndConvert( * acknowledgeable messages * @since 1.2.3 */ - ListenableFuture>> pullAndConvertAsync( + CompletableFuture>> pullAndConvertAsync( String subscription, Integer maxMessages, Boolean returnImmediately, Class payloadType); /** @@ -199,7 +199,7 @@ ListenableFuture>> pullAndConv * {@code null} if none exists in the subscription * @since 1.2.3 */ - ListenableFuture pullNextAsync(String subscription); + CompletableFuture pullNextAsync(String subscription); /** * Acknowledge a batch of messages. The messages must have the same project id. @@ -207,7 +207,7 @@ ListenableFuture>> pullAndConv * @param acknowledgeablePubsubMessages messages to be acknowledged * @return {@code ListenableFuture} the ListenableFuture for the asynchronous execution */ - ListenableFuture ack( + CompletableFuture ack( Collection acknowledgeablePubsubMessages); /** @@ -216,7 +216,7 @@ ListenableFuture ack( * @param acknowledgeablePubsubMessages messages to be negatively acknowledged * @return {@code ListenableFuture} the ListenableFuture for the asynchronous execution */ - ListenableFuture nack( + CompletableFuture nack( Collection acknowledgeablePubsubMessages); /** @@ -228,7 +228,7 @@ ListenableFuture nack( * @return {@code ListenableFuture} the ListenableFuture for the asynchronous execution * @since 1.1 */ - ListenableFuture modifyAckDeadline( + CompletableFuture modifyAckDeadline( Collection acknowledgeablePubsubMessages, int ackDeadlineSeconds); } diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplate.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplate.java index 89e8cfcab2..e0b56a65dd 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplate.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplate.java @@ -42,6 +42,7 @@ import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.Executor; import java.util.concurrent.ExecutorService; @@ -52,8 +53,6 @@ import java.util.stream.Collectors; import org.springframework.beans.factory.DisposableBean; import org.springframework.util.Assert; -import org.springframework.util.concurrent.ListenableFuture; -import org.springframework.util.concurrent.SettableListenableFuture; /** * Default implementation of {@link PubSubSubscriberOperations}. @@ -83,7 +82,7 @@ public class PubSubSubscriberTemplate implements PubSubSubscriberOperations, Dis private Executor asyncPullExecutor = Runnable::run; - private ConcurrentHashMap subscriptionNameToStubMap = + private final ConcurrentHashMap subscriptionNameToStubMap = new ConcurrentHashMap<>(); /** @@ -203,20 +202,20 @@ private List pull(PullRequest pullRequest) { * @return the ListenableFuture for the asynchronous execution, returning the list of {@link * AcknowledgeablePubsubMessage} containing the ack ID, subscription and acknowledger */ - private ListenableFuture> pullAsync(PullRequest pullRequest) { + private CompletableFuture> pullAsync(PullRequest pullRequest) { Assert.notNull(pullRequest, "The pull request can't be null."); ApiFuture pullFuture = getSubscriberStub(pullRequest.getSubscription()).pullCallable().futureCall(pullRequest); - final SettableListenableFuture> settableFuture = - new SettableListenableFuture<>(); + final CompletableFuture> completableFuture = + new CompletableFuture<>(); ApiFutures.addCallback( pullFuture, - new ApiFutureCallback() { + new ApiFutureCallback<>() { @Override public void onFailure(Throwable throwable) { - settableFuture.setException(throwable); + completableFuture.completeExceptionally(throwable); } @Override @@ -225,12 +224,12 @@ public void onSuccess(PullResponse pullResponse) { toAcknowledgeablePubsubMessageList( pullResponse.getReceivedMessagesList(), pullRequest.getSubscription()); - settableFuture.set(result); + completableFuture.complete(result); } }, asyncPullExecutor); - return settableFuture; + return completableFuture; } private List toAcknowledgeablePubsubMessageList( @@ -254,7 +253,7 @@ public List pull( } @Override - public ListenableFuture> pullAsync( + public CompletableFuture> pullAsync( String subscription, Integer maxMessages, Boolean returnImmediately) { return pullAsync( this.subscriberFactory.createPullRequest(subscription, maxMessages, returnImmediately)); @@ -270,19 +269,22 @@ public List> pullAndConvert( } @Override - public ListenableFuture>> pullAndConvertAsync( + public CompletableFuture>> pullAndConvertAsync( String subscription, Integer maxMessages, Boolean returnImmediately, Class payloadType) { - final SettableListenableFuture>> settableFuture = - new SettableListenableFuture<>(); + final CompletableFuture>> completableFuture = + new CompletableFuture<>(); this.pullAsync(subscription, maxMessages, returnImmediately) - .addCallback( - ackableMessages -> - settableFuture.set( - this.toConvertedAcknowledgeablePubsubMessages(payloadType, ackableMessages)), - settableFuture::setException); + .whenComplete( + (ackableMessages, exception) -> { + if (exception != null) { + completableFuture.completeExceptionally(exception); + } + completableFuture.complete( + this.toConvertedAcknowledgeablePubsubMessages(payloadType, ackableMessages)); + }); - return settableFuture; + return completableFuture; } private @@ -312,34 +314,36 @@ public List pullAndAck( return ackableMessages.stream() .map(AcknowledgeablePubsubMessage::getPubsubMessage) - .collect(Collectors.toList()); + .toList(); } @Override - public ListenableFuture> pullAndAckAsync( + public CompletableFuture> pullAndAckAsync( String subscription, Integer maxMessages, Boolean returnImmediately) { PullRequest pullRequest = this.subscriberFactory.createPullRequest(subscription, maxMessages, returnImmediately); - final SettableListenableFuture> settableFuture = - new SettableListenableFuture<>(); + final CompletableFuture> completableFuture = + new CompletableFuture<>(); this.pullAsync(pullRequest) - .addCallback( - ackableMessages -> { + .whenComplete( + (ackableMessages, exception) -> { + if (exception != null) { + completableFuture.completeExceptionally(exception); + } if (!ackableMessages.isEmpty()) { ack(ackableMessages); } List messages = ackableMessages.stream() .map(AcknowledgeablePubsubMessage::getPubsubMessage) - .collect(Collectors.toList()); + .toList(); - settableFuture.set(messages); - }, - settableFuture::setException); + completableFuture.complete(messages); + }); - return settableFuture; + return completableFuture; } @Override @@ -350,18 +354,21 @@ public PubsubMessage pullNext(String subscription) { } @Override - public ListenableFuture pullNextAsync(String subscription) { - final SettableListenableFuture settableFuture = new SettableListenableFuture<>(); + public CompletableFuture pullNextAsync(String subscription) { + final CompletableFuture completableFuture = new CompletableFuture<>(); this.pullAndAckAsync(subscription, 1, true) - .addCallback( - messages -> { + .whenComplete( + (messages, exception) -> { + if (exception != null) { + completableFuture.completeExceptionally(exception); + } + PubsubMessage message = messages.isEmpty() ? null : messages.get(0); - settableFuture.set(message); - }, - settableFuture::setException); + completableFuture.complete(message); + }); - return settableFuture; + return completableFuture; } public SubscriberFactory getSubscriberFactory() { @@ -374,10 +381,10 @@ public SubscriberFactory getSubscriberFactory() { * exception was detected first. * * @param acknowledgeablePubsubMessages messages, potentially from different subscriptions. - * @return {@link ListenableFuture} indicating overall success or failure. + * @return {@link CompletableFuture} indicating overall success or failure. */ @Override - public ListenableFuture ack( + public CompletableFuture ack( Collection acknowledgeablePubsubMessages) { Assert.notEmpty( acknowledgeablePubsubMessages, "The acknowledgeablePubsubMessages can't be empty."); @@ -391,10 +398,10 @@ public ListenableFuture ack( * detected first. * * @param acknowledgeablePubsubMessages messages, potentially from different subscriptions. - * @return {@link ListenableFuture} indicating overall success or failure. + * @return {@link CompletableFuture} indicating overall success or failure. */ @Override - public ListenableFuture nack( + public CompletableFuture nack( Collection acknowledgeablePubsubMessages) { return modifyAckDeadline(acknowledgeablePubsubMessages, 0); } @@ -405,10 +412,10 @@ public ListenableFuture nack( * whichever exception was detected first. * * @param acknowledgeablePubsubMessages messages, potentially from different subscriptions. - * @return {@link ListenableFuture} indicating overall success or failure. + * @return {@link CompletableFuture} indicating overall success or failure. */ @Override - public ListenableFuture modifyAckDeadline( + public CompletableFuture modifyAckDeadline( Collection acknowledgeablePubsubMessages, int ackDeadlineSeconds) { Assert.notEmpty( @@ -455,17 +462,17 @@ private ApiFuture modifyAckDeadline( /** * Perform Pub/Sub operations (ack/nack/modifyAckDeadline) in per-subscription batches. * - *

The returned {@link ListenableFuture} will complete when either all batches completes + *

The returned {@link CompletableFuture} will complete when either all batches completes * successfully or when at least one fails. * *

In case of multiple batch failures, which exception will be in the final {@link - * ListenableFuture} is non-deterministic. + * CompletableFuture} is non-deterministic. * * @param acknowledgeablePubsubMessages messages, could be from different subscriptions. * @param asyncOperation specific Pub/Sub operation to perform. - * @return {@link ListenableFuture} indicating overall success or failure. + * @return {@link CompletableFuture} indicating overall success or failure. */ - private ListenableFuture doBatchedAsyncOperation( + private CompletableFuture doBatchedAsyncOperation( Collection acknowledgeablePubsubMessages, BiFunction, ApiFuture> asyncOperation) { @@ -485,7 +492,7 @@ private ListenableFuture doBatchedAsyncOperation( == 1, "The project id of all messages must match."); - SettableListenableFuture settableListenableFuture = new SettableListenableFuture<>(); + CompletableFuture settableListenableFuture = new CompletableFuture<>(); int numExpectedFutures = groupedMessages.size(); AtomicInteger numCompletedFutures = new AtomicInteger(); @@ -495,7 +502,7 @@ private ListenableFuture doBatchedAsyncOperation( ApiFutures.addCallback( ackApiFuture, - new ApiFutureCallback() { + new ApiFutureCallback<>() { @Override public void onFailure(Throwable throwable) { processResult(throwable); @@ -508,9 +515,9 @@ public void onSuccess(Empty empty) { private void processResult(Throwable throwable) { if (throwable != null) { - settableListenableFuture.setException(throwable); + settableListenableFuture.completeExceptionally(throwable); } else if (numCompletedFutures.incrementAndGet() == numExpectedFutures) { - settableListenableFuture.set(null); + settableListenableFuture.complete(null); } } }, @@ -569,17 +576,17 @@ public String getAckId() { } @Override - public ListenableFuture ack() { + public CompletableFuture ack() { return PubSubSubscriberTemplate.this.ack(Collections.singleton(this)); } @Override - public ListenableFuture nack() { + public CompletableFuture nack() { return modifyAckDeadline(0); } @Override - public ListenableFuture modifyAckDeadline(int ackDeadlineSeconds) { + public CompletableFuture modifyAckDeadline(int ackDeadlineSeconds) { return PubSubSubscriberTemplate.this.modifyAckDeadline( Collections.singleton(this), ackDeadlineSeconds); } @@ -616,28 +623,28 @@ private static class PushedAcknowledgeablePubsubMessage } @Override - public ListenableFuture ack() { - SettableListenableFuture settableListenableFuture = new SettableListenableFuture<>(); + public CompletableFuture ack() { + CompletableFuture settableListenableFuture = new CompletableFuture<>(); try { this.ackReplyConsumer.ack(); - settableListenableFuture.set(null); + settableListenableFuture.complete(null); } catch (Exception e) { - settableListenableFuture.setException(e); + settableListenableFuture.completeExceptionally(e); } return settableListenableFuture; } @Override - public ListenableFuture nack() { - SettableListenableFuture settableListenableFuture = new SettableListenableFuture<>(); + public CompletableFuture nack() { + CompletableFuture settableListenableFuture = new CompletableFuture<>(); try { this.ackReplyConsumer.nack(); - settableListenableFuture.set(null); + settableListenableFuture.complete(null); } catch (Exception e) { - settableListenableFuture.setException(e); + settableListenableFuture.completeExceptionally(e); } return settableListenableFuture; diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/integration/outbound/PubSubMessageHandler.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/integration/outbound/PubSubMessageHandler.java index c5cd50af87..dcab0f43c6 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/integration/outbound/PubSubMessageHandler.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/integration/outbound/PubSubMessageHandler.java @@ -21,9 +21,11 @@ import com.google.cloud.spring.pubsub.support.GcpPubSubHeaders; import java.util.HashMap; import java.util.Map; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import java.util.function.BiConsumer; import org.springframework.expression.EvaluationContext; import org.springframework.expression.Expression; import org.springframework.expression.common.LiteralExpression; @@ -35,8 +37,6 @@ import org.springframework.messaging.Message; import org.springframework.messaging.MessageHandlingException; import org.springframework.util.Assert; -import org.springframework.util.concurrent.ListenableFuture; -import org.springframework.util.concurrent.ListenableFutureCallback; /** * Outbound channel adapter to publish messages to Google Cloud Pub/Sub. @@ -58,7 +58,7 @@ public class PubSubMessageHandler extends AbstractMessageHandler { private Expression publishTimeoutExpression = new ValueExpression<>(DEFAULT_PUBLISH_TIMEOUT); - private ListenableFutureCallback publishCallback; + private BiConsumer publishCallback; private SuccessCallback successCallback; @@ -130,21 +130,10 @@ public void setPublishTimeout(long timeoutMillis) { setPublishTimeoutExpression(new ValueExpression<>(timeoutMillis)); } - protected ListenableFutureCallback getPublishCallback() { + protected BiConsumer getPublishCallback() { return this.publishCallback; } - /** - * Set the callback to be activated when the publish call resolves. - * - * @param publishCallback callback for the publish future - * @deprecated Use {@link #setSuccessCallback} and {@link #setFailureCallback} instead. - */ - @Deprecated - public void setPublishCallback(ListenableFutureCallback publishCallback) { - this.publishCallback = publishCallback; - } - /** * Set callback (can be a lambda) for processing the published message ID and the original {@code * Message} after the message was successfully published. @@ -217,15 +206,15 @@ protected void handleMessageInternal(Message message) { Map headers = new HashMap<>(); this.headerMapper.fromHeaders(message.getHeaders(), headers); - ListenableFuture pubsubFuture = + CompletableFuture pubsubFuture = this.pubSubPublisherOperations.publish(topic, payload, headers); if (this.publishCallback != null) { - pubsubFuture.addCallback(this.publishCallback); + pubsubFuture.whenComplete(this.publishCallback); } if (this.successCallback != null || this.failureCallback != null) { - pubsubFuture.addCallback(new PubSubPublishCallback(message)); + pubsubFuture.whenComplete(new PubSubPublishCallback(message)); } if (this.sync) { @@ -256,7 +245,7 @@ private String calculateTopic(Message message) { } private void blockOnPublishFuture( - ListenableFuture pubsubFuture, Message message, Long timeout) { + CompletableFuture pubsubFuture, Message message, Long timeout) { try { if (timeout == null || timeout < 0) { pubsubFuture.get(); @@ -298,25 +287,22 @@ public interface FailureCallback { * Publish callback that invokes the parent {@code PubSubMessageHandler}'s success or failure * callback, if available. */ - private class PubSubPublishCallback implements ListenableFutureCallback { - private Message message; + private class PubSubPublishCallback implements BiConsumer { + private final Message message; PubSubPublishCallback(Message message) { this.message = message; } @Override - public void onFailure(Throwable throwable) { - if (PubSubMessageHandler.this.failureCallback != null) { - PubSubMessageHandler.this.failureCallback.onFailure(throwable, message); - } - } - - @Override - public void onSuccess(String messageId) { + public void accept(String messageId, Throwable throwable) { if (PubSubMessageHandler.this.successCallback != null) { PubSubMessageHandler.this.successCallback.onSuccess(messageId, message); } + + if (PubSubMessageHandler.this.failureCallback != null) { + PubSubMessageHandler.this.failureCallback.onFailure(throwable, message); + } } } } diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/reactive/PubSubReactiveFactory.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/reactive/PubSubReactiveFactory.java index 02a8788afc..d384e28a87 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/reactive/PubSubReactiveFactory.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/reactive/PubSubReactiveFactory.java @@ -132,7 +132,7 @@ private void pollingPull( private Flux pullAll(String subscriptionName) { CompletableFuture> pullResponseFuture = - this.subscriberOperations.pullAsync(subscriptionName, maxMessages, true).completable(); + this.subscriberOperations.pullAsync(subscriptionName, maxMessages, true); return Mono.fromFuture(pullResponseFuture).flatMapMany(Flux::fromIterable); } @@ -142,8 +142,13 @@ private void backpressurePull( int intDemand = numRequested > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) numRequested; this.subscriberOperations .pullAsync(subscriptionName, intDemand, false) - .addCallback( - messages -> { + .whenComplete( + (messages, exception) -> { + if (exception != null) { + exceptionHandler(subscriptionName, numRequested, sink, exception); + return; + } + if (!sink.isCancelled()) { messages.forEach(sink::next); } @@ -153,19 +158,24 @@ private void backpressurePull( backpressurePull(subscriptionName, numToPull, sink); } } - }, - exception -> { - if (exception instanceof DeadlineExceededException) { - if (LOGGER.isTraceEnabled()) { - LOGGER.trace( - "Blocking pull timed out due to empty subscription " - + subscriptionName - + "; retrying."); - } - backpressurePull(subscriptionName, numRequested, sink); - } else { - sink.error(exception); - } }); } + + private void exceptionHandler( + String subscriptionName, + long numRequested, + FluxSink sink, + Throwable exception) { + if (exception instanceof DeadlineExceededException) { + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Blocking pull timed out due to empty subscription " + + subscriptionName + + "; retrying."); + } + backpressurePull(subscriptionName, numRequested, sink); + } else { + sink.error(exception); + } + } } diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/AcknowledgeablePubsubMessage.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/AcknowledgeablePubsubMessage.java index df17632380..9a93730477 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/AcknowledgeablePubsubMessage.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/AcknowledgeablePubsubMessage.java @@ -16,7 +16,7 @@ package com.google.cloud.spring.pubsub.support; -import org.springframework.util.concurrent.ListenableFuture; +import java.util.concurrent.CompletableFuture; /** * An extension of {@link BasicAcknowledgeablePubsubMessage} that exposes ack ID and subscription @@ -42,5 +42,5 @@ public interface AcknowledgeablePubsubMessage extends BasicAcknowledgeablePubsub * @return {@code ListenableFuture} * @since 1.1 */ - ListenableFuture modifyAckDeadline(int ackDeadlineSeconds); + CompletableFuture modifyAckDeadline(int ackDeadlineSeconds); } diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/BasicAcknowledgeablePubsubMessage.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/BasicAcknowledgeablePubsubMessage.java index f27432ac80..ce732f60c3 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/BasicAcknowledgeablePubsubMessage.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/BasicAcknowledgeablePubsubMessage.java @@ -18,7 +18,7 @@ import com.google.pubsub.v1.ProjectSubscriptionName; import com.google.pubsub.v1.PubsubMessage; -import org.springframework.util.concurrent.ListenableFuture; +import java.util.concurrent.CompletableFuture; /** * A {@link PubsubMessage} wrapper that allows it to be acknowledged. @@ -46,12 +46,12 @@ public interface BasicAcknowledgeablePubsubMessage { * * @return {@code ListenableFuture}} */ - ListenableFuture ack(); + CompletableFuture ack(); /** * Negatatively achnowledge (nack) the message asynchronously. * * @return {@code ListenableFuture}} */ - ListenableFuture nack(); + CompletableFuture nack(); } diff --git a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/PubSubTemplateTests.java b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/PubSubTemplateTests.java index cbb5474b57..e2f2759b3c 100644 --- a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/PubSubTemplateTests.java +++ b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/PubSubTemplateTests.java @@ -45,13 +45,13 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import org.springframework.util.concurrent.ListenableFuture; /** Tests for the Pub/Sub template. */ @ExtendWith(MockitoExtension.class) @@ -72,10 +72,8 @@ class PubSubTemplateTests { private SettableApiFuture settableApiFuture; private PubSubTemplate createTemplate() { - PubSubTemplate pubSubTemplate = - new PubSubTemplate(this.mockPublisherFactory, this.mockSubscriberFactory); - return pubSubTemplate; + return new PubSubTemplate(this.mockPublisherFactory, this.mockSubscriberFactory); } private PubSubPublisherTemplate createPublisherTemplate() { @@ -99,7 +97,7 @@ void testPublish() throws ExecutionException, InterruptedException { when(this.mockPublisherFactory.createPublisher("testTopic")).thenReturn(this.mockPublisher); when(this.mockPublisher.publish(isA(PubsubMessage.class))).thenReturn(this.settableApiFuture); this.settableApiFuture.set("result"); - ListenableFuture future = this.pubSubTemplate.publish("testTopic", this.pubsubMessage); + CompletableFuture future = this.pubSubTemplate.publish("testTopic", this.pubsubMessage); assertThat(future.get()).isEqualTo("result"); } @@ -181,10 +179,10 @@ void testSend_onFailure() { when(this.mockPublisherFactory.createPublisher("testTopic")).thenReturn(this.mockPublisher); when(this.mockPublisher.publish(isA(PubsubMessage.class))).thenReturn(this.settableApiFuture); - ListenableFuture future = this.pubSubTemplate.publish("testTopic", this.pubsubMessage); + CompletableFuture future = this.pubSubTemplate.publish("testTopic", this.pubsubMessage); this.settableApiFuture.setException(new Exception("future failed.")); - assertThatThrownBy(() -> future.get()) + assertThatThrownBy(future::get) .isInstanceOf(ExecutionException.class) .hasStackTraceContaining("future failed."); } @@ -193,9 +191,9 @@ void testSend_onFailure() { void testPublish_onFailureWithPayload() { when(this.mockPublisherFactory.createPublisher("testTopic")).thenReturn(this.mockPublisher); when(this.mockPublisher.publish(isA(PubsubMessage.class))).thenReturn(this.settableApiFuture); - ListenableFuture future = this.pubSubTemplate.publish("testTopic", this.pubsubMessage); + CompletableFuture future = this.pubSubTemplate.publish("testTopic", this.pubsubMessage); this.settableApiFuture.setException(new Exception("Publish failed")); - assertThatThrownBy(() -> future.get()) + assertThatThrownBy(future::get) .isInstanceOf(ExecutionException.class) .hasCauseInstanceOf(PubSubDeliveryException.class) .hasStackTraceContaining("Publish failed"); diff --git a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplateTests.java b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplateTests.java index bdccd9227f..1f96330b67 100644 --- a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplateTests.java +++ b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplateTests.java @@ -51,11 +51,13 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.Executor; import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import java.util.function.BiConsumer; import java.util.function.Consumer; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -67,8 +69,6 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.mockito.junit.jupiter.MockitoSettings; import org.mockito.quality.Strictness; -import org.springframework.util.concurrent.ListenableFuture; -import org.springframework.util.concurrent.ListenableFutureCallback; /** Unit tests for {@link PubSubSubscriberTemplate}. */ @ExtendWith(MockitoExtension.class) @@ -77,7 +77,7 @@ class PubSubSubscriberTemplateTests { private PubSubSubscriberTemplate pubSubSubscriberTemplate; - private PubsubMessage pubsubMessage = PubsubMessage.newBuilder().build(); + private final PubsubMessage pubsubMessage = PubsubMessage.newBuilder().build(); @Mock private MessageReceiver messageReceiver; @@ -208,14 +208,14 @@ void testSubscribe_AndManualAck() TestListenableFutureCallback testListenableFutureCallback = new TestListenableFutureCallback(); - ListenableFuture listenableFuture = this.message.getValue().ack(); + CompletableFuture completableFuture = this.message.getValue().ack(); - assertThat(listenableFuture).isNotNull(); + assertThat(completableFuture).isNotNull(); - listenableFuture.addCallback(testListenableFutureCallback); - listenableFuture.get(10L, TimeUnit.SECONDS); + completableFuture.whenComplete(testListenableFutureCallback); + completableFuture.get(10L, TimeUnit.SECONDS); - assertThat(listenableFuture.isDone()).isTrue(); + assertThat(completableFuture.isDone()).isTrue(); verify(this.ackReplyConsumer).ack(); @@ -232,14 +232,14 @@ void testSubscribe_AndManualNack() TestListenableFutureCallback testListenableFutureCallback = new TestListenableFutureCallback(); - ListenableFuture listenableFuture = this.message.getValue().nack(); + CompletableFuture completableFuture = this.message.getValue().nack(); - assertThat(listenableFuture).isNotNull(); + assertThat(completableFuture).isNotNull(); - listenableFuture.addCallback(testListenableFutureCallback); - listenableFuture.get(10L, TimeUnit.SECONDS); + completableFuture.whenComplete(testListenableFutureCallback); + completableFuture.get(10L, TimeUnit.SECONDS); - assertThat(listenableFuture.isDone()).isTrue(); + assertThat(completableFuture.isDone()).isTrue(); verify(this.ackReplyConsumer).nack(); @@ -264,14 +264,14 @@ void testSubscribeAndConvert_AndManualAck() TestListenableFutureCallback testListenableFutureCallback = new TestListenableFutureCallback(); - ListenableFuture listenableFuture = this.convertedMessage.getValue().ack(); + CompletableFuture completableFuture = this.convertedMessage.getValue().ack(); - assertThat(listenableFuture).isNotNull(); + assertThat(completableFuture).isNotNull(); - listenableFuture.addCallback(testListenableFutureCallback); - listenableFuture.get(10L, TimeUnit.SECONDS); + completableFuture.whenComplete(testListenableFutureCallback); + completableFuture.get(10L, TimeUnit.SECONDS); - assertThat(listenableFuture.isDone()).isTrue(); + assertThat(completableFuture.isDone()).isTrue(); verify(this.ackReplyConsumer).ack(); @@ -296,14 +296,14 @@ void testSubscribeAndConvert_AndManualNack() TestListenableFutureCallback testListenableFutureCallback = new TestListenableFutureCallback(); - ListenableFuture listenableFuture = this.convertedMessage.getValue().nack(); + CompletableFuture completableFuture = this.convertedMessage.getValue().nack(); - assertThat(listenableFuture).isNotNull(); + assertThat(completableFuture).isNotNull(); - listenableFuture.addCallback(testListenableFutureCallback); - listenableFuture.get(10L, TimeUnit.SECONDS); + completableFuture.whenComplete(testListenableFutureCallback); + completableFuture.get(10L, TimeUnit.SECONDS); - assertThat(listenableFuture.isDone()).isTrue(); + assertThat(completableFuture.isDone()).isTrue(); verify(this.ackReplyConsumer).nack(); @@ -340,14 +340,14 @@ void testPull_AndManualAck() TestListenableFutureCallback testListenableFutureCallback = new TestListenableFutureCallback(); - ListenableFuture listenableFuture = this.pubSubSubscriberTemplate.ack(result); + CompletableFuture completableFuture = this.pubSubSubscriberTemplate.ack(result); - assertThat(listenableFuture).isNotNull(); + assertThat(completableFuture).isNotNull(); - listenableFuture.addCallback(testListenableFutureCallback); - listenableFuture.get(10L, TimeUnit.SECONDS); + completableFuture.whenComplete(testListenableFutureCallback); + completableFuture.get(10L, TimeUnit.SECONDS); - assertThat(listenableFuture.isDone()).isTrue(); + assertThat(completableFuture.isDone()).isTrue(); assertThat(testListenableFutureCallback.getThrowable()).isNull(); } @@ -367,14 +367,14 @@ void testPull_AndManualNack() TestListenableFutureCallback testListenableFutureCallback = new TestListenableFutureCallback(); - ListenableFuture listenableFuture = this.pubSubSubscriberTemplate.nack(result); + CompletableFuture completableFuture = this.pubSubSubscriberTemplate.nack(result); - assertThat(listenableFuture).isNotNull(); + assertThat(completableFuture).isNotNull(); - listenableFuture.addCallback(testListenableFutureCallback); - listenableFuture.get(10L, TimeUnit.SECONDS); + completableFuture.whenComplete(testListenableFutureCallback); + completableFuture.get(10L, TimeUnit.SECONDS); - assertThat(listenableFuture.isDone()).isTrue(); + assertThat(completableFuture.isDone()).isTrue(); assertThat(testListenableFutureCallback.getThrowable()).isNull(); } @@ -396,13 +396,13 @@ void testPull_AndManualMultiSubscriptionAck() TestListenableFutureCallback testListenableFutureCallback = new TestListenableFutureCallback(); - ListenableFuture listenableFuture = this.pubSubSubscriberTemplate.ack(combinedMessages); - assertThat(listenableFuture).isNotNull(); + CompletableFuture completableFuture = this.pubSubSubscriberTemplate.ack(combinedMessages); + assertThat(completableFuture).isNotNull(); - listenableFuture.addCallback(testListenableFutureCallback); - listenableFuture.get(10L, TimeUnit.SECONDS); + completableFuture.whenComplete(testListenableFutureCallback); + completableFuture.get(10L, TimeUnit.SECONDS); - assertThat(listenableFuture.isDone()).isTrue(); + assertThat(completableFuture.isDone()).isTrue(); assertThat(testListenableFutureCallback.getThrowable()).isNull(); verify(this.ackCallable, times(2)).futureCall(any(AcknowledgeRequest.class)); verify(this.ackApiFuture, times(2)).addListener(any(), same(mockExecutor)); @@ -412,7 +412,7 @@ void testPull_AndManualMultiSubscriptionAck() void testPullAsync_AndManualAck() throws InterruptedException, ExecutionException, TimeoutException { - ListenableFuture> asyncResult = + CompletableFuture> asyncResult = this.pubSubSubscriberTemplate.pullAsync("sub", 1, true); List result = asyncResult.get(10L, TimeUnit.SECONDS); @@ -430,14 +430,14 @@ void testPullAsync_AndManualAck() TestListenableFutureCallback ackTestListenableFutureCallback = new TestListenableFutureCallback(); - ListenableFuture ackListenableFuture = this.pubSubSubscriberTemplate.ack(result); + CompletableFuture completableFuture = this.pubSubSubscriberTemplate.ack(result); - assertThat(ackListenableFuture).isNotNull(); + assertThat(completableFuture).isNotNull(); - ackListenableFuture.addCallback(ackTestListenableFutureCallback); - ackListenableFuture.get(10L, TimeUnit.SECONDS); + completableFuture.whenComplete(ackTestListenableFutureCallback); + completableFuture.get(10L, TimeUnit.SECONDS); - assertThat(ackListenableFuture.isDone()).isTrue(); + assertThat(completableFuture.isDone()).isTrue(); assertThat(ackTestListenableFutureCallback.getThrowable()).isNull(); } @@ -461,7 +461,7 @@ void testPullAndAck_NoMessages() { List result = this.pubSubSubscriberTemplate.pullAndAck("sub2", 1, true); - assertThat(result.size()).isZero(); + assertThat(result).isEmpty(); verify(this.pubSubSubscriberTemplate, never()).ack(any()); } @@ -469,7 +469,7 @@ void testPullAndAck_NoMessages() { @Test void testPullAndAckAsync() throws InterruptedException, ExecutionException, TimeoutException { - ListenableFuture> asyncResult = + CompletableFuture> asyncResult = this.pubSubSubscriberTemplate.pullAndAckAsync("sub2", 1, true); List result = asyncResult.get(10L, TimeUnit.SECONDS); @@ -488,13 +488,13 @@ void testPullAndAckAsync_NoMessages() throws InterruptedException, ExecutionException, TimeoutException { when(this.pullApiFuture.get()).thenReturn(PullResponse.newBuilder().build()); - ListenableFuture> asyncResult = + CompletableFuture> asyncResult = this.pubSubSubscriberTemplate.pullAndAckAsync("sub2", 1, true); List result = asyncResult.get(10L, TimeUnit.SECONDS); assertThat(asyncResult.isDone()).isTrue(); - assertThat(result.size()).isZero(); + assertThat(result).isEmpty(); verify(this.pubSubSubscriberTemplate, never()).ack(any()); } @@ -515,7 +515,7 @@ void testPullAndConvert() { @Test void testPullAndConvertAsync() throws InterruptedException, ExecutionException, TimeoutException { - ListenableFuture>> asyncResult = + CompletableFuture>> asyncResult = this.pubSubSubscriberTemplate.pullAndConvertAsync("sub2", 1, true, BigInteger.class); List> result = @@ -557,7 +557,7 @@ void testPullNext_NoMessages() { @Test void testPullNextAsync() throws InterruptedException, ExecutionException, TimeoutException { - ListenableFuture asyncResult = + CompletableFuture asyncResult = this.pubSubSubscriberTemplate.pullNextAsync("sub2"); PubsubMessage message = asyncResult.get(10L, TimeUnit.SECONDS); @@ -574,7 +574,7 @@ void testPullNextAsync_NoMessages() throws InterruptedException, ExecutionException, TimeoutException { when(this.pullApiFuture.get()).thenReturn(PullResponse.newBuilder().build()); - ListenableFuture asyncResult = + CompletableFuture asyncResult = this.pubSubSubscriberTemplate.pullNextAsync("sub2"); PubsubMessage message = asyncResult.get(10L, TimeUnit.SECONDS); @@ -586,20 +586,17 @@ void testPullNextAsync_NoMessages() verify(this.pubSubSubscriberTemplate, never()).ack(any()); } - private class TestListenableFutureCallback implements ListenableFutureCallback { + private static class TestListenableFutureCallback implements BiConsumer { private Throwable throwable; - @Override - public void onFailure(Throwable throwable) { - this.throwable = throwable; + public Throwable getThrowable() { + return this.throwable; } @Override - public void onSuccess(Void unusedVoid) {} + public void accept(Void unused, Throwable throwable) { - public Throwable getThrowable() { - return this.throwable; } } } diff --git a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/integration/outbound/PubSubMessageHandlerTests.java b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/integration/outbound/PubSubMessageHandlerTests.java index a88cd2c006..5bad9f52d9 100644 --- a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/integration/outbound/PubSubMessageHandlerTests.java +++ b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/integration/outbound/PubSubMessageHandlerTests.java @@ -31,6 +31,7 @@ import com.google.cloud.spring.pubsub.support.GcpPubSubHeaders; import java.time.Duration; import java.util.Collections; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicReference; import org.awaitility.Awaitility; import org.junit.jupiter.api.BeforeEach; @@ -45,8 +46,6 @@ import org.springframework.integration.expression.ValueExpression; import org.springframework.messaging.Message; import org.springframework.messaging.support.GenericMessage; -import org.springframework.util.concurrent.ListenableFutureCallback; -import org.springframework.util.concurrent.SettableListenableFuture; /** Tests for the Pub/Sub message handler. */ @ExtendWith(MockitoExtension.class) @@ -62,11 +61,11 @@ class PubSubMessageHandlerTests { @BeforeEach void setUp() { this.message = - new GenericMessage( + new GenericMessage<>( "testPayload".getBytes(), new MapBuilder().put("key1", "value1").put("key2", "value2").build()); - SettableListenableFuture future = new SettableListenableFuture<>(); - future.set("benfica"); + CompletableFuture future = new CompletableFuture<>(); + future.complete("benfica"); when(this.pubSubTemplate.publish(eq("testTopic"), eq("testPayload".getBytes()), anyMap())) .thenReturn(future); this.adapter = new PubSubMessageHandler(this.pubSubTemplate, "testTopic"); @@ -81,7 +80,7 @@ void testPublish() { @Test void testPublishDynamicTopic() { Message dynamicMessage = - new GenericMessage( + new GenericMessage<>( "testPayload".getBytes(), new MapBuilder() .put("key1", "value1") @@ -97,7 +96,7 @@ void testSendToExpressionTopic() { this.adapter.setTopicExpressionString("headers['sendToTopic']"); this.adapter.onInit(); Message expressionMessage = - new GenericMessage( + new GenericMessage<>( "testPayload".getBytes(), new MapBuilder() .put("key1", "value1") @@ -119,27 +118,6 @@ void testPublishSync() { verify(timeout).getValue(isNull(), eq(this.message), eq(Long.class)); } - @Test - void testPublishCallback() { - ListenableFutureCallback callbackSpy = - spy( - new ListenableFutureCallback() { - @Override - public void onFailure(Throwable ex) {} - - @Override - public void onSuccess(String result) {} - }); - - this.adapter.setPublishCallback(callbackSpy); - - this.adapter.handleMessage(this.message); - - assertThat(this.adapter.getPublishCallback()).isSameAs(callbackSpy); - - verify(callbackSpy).onSuccess("benfica"); - } - @Test void testSetPublishTimeoutExpressionStringWithNull() { @@ -221,7 +199,7 @@ void testSetHeaderMapperWithNull() { @Test void testPublishWithOrderingKey() { this.message = - new GenericMessage( + new GenericMessage<>( "testPayload".getBytes(), new MapBuilder().put(GcpPubSubHeaders.ORDERING_KEY, "key1").build()); @@ -234,15 +212,15 @@ void testPublishWithOrderingKey() { } @Test - void publishWithSuccessCallback() throws Exception { + void publishWithSuccessCallback() { - SettableListenableFuture future = new SettableListenableFuture<>(); - future.set("published12345"); + CompletableFuture future = new CompletableFuture<>(); + future.complete("published12345"); when(this.pubSubTemplate.publish(eq("testTopic"), eq("testPayload"), anyMap())) .thenReturn(future); Message testMessage = - new GenericMessage("testPayload", Collections.singletonMap("message_id", "123")); + new GenericMessage<>("testPayload", Collections.singletonMap("message_id", "123")); AtomicReference messageIdRef = new AtomicReference<>(); AtomicReference ackIdRef = new AtomicReference<>(); @@ -261,15 +239,15 @@ void publishWithSuccessCallback() throws Exception { } @Test - void publishWithFailureCallback() throws Exception { + void publishWithFailureCallback() { - SettableListenableFuture future = new SettableListenableFuture<>(); - future.setException(new RuntimeException("boom!")); + CompletableFuture future = new CompletableFuture<>(); + future.completeExceptionally(new RuntimeException("boom!")); when(this.pubSubTemplate.publish(eq("testTopic"), eq("testPayload"), anyMap())) .thenReturn(future); Message testMessage = - new GenericMessage("testPayload", Collections.singletonMap("message_id", "123")); + new GenericMessage<>("testPayload", Collections.singletonMap("message_id", "123")); AtomicReference failureCauseRef = new AtomicReference<>(); AtomicReference messageIdRef = new AtomicReference<>(); diff --git a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/reactive/PubSubReactiveFactoryTests.java b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/reactive/PubSubReactiveFactoryTests.java index 174f683f18..5c55d0655b 100644 --- a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/reactive/PubSubReactiveFactoryTests.java +++ b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/reactive/PubSubReactiveFactoryTests.java @@ -17,7 +17,7 @@ package com.google.cloud.spring.pubsub.reactive; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; @@ -36,6 +36,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.concurrent.CompletableFuture; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -43,7 +44,6 @@ import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.junit.jupiter.MockitoExtension; -import org.springframework.scheduling.annotation.AsyncResult; import reactor.test.StepVerifier; import reactor.test.scheduler.VirtualTimeScheduler; @@ -73,7 +73,7 @@ void testIllegalArgumentExceptionWithMaxMessagesLessThanOne() { } @Test - void testSequentialRequests() throws InterruptedException { + void testSequentialRequests() { setUpMessages("msg1", "msg2", "msg3", "msg4"); StepVerifier.withVirtualTime(() -> factory.poll("sub1", 10).map(this::messageToString), 1) @@ -92,8 +92,7 @@ void testSequentialRequests() throws InterruptedException { } @Test - void testSequentialRequestWithInsufficientDemandGetsSplitIntoTwoRequests() - throws InterruptedException { + void testSequentialRequestWithInsufficientDemandGetsSplitIntoTwoRequests() { setUpMessages("msg1", "stop", "msg2", "msg3", "msg4"); StepVerifier.withVirtualTime(() -> factory.poll("sub1", 10).map(this::messageToString), 4) @@ -110,7 +109,7 @@ void testSequentialRequestWithInsufficientDemandGetsSplitIntoTwoRequests() } @Test - void testDeadlineExceededCausesRetry() throws InterruptedException { + void testDeadlineExceededCausesRetry() { setUpMessages("timeout", "msg1", "msg2"); StepVerifier.withVirtualTime(() -> factory.poll("sub1", 10).map(this::messageToString), 2) @@ -126,8 +125,7 @@ void testDeadlineExceededCausesRetry() throws InterruptedException { } @Test - void testExceptionThrownByPubSubClientResultingInErrorStream() - throws InterruptedException { + void testExceptionThrownByPubSubClientResultingInErrorStream() { setUpMessages("msg1", "msg2", "throw"); StepVerifier.withVirtualTime(() -> factory.poll("sub1", 10).map(this::messageToString), 2) @@ -143,7 +141,7 @@ void testExceptionThrownByPubSubClientResultingInErrorStream() } @Test - void testUnlimitedDemand() throws InterruptedException { + void testUnlimitedDemand() { setUpMessages("msg1", "msg2", "stop", "msg3", "msg4", "stop", "msg5", "stop"); StepVerifier.withVirtualTime(() -> factory.poll("sub1", 10).map(this::messageToString)) @@ -233,19 +231,19 @@ private void setUpMessages(String... messages) { String nextPayload = msgList.remove(0); switch (nextPayload) { case "stop": - return AsyncResult.forValue(result); + return CompletableFuture.completedFuture(result); case "timeout": if (!result.isEmpty()) { fail("Bad setup -- 'throw' should be the first event in batch"); } - return AsyncResult.forExecutionException( + return CompletableFuture.failedFuture( new DeadlineExceededException( "this is a noop", null, GrpcStatusCode.of(Status.Code.DEADLINE_EXCEEDED), true)); case "throw": - return AsyncResult.forExecutionException( + return CompletableFuture.failedFuture( new RuntimeException("expected exception during pull of messages")); default: // continue processing @@ -259,7 +257,7 @@ private void setUpMessages(String... messages) { when(msg.getPubsubMessage()).thenReturn(pubsubMessage); result.add(msg); } - return AsyncResult.forValue(result); + return CompletableFuture.completedFuture(result); }); } } From b388e38f61d4d192e93c76afda34fd5ec8bb2a50 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 14 Nov 2022 21:40:20 -0500 Subject: [PATCH 069/179] remove `ListenableFuture` in samples --- .../com/example/ReceiverConfiguration.java | 3 +- .../java/com/example/SenderConfiguration.java | 16 +----- .../main/java/com/example/WebController.java | 3 +- .../main/java/com/example/WebController.java | 57 ++++++++----------- ...bSubSampleApplicationIntegrationTests.java | 4 +- 5 files changed, 30 insertions(+), 53 deletions(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-json-sample/src/main/java/com/example/ReceiverConfiguration.java b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-json-sample/src/main/java/com/example/ReceiverConfiguration.java index 75fba6ad63..81f632a86a 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-json-sample/src/main/java/com/example/ReceiverConfiguration.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-json-sample/src/main/java/com/example/ReceiverConfiguration.java @@ -22,6 +22,7 @@ import com.google.cloud.spring.pubsub.support.BasicAcknowledgeablePubsubMessage; import com.google.cloud.spring.pubsub.support.GcpPubSubHeaders; import java.util.ArrayList; +import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Qualifier; @@ -69,7 +70,7 @@ public void messageReceiver( @Bean @Qualifier("ProcessedPersonsList") - public ArrayList processedPersonsList() { + public List processedPersonsList() { return this.processedPersonsList; } } diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-json-sample/src/main/java/com/example/SenderConfiguration.java b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-json-sample/src/main/java/com/example/SenderConfiguration.java index f051fce87a..e6629e9951 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-json-sample/src/main/java/com/example/SenderConfiguration.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-json-sample/src/main/java/com/example/SenderConfiguration.java @@ -26,7 +26,6 @@ import org.springframework.integration.annotation.ServiceActivator; import org.springframework.integration.channel.DirectChannel; import org.springframework.messaging.MessageHandler; -import org.springframework.util.concurrent.ListenableFutureCallback; /** Configuration for sending custom JSON payloads to a Pub/Sub topic. */ @Configuration @@ -45,19 +44,8 @@ public DirectChannel pubSubOutputChannel() { @ServiceActivator(inputChannel = "pubSubOutputChannel") public MessageHandler messageSender(PubSubTemplate pubSubTemplate) { PubSubMessageHandler adapter = new PubSubMessageHandler(pubSubTemplate, TOPIC_NAME); - adapter.setPublishCallback( - new ListenableFutureCallback() { - @Override - public void onFailure(Throwable ex) { - LOGGER.info("There was an error sending the message."); - } - - @Override - public void onSuccess(String result) { - LOGGER.info("Message was sent successfully."); - } - }); - + adapter.setSuccessCallback((ackId, message) -> LOGGER.info("Message was sent successfully.")); + adapter.setFailureCallback((cause, message) -> LOGGER.info("There was an error sending the message.")); return adapter; } diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-json-sample/src/main/java/com/example/WebController.java b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-json-sample/src/main/java/com/example/WebController.java index baa7486323..9eb9dd549f 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-json-sample/src/main/java/com/example/WebController.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-json-sample/src/main/java/com/example/WebController.java @@ -17,7 +17,6 @@ package com.example; import com.example.SenderConfiguration.PubSubPersonGateway; -import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; @@ -35,7 +34,7 @@ public class WebController { @Autowired @Qualifier("ProcessedPersonsList") - private ArrayList processedPersonsList; + private List processedPersonsList; public WebController(PubSubPersonGateway pubSubPersonGateway) { this.pubSubPersonGateway = pubSubPersonGateway; diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/src/main/java/com/example/WebController.java b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/src/main/java/com/example/WebController.java index 0e14cc44f8..f9b9bc653e 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/src/main/java/com/example/WebController.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/src/main/java/com/example/WebController.java @@ -24,9 +24,9 @@ import java.util.Collection; import java.util.HashSet; import java.util.Set; +import java.util.concurrent.CompletableFuture; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.util.concurrent.ListenableFuture; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -85,22 +85,7 @@ public RedirectView pull(@RequestParam("subscription1") String subscriptionName) Collection messages = this.pubSubTemplate.pull(subscriptionName, 10, true); - if (messages.isEmpty()) { - return buildStatusView("No messages available for retrieval."); - } - - RedirectView returnView; - try { - ListenableFuture ackFuture = this.pubSubTemplate.ack(messages); - ackFuture.get(); - returnView = - buildStatusView(String.format("Pulled and acked %s message(s)", messages.size())); - } catch (Exception ex) { - LOGGER.warn("Acking failed.", ex); - returnView = buildStatusView("Acking failed"); - } - - return returnView; + return handleMessage(messages); } @GetMapping("/multipull") @@ -112,23 +97,7 @@ public RedirectView multipull( mixedSubscriptionMessages.addAll(this.pubSubTemplate.pull(subscriptionName1, 1000, true)); mixedSubscriptionMessages.addAll(this.pubSubTemplate.pull(subscriptionName2, 1000, true)); - if (mixedSubscriptionMessages.isEmpty()) { - return buildStatusView("No messages available for retrieval."); - } - - RedirectView returnView; - try { - ListenableFuture ackFuture = this.pubSubTemplate.ack(mixedSubscriptionMessages); - ackFuture.get(); - returnView = - buildStatusView( - String.format("Pulled and acked %s message(s)", mixedSubscriptionMessages.size())); - } catch (Exception ex) { - LOGGER.warn("Acking failed.", ex); - returnView = buildStatusView("Acking failed"); - } - - return returnView; + return handleMessage(mixedSubscriptionMessages); } @GetMapping("/subscribe") @@ -168,4 +137,24 @@ private RedirectView buildStatusView(String statusMessage) { view.addStaticAttribute("statusMessage", statusMessage); return view; } + + private RedirectView handleMessage(Collection messages) { + if (messages.isEmpty()) { + return buildStatusView("No messages available for retrieval."); + } + + RedirectView returnView; + try { + CompletableFuture ackFuture = this.pubSubTemplate.ack(messages); + ackFuture.get(); + returnView = + buildStatusView( + String.format("Pulled and acked %s message(s)", messages.size())); + } catch (Exception ex) { + LOGGER.warn("Acking failed.", ex); + returnView = buildStatusView("Acking failed"); + } + + return returnView; + } } diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/src/test/java/com/example/PubSubSampleApplicationIntegrationTests.java b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/src/test/java/com/example/PubSubSampleApplicationIntegrationTests.java index 0c7a9e7512..79a0294582 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/src/test/java/com/example/PubSubSampleApplicationIntegrationTests.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/src/test/java/com/example/PubSubSampleApplicationIntegrationTests.java @@ -150,7 +150,7 @@ static void cleanupPubsubClients() { } @BeforeEach - void initializeAppUrl() throws IOException { + void initializeAppUrl() { this.appUrl = "http://localhost:" + this.port; } @@ -236,7 +236,7 @@ private void createTopic(String topicName) { UriComponentsBuilder.fromHttpUrl(this.appUrl + "/createTopic") .queryParam("topicName", topicName) .toUriString(); - ResponseEntity response = this.testRestTemplate.postForEntity(url, null, String.class); + this.testRestTemplate.postForEntity(url, null, String.class); String projectTopicName = ProjectTopicName.format(projectName, topicName); await() From 9e671c8dd5a965d715618947b9adca57020b25b3 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 15 Nov 2022 10:21:49 -0500 Subject: [PATCH 070/179] remove `ListenableFuture` in bigquery module --- .../bigquery/core/BigQueryOperations.java | 18 ++--- .../bigquery/core/BigQueryTemplate.java | 68 ++++++++++--------- .../outbound/BigQueryFileMessageHandler.java | 22 +++--- .../spring/bigquery/BigQueryTemplateTest.java | 32 ++++----- .../BigQueryTemplateIntegrationTests.java | 12 ++-- .../BigQueryFileMessageHandlerTests.java | 9 ++- 6 files changed, 80 insertions(+), 81 deletions(-) diff --git a/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryOperations.java b/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryOperations.java index 2ec50410d8..8f2e059227 100644 --- a/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryOperations.java +++ b/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryOperations.java @@ -20,7 +20,7 @@ import com.google.cloud.bigquery.Job; import com.google.cloud.bigquery.Schema; import java.io.InputStream; -import org.springframework.util.concurrent.ListenableFuture; +import java.util.concurrent.CompletableFuture; /** * Defines operations for use with BigQuery. @@ -35,10 +35,10 @@ public interface BigQueryOperations { * @param tableName name of the table to write to * @param inputStream input stream of the table data to write * @param dataFormatOptions the format of the data to write - * @return {@link ListenableFuture} containing the BigQuery Job indicating completion of operation + * @return {@link CompletableFuture} containing the BigQuery Job indicating completion of operation * @throws BigQueryException if errors occur when loading data to the BigQuery table */ - ListenableFuture writeDataToTable( + CompletableFuture writeDataToTable( String tableName, InputStream inputStream, FormatOptions dataFormatOptions); /** @@ -62,10 +62,10 @@ ListenableFuture writeDataToTable( * @param inputStream input stream of the table data to write * @param dataFormatOptions the format of the data to write * @param schema the schema of the table being loaded - * @return {@link ListenableFuture} containing the BigQuery Job indicating completion of operation + * @return {@link CompletableFuture} containing the BigQuery Job indicating completion of operation * @throws BigQueryException if errors occur when loading data to the BigQuery table */ - ListenableFuture writeDataToTable( + CompletableFuture writeDataToTable( String tableName, InputStream inputStream, FormatOptions dataFormatOptions, Schema schema); /** @@ -75,10 +75,10 @@ ListenableFuture writeDataToTable( * * @param tableName name of the table to write to * @param jsonInputStream input stream of the json file to be written - * @return {@link ListenableFuture} containing the WriteApiResponse indicating completion of + * @return {@link CompletableFuture} containing the WriteApiResponse indicating completion of * operation */ - ListenableFuture writeJsonStream(String tableName, InputStream jsonInputStream); + CompletableFuture writeJsonStream(String tableName, InputStream jsonInputStream); /** * This method uses BigQuery Storage Write API to write new line delimited JSON file to the @@ -86,9 +86,9 @@ ListenableFuture writeDataToTable( * * @param tableName name of the table to write to * @param jsonInputStream input stream of the json file to be written - * @return {@link ListenableFuture} containing the WriteApiResponse indicating completion of + * @return {@link CompletableFuture} containing the WriteApiResponse indicating completion of * operation */ - ListenableFuture writeJsonStream( + CompletableFuture writeJsonStream( String tableName, InputStream jsonInputStream, Schema schema); } diff --git a/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryTemplate.java b/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryTemplate.java index d8fb8dc681..15d635f6e2 100644 --- a/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryTemplate.java +++ b/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryTemplate.java @@ -45,6 +45,7 @@ import java.nio.channels.Channels; import java.time.Duration; import java.util.Map; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.ScheduledFuture; import org.json.JSONArray; import org.json.JSONObject; @@ -54,8 +55,6 @@ import org.springframework.scheduling.concurrent.DefaultManagedTaskScheduler; import org.springframework.util.Assert; import org.springframework.util.StreamUtils; -import org.springframework.util.concurrent.ListenableFuture; -import org.springframework.util.concurrent.SettableListenableFuture; /** * Helper class which simplifies common operations done in BigQuery. @@ -203,13 +202,13 @@ public void setJobPollInterval(Duration jobPollInterval) { } @Override - public ListenableFuture writeDataToTable( + public CompletableFuture writeDataToTable( String tableName, InputStream inputStream, FormatOptions dataFormatOptions) { return this.writeDataToTable(tableName, inputStream, dataFormatOptions, null); } @Override - public ListenableFuture writeDataToTable( + public CompletableFuture writeDataToTable( String tableName, InputStream inputStream, FormatOptions dataFormatOptions, Schema schema) { TableId tableId = TableId.of(datasetName, tableName); @@ -247,11 +246,11 @@ public ListenableFuture writeDataToTable( * * @param tableName name of the table to write to * @param jsonInputStream input stream of the json file to be written - * @return {@link ListenableFuture} containing the WriteApiResponse indicating completion of + * @return {@link CompletableFuture} containing the WriteApiResponse indicating completion of * operation */ @Override - public ListenableFuture writeJsonStream( + public CompletableFuture writeJsonStream( String tableName, InputStream jsonInputStream, Schema schema) { createTable(tableName, schema); // create table if it's not already created return writeJsonStream(tableName, jsonInputStream); @@ -278,32 +277,29 @@ public Table createTable( * * @param tableName name of the table to write to * @param jsonInputStream input stream of the json file to be written - * @return {@link ListenableFuture} containing the WriteApiResponse indicating completion of + * @return {@link CompletableFuture} containing the WriteApiResponse indicating completion of * operation */ @Override - public ListenableFuture writeJsonStream( + public CompletableFuture writeJsonStream( String tableName, InputStream jsonInputStream) { - SettableListenableFuture writeApiFutureResponse = - new SettableListenableFuture<>(); + CompletableFuture writeApiFutureResponse = + new CompletableFuture<>(); Thread asyncTask = new Thread( () -> { try { WriteApiResponse apiResponse = getWriteApiResponse(tableName, jsonInputStream); - writeApiFutureResponse.set(apiResponse); + writeApiFutureResponse.complete(apiResponse); } catch (DescriptorValidationException | IOException e) { - writeApiFutureResponse.setException(e); + writeApiFutureResponse.completeExceptionally(e); logger.warn(String.format("Error: %s %n", e.getMessage()), e); - } catch (InterruptedException e) { - writeApiFutureResponse.setException(e); + } catch (Exception e) { + writeApiFutureResponse.completeExceptionally(e); // Restore interrupted state in case of an InterruptedException Thread.currentThread().interrupt(); - } catch (Throwable t) { - writeApiFutureResponse.setException(t); - Thread.currentThread().interrupt(); } }); asyncTask @@ -311,13 +307,16 @@ public ListenableFuture writeJsonStream( // thread can be run in the ExecutorService when it has been wired-in // register success and failure callback - writeApiFutureResponse.addCallback( - res -> logger.info("Data successfully written"), - res -> { - asyncTask.interrupt(); // interrupt the thread as the developer might have cancelled the - // Future. - // This can be replaced with interrupting the ExecutorService when it has been wired-in - logger.info("asyncTask interrupted"); + writeApiFutureResponse.whenComplete( + (writeApiResponse, exception) -> { + if (exception != null) { + asyncTask.interrupt(); // interrupt the thread as the developer might have cancelled the + // Future. + // This can be replaced with interrupting the ExecutorService when it has been wired-in + logger.info("asyncTask interrupted"); + return; + } + logger.info("Data successfully written"); }); return writeApiFutureResponse; @@ -423,9 +422,9 @@ public int getJsonWriterBatchSize() { return this.jsonWriterBatchSize; } - private SettableListenableFuture createJobFuture(Job pendingJob) { + private CompletableFuture createJobFuture(Job pendingJob) { // Prepare the polling task for the ListenableFuture result returned to end-user - SettableListenableFuture result = new SettableListenableFuture<>(); + CompletableFuture result = new CompletableFuture<>(); ScheduledFuture scheduledFuture = taskScheduler.scheduleAtFixedRate( () -> { @@ -433,22 +432,25 @@ private SettableListenableFuture createJobFuture(Job pendingJob) { Job job = pendingJob.reload(); if (State.DONE.equals(job.getStatus().getState())) { if (job.getStatus().getError() != null) { - result.setException( + result.completeExceptionally( new BigQueryException(job.getStatus().getError().getMessage())); } else { - result.set(job); + result.complete(job); } } } catch (Exception e) { - result.setException(new BigQueryException(e.getMessage())); + result.completeExceptionally(new BigQueryException(e.getMessage())); } }, this.jobPollInterval); - result.addCallback( - response -> scheduledFuture.cancel(true), - response -> { - pendingJob.cancel(); + result.whenComplete( + (response, exception) -> { + if (exception != null) { + pendingJob.cancel(); + scheduledFuture.cancel(true); + return; + } scheduledFuture.cancel(true); }); diff --git a/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/integration/outbound/BigQueryFileMessageHandler.java b/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/integration/outbound/BigQueryFileMessageHandler.java index 70084d8cb4..f2c5e2d080 100644 --- a/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/integration/outbound/BigQueryFileMessageHandler.java +++ b/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/integration/outbound/BigQueryFileMessageHandler.java @@ -29,6 +29,7 @@ import java.io.IOException; import java.io.InputStream; import java.time.Duration; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; @@ -43,7 +44,6 @@ import org.springframework.messaging.Message; import org.springframework.messaging.MessageHandlingException; import org.springframework.util.Assert; -import org.springframework.util.concurrent.ListenableFuture; /** * A {@link org.springframework.messaging.MessageHandler} which handles sending and loading files to @@ -166,7 +166,7 @@ public void setTimeout(Duration timeout) { * *

If set to true, the handler runs synchronously and returns {@link Job} for message * responses. If set to false, the handler will return {@link - * org.springframework.util.concurrent.ListenableFuture} of the Job as the response for each + * CompletableFuture} of the Job as the response for each * message. * * @param sync whether {@link BigQueryFileMessageHandler} should wait synchronously for jobs to @@ -189,7 +189,7 @@ protected Object handleRequestMessage(Message message) { Assert.notNull(formatOptions, "Data file formatOptions must not be null."); try (InputStream inputStream = convertToInputStream(message.getPayload())) { - ListenableFuture jobFuture = + CompletableFuture jobFuture = this.bigQueryTemplate.writeDataToTable(tableName, inputStream, formatOptions, schema); if (this.sync) { @@ -216,14 +216,14 @@ protected Object handleRequestMessage(Message message) { private static InputStream convertToInputStream(Object payload) throws IOException { InputStream result; - if (payload instanceof File) { - result = new BufferedInputStream(new FileInputStream((File) payload)); - } else if (payload instanceof byte[]) { - result = new ByteArrayInputStream((byte[]) payload); - } else if (payload instanceof InputStream) { - result = (InputStream) payload; - } else if (payload instanceof Resource) { - result = ((Resource) payload).getInputStream(); + if (payload instanceof File file) { + result = new BufferedInputStream(new FileInputStream(file)); + } else if (payload instanceof byte[] bytes) { + result = new ByteArrayInputStream(bytes); + } else if (payload instanceof InputStream inputStream) { + result = inputStream; + } else if (payload instanceof Resource resource) { + result = resource.getInputStream(); } else { throw new IllegalArgumentException( String.format( diff --git a/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/BigQueryTemplateTest.java b/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/BigQueryTemplateTest.java index 5ef86e4a15..324dbcab95 100644 --- a/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/BigQueryTemplateTest.java +++ b/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/BigQueryTemplateTest.java @@ -17,8 +17,8 @@ package com.google.cloud.spring.bigquery; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.doThrow; @@ -47,6 +47,7 @@ import java.time.Duration; import java.util.HashMap; import java.util.Map; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -54,13 +55,12 @@ import org.mockito.Mockito; import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.scheduling.concurrent.DefaultManagedTaskScheduler; -import org.springframework.util.concurrent.ListenableFuture; @ExtendWith(MockitoExtension.class) class BigQueryTemplateTest { private BigQueryWriteClient bigQueryWriteClientMock; - private String newLineSeperatedJson = + private final String newLineSeperatedJson = "{\"CompanyName\":\"TALES\",\"Description\":\"mark\",\"SerialNumber\":97,\"Leave\":0,\"EmpName\":\"Mark\"}\n" + "{\"CompanyName\":\"1Q84\",\"Description\":\"ark\",\"SerialNumber\":978,\"Leave\":0,\"EmpName\":\"HARUKI\"}"; private static final String PROJECT = "project"; @@ -72,7 +72,7 @@ class BigQueryTemplateTest { private BigQueryRpc bigqueryRpcMock; private BigQuery bigquery; private BigQueryOptions options; - private Map bqInitSettings = new HashMap<>(); + private final Map bqInitSettings = new HashMap<>(); BigQueryTemplate bqTemplateSpy; private Schema getDefaultSchema() { @@ -117,7 +117,7 @@ private BigQueryOptions createBigQueryOptionsForProject( void getWriteApiResponseTest() throws DescriptorValidationException, IOException, InterruptedException { - InputStream jsoninputStream = new ByteArrayInputStream(newLineSeperatedJson.getBytes()); + InputStream jsonInputStream = new ByteArrayInputStream(newLineSeperatedJson.getBytes()); doReturn(mock(BigQueryJsonDataWriter.class)) .when(bqTemplateSpy) @@ -130,7 +130,7 @@ void getWriteApiResponseTest() .when(bqTemplateSpy) .getCommitResponse(any(TableName.class), any(BigQueryJsonDataWriter.class)); - WriteApiResponse apiRes = bqTemplateSpy.getWriteApiResponse(TABLE, jsoninputStream); + WriteApiResponse apiRes = bqTemplateSpy.getWriteApiResponse(TABLE, jsonInputStream); assertTrue(apiRes.isSuccessful()); assertEquals(0, apiRes.getErrors().size()); @@ -140,15 +140,15 @@ void getWriteApiResponseTest() void writeJsonStreamTest() throws DescriptorValidationException, IOException, InterruptedException, ExecutionException { - InputStream jsoninputStream = new ByteArrayInputStream(newLineSeperatedJson.getBytes()); + InputStream jsonInputStream = new ByteArrayInputStream(newLineSeperatedJson.getBytes()); WriteApiResponse apiResponse = new WriteApiResponse(); apiResponse.setSuccessful(true); doReturn(apiResponse) .when(bqTemplateSpy) .getWriteApiResponse(any(String.class), any(InputStream.class)); - ListenableFuture futRes = - bqTemplateSpy.writeJsonStream(TABLE, jsoninputStream); + CompletableFuture futRes = + bqTemplateSpy.writeJsonStream(TABLE, jsonInputStream); WriteApiResponse apiRes = futRes.get(); assertTrue(apiRes.isSuccessful()); assertEquals(0, apiRes.getErrors().size()); @@ -158,7 +158,7 @@ void writeJsonStreamTest() void writeJsonStreamWithSchemaTest() throws DescriptorValidationException, IOException, InterruptedException, ExecutionException { - InputStream jsoninputStream = new ByteArrayInputStream(newLineSeperatedJson.getBytes()); + InputStream jsonInputStream = new ByteArrayInputStream(newLineSeperatedJson.getBytes()); WriteApiResponse apiResponse = new WriteApiResponse(); apiResponse.setSuccessful(true); doReturn(apiResponse) @@ -169,8 +169,8 @@ void writeJsonStreamWithSchemaTest() .when(bqTemplateSpy) .createTable(any(String.class), any(Schema.class)); - ListenableFuture futRes = - bqTemplateSpy.writeJsonStream(TABLE, jsoninputStream, getDefaultSchema()); + CompletableFuture futRes = + bqTemplateSpy.writeJsonStream(TABLE, jsonInputStream, getDefaultSchema()); WriteApiResponse apiRes = futRes.get(); assertTrue(apiRes.isSuccessful()); assertEquals(0, apiRes.getErrors().size()); @@ -181,7 +181,7 @@ void writeJsonStreamWithSchemaTest() void writeJsonStreamFailsOnGenericWritingException() throws DescriptorValidationException, IOException, InterruptedException, ExecutionException { - InputStream jsoninputStream = new ByteArrayInputStream(newLineSeperatedJson.getBytes()); + InputStream jsonInputStream = new ByteArrayInputStream(newLineSeperatedJson.getBytes()); doReturn(mock(Table.class)) .when(bqTemplateSpy) .createTable(any(String.class), any(Schema.class)); @@ -190,8 +190,8 @@ void writeJsonStreamFailsOnGenericWritingException() .when(bqTemplateSpy) .getWriteApiResponse(any(String.class), any(InputStream.class)); - ListenableFuture futRes = - bqTemplateSpy.writeJsonStream(TABLE, jsoninputStream, getDefaultSchema()); + CompletableFuture futRes = + bqTemplateSpy.writeJsonStream(TABLE, jsonInputStream, getDefaultSchema()); assertThat(futRes) .withFailMessage("boom!") .failsWithin(Duration.ofSeconds(1)); diff --git a/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/core/BigQueryTemplateIntegrationTests.java b/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/core/BigQueryTemplateIntegrationTests.java index 7eddc83f89..5b64e905f5 100644 --- a/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/core/BigQueryTemplateIntegrationTests.java +++ b/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/core/BigQueryTemplateIntegrationTests.java @@ -32,10 +32,9 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.UUID; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; -import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; @@ -46,7 +45,6 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.core.io.Resource; import org.springframework.test.context.junit.jupiter.SpringExtension; -import org.springframework.util.concurrent.ListenableFuture; /** * Integration tests for BigQuery. @@ -102,7 +100,7 @@ void testLoadFileWithSchema() throws Exception { Field.of("State", StandardSQLTypeName.STRING), Field.of("County", StandardSQLTypeName.STRING)); - ListenableFuture bigQueryJobFuture = + CompletableFuture bigQueryJobFuture = bigQueryTemplate.writeDataToTable( tableName, dataFile.getInputStream(), FormatOptions.csv(), schema); @@ -128,7 +126,7 @@ void testJsonFileLoadWithSchema() throws Exception { Field.of("Leave", StandardSQLTypeName.NUMERIC), Field.of("EmpName", StandardSQLTypeName.STRING)); - ListenableFuture writeApiFuture = + CompletableFuture writeApiFuture = bigQueryTemplate.writeJsonStream(tableName, jsonDataFile.getInputStream(), schema); WriteApiResponse writeApiResponse = @@ -146,7 +144,7 @@ void testJsonFileLoadWithSchema() throws Exception { @Test void testLoadFile() throws IOException, ExecutionException, InterruptedException { - ListenableFuture bigQueryJobFuture = + CompletableFuture bigQueryJobFuture = bigQueryTemplate.writeDataToTable( this.tableName, dataFile.getInputStream(), FormatOptions.csv()); @@ -167,7 +165,7 @@ void testLoadBytes() throws ExecutionException, InterruptedException { byte[] byteArray = "CountyId,State,County\n1001,Alabama,Autauga County\n".getBytes(); ByteArrayInputStream byteStream = new ByteArrayInputStream(byteArray); - ListenableFuture bigQueryJobFuture = + CompletableFuture bigQueryJobFuture = bigQueryTemplate.writeDataToTable(this.tableName, byteStream, FormatOptions.csv()); Job job = bigQueryJobFuture.get(); diff --git a/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/integration/outbound/BigQueryFileMessageHandlerTests.java b/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/integration/outbound/BigQueryFileMessageHandlerTests.java index 0d235bd4e4..32022c7ec8 100644 --- a/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/integration/outbound/BigQueryFileMessageHandlerTests.java +++ b/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/integration/outbound/BigQueryFileMessageHandlerTests.java @@ -28,14 +28,13 @@ import com.google.cloud.spring.bigquery.core.BigQueryTemplate; import java.io.InputStream; import java.util.Collections; +import java.util.concurrent.CompletableFuture; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.integration.expression.ValueExpression; import org.springframework.messaging.Message; import org.springframework.messaging.MessageHeaders; import org.springframework.messaging.support.MessageBuilder; -import org.springframework.util.concurrent.ListenableFuture; -import org.springframework.util.concurrent.SettableListenableFuture; class BigQueryFileMessageHandlerTests { @@ -46,8 +45,8 @@ class BigQueryFileMessageHandlerTests { @BeforeEach void setup() { bigQueryTemplate = mock(BigQueryTemplate.class); - SettableListenableFuture result = new SettableListenableFuture<>(); - result.set(mock(Job.class)); + CompletableFuture result = new CompletableFuture<>(); + result.complete(mock(Job.class)); when(bigQueryTemplate.writeDataToTable(any(), any(), any(), any())).thenReturn(result); messageHandler = new BigQueryFileMessageHandler(bigQueryTemplate); @@ -68,7 +67,7 @@ void testHandleMessage_async() { verify(bigQueryTemplate) .writeDataToTable("testTable", payload, FormatOptions.csv(), Schema.of()); - assertThat(result).isNotNull().isInstanceOf(ListenableFuture.class); + assertThat(result).isNotNull().isInstanceOf(CompletableFuture.class); } @Test From 92714e2b719c65517e483487463ef83ba968e254 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 15 Nov 2022 10:22:36 -0500 Subject: [PATCH 071/179] remove `ListenableFuture` in bigquery sample --- .../com/example/BigQuerySampleConfiguration.java | 4 ++-- .../src/main/java/com/example/WebController.java | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/java/com/example/BigQuerySampleConfiguration.java b/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/java/com/example/BigQuerySampleConfiguration.java index accc0e24fe..1f5fd89d98 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/java/com/example/BigQuerySampleConfiguration.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/java/com/example/BigQuerySampleConfiguration.java @@ -21,6 +21,7 @@ import com.google.cloud.spring.bigquery.core.BigQueryTemplate; import com.google.cloud.spring.bigquery.integration.BigQuerySpringMessageHeaders; import com.google.cloud.spring.bigquery.integration.outbound.BigQueryFileMessageHandler; +import java.util.concurrent.CompletableFuture; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.integration.annotation.MessagingGateway; @@ -29,7 +30,6 @@ import org.springframework.integration.gateway.GatewayProxyFactoryBean; import org.springframework.messaging.MessageHandler; import org.springframework.messaging.handler.annotation.Header; -import org.springframework.util.concurrent.ListenableFuture; /** Sample configuration for using BigQuery with Spring Integration. */ @Configuration @@ -67,7 +67,7 @@ public GatewayProxyFactoryBean gatewayProxyFactoryBean() { /** Spring Integration gateway which allows sending data to load to BigQuery through a channel. */ @MessagingGateway public interface BigQueryFileGateway { - ListenableFuture writeToBigQueryTable( + CompletableFuture writeToBigQueryTable( byte[] csvData, @Header(BigQuerySpringMessageHeaders.TABLE_NAME) String tableName); } } diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/java/com/example/WebController.java b/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/java/com/example/WebController.java index 9c675c8326..d452984151 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/java/com/example/WebController.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/java/com/example/WebController.java @@ -26,11 +26,11 @@ import com.google.cloud.spring.bigquery.core.WriteApiResponse; import java.io.ByteArrayInputStream; import java.io.IOException; +import java.util.concurrent.CompletableFuture; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; -import org.springframework.util.concurrent.ListenableFuture; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -74,7 +74,7 @@ public ModelAndView handleJsonFileUpload( @RequestParam("tableName") String tableName, @RequestParam(name = "createTable", required = false) String createDefaultTable) throws IOException { - ListenableFuture writeApiRes = null; + CompletableFuture writeApiRes; if (createDefaultTable != null && createDefaultTable.equals("createTable")) { // create the default table writeApiRes = @@ -107,7 +107,7 @@ public ModelAndView handleJsonTextUpload( @RequestParam("jsonRows") String jsonRows, @RequestParam("tableName") String tableName, @RequestParam(name = "createTable", required = false) String createDefaultTable) { - ListenableFuture writeApiRes = null; + CompletableFuture writeApiRes = null; if (createDefaultTable != null && createDefaultTable.equals("createTable")) { // create the default table @@ -123,13 +123,13 @@ public ModelAndView handleJsonTextUpload( } private ModelAndView getWriteApiResponse( - ListenableFuture writeApiFuture, String tableName) { + CompletableFuture writeApiFuture, String tableName) { String message = null; try { WriteApiResponse apiResponse = writeApiFuture.get(); if (apiResponse.isSuccessful()) { message = "Successfully loaded data to " + tableName; - } else if (apiResponse.getErrors() != null && apiResponse.getErrors().size() > 0) { + } else if (apiResponse.getErrors() != null && !apiResponse.getErrors().isEmpty()) { message = String.format( "Error occurred while loading the file, printing first error %s. Use WriteApiResponse.getErrors() to get the complete list of errors", @@ -158,7 +158,7 @@ public ModelAndView handleFileUpload( @RequestParam("file") MultipartFile file, @RequestParam("tableName") String tableName) throws IOException { - ListenableFuture loadJob = + CompletableFuture loadJob = this.bigQueryTemplate.writeDataToTable( tableName, file.getInputStream(), FormatOptions.csv()); @@ -176,13 +176,13 @@ public ModelAndView handleFileUpload( public ModelAndView handleCsvTextUpload( @RequestParam("csvText") String csvData, @RequestParam("tableName") String tableName) { - ListenableFuture loadJob = + CompletableFuture loadJob = this.bigQueryFileGateway.writeToBigQueryTable(csvData.getBytes(), tableName); return getResponse(loadJob, tableName); } - private ModelAndView getResponse(ListenableFuture loadJob, String tableName) { + private ModelAndView getResponse(CompletableFuture loadJob, String tableName) { String message; try { Job job = loadJob.get(); From 8cff842b3a730c7d42a232bf2b1b5d26755aa713 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 15 Nov 2022 10:23:30 -0500 Subject: [PATCH 072/179] add return in `whenComplete` method --- .../pubsub/core/publisher/PubSubPublisherTemplate.java | 8 ++++---- .../pubsub/core/subscriber/PubSubSubscriberTemplate.java | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/publisher/PubSubPublisherTemplate.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/publisher/PubSubPublisherTemplate.java index d70d1faae0..17532fc05c 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/publisher/PubSubPublisherTemplate.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/publisher/PubSubPublisherTemplate.java @@ -93,7 +93,7 @@ public CompletableFuture publish(final String topic, PubsubMessage pubsu ApiFuture publishFuture = this.publisherFactory.createPublisher(topic).publish(pubsubMessage); - final CompletableFuture settableFuture = new CompletableFuture<>(); + final CompletableFuture completableFuture = new CompletableFuture<>(); ApiFutures.addCallback( publishFuture, new ApiFutureCallback<>() { @@ -104,7 +104,7 @@ public void onFailure(Throwable throwable) { LOGGER.warn(errorMessage, throwable); PubSubDeliveryException pubSubDeliveryException = new PubSubDeliveryException(pubsubMessage, errorMessage, throwable); - settableFuture.completeExceptionally(pubSubDeliveryException); + completableFuture.completeExceptionally(pubSubDeliveryException); } @Override @@ -112,12 +112,12 @@ public void onSuccess(String result) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Publishing to " + topic + " was successful. Message ID: " + result); } - settableFuture.complete(result); + completableFuture.complete(result); } }, directExecutor()); - return settableFuture; + return completableFuture; } public PublisherFactory getPublisherFactory() { diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplate.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplate.java index e0b56a65dd..15ad35b6ae 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplate.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplate.java @@ -279,6 +279,7 @@ public CompletableFuture>> pul (ackableMessages, exception) -> { if (exception != null) { completableFuture.completeExceptionally(exception); + return; } completableFuture.complete( this.toConvertedAcknowledgeablePubsubMessages(payloadType, ackableMessages)); @@ -331,6 +332,7 @@ public CompletableFuture> pullAndAckAsync( (ackableMessages, exception) -> { if (exception != null) { completableFuture.completeExceptionally(exception); + return; } if (!ackableMessages.isEmpty()) { ack(ackableMessages); @@ -362,6 +364,7 @@ public CompletableFuture pullNextAsync(String subscription) { (messages, exception) -> { if (exception != null) { completableFuture.completeExceptionally(exception); + return; } PubsubMessage message = messages.isEmpty() ? null : messages.get(0); From b877bb14da974fd8854809ac62166114e4bb542a Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 15 Nov 2022 10:34:16 -0500 Subject: [PATCH 073/179] fix bigquery integration tests --- ...BigQueryFileMessageHandlerIntegrationTests.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/integration/outbound/BigQueryFileMessageHandlerIntegrationTests.java b/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/integration/outbound/BigQueryFileMessageHandlerIntegrationTests.java index 7a22c7d4d9..3a0d886122 100644 --- a/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/integration/outbound/BigQueryFileMessageHandlerIntegrationTests.java +++ b/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/integration/outbound/BigQueryFileMessageHandlerIntegrationTests.java @@ -35,6 +35,7 @@ import java.io.File; import java.time.Duration; import java.util.HashMap; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import org.junit.jupiter.api.AfterEach; @@ -51,7 +52,6 @@ import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.annotation.DirtiesContext.ClassMode; import org.springframework.test.context.junit.jupiter.SpringExtension; -import org.springframework.util.concurrent.ListenableFuture; @EnabledIfSystemProperty(named = "it.bigquery", matches = "true") @ExtendWith(SpringExtension.class) @@ -91,8 +91,8 @@ void testLoadFileWithSchema() throws InterruptedException, ExecutionException { MessageBuilder.createMessage( new File("src/test/resources/data.csv"), new MessageHeaders(messageHeaders)); - ListenableFuture jobFuture = - (ListenableFuture) this.messageHandler.handleRequestMessage(message); + CompletableFuture jobFuture = + (CompletableFuture) this.messageHandler.handleRequestMessage(message); // Assert that a BigQuery polling task is scheduled successfully. await() @@ -126,8 +126,8 @@ void testLoadFile() throws InterruptedException, ExecutionException { MessageBuilder.createMessage( new File("src/test/resources/data.csv"), new MessageHeaders(messageHeaders)); - ListenableFuture jobFuture = - (ListenableFuture) this.messageHandler.handleRequestMessage(message); + CompletableFuture jobFuture = + (CompletableFuture) this.messageHandler.handleRequestMessage(message); // Assert that a BigQuery polling task is scheduled successfully. await() @@ -181,8 +181,8 @@ void testLoadFile_cancel() { MessageBuilder.createMessage( new File("src/test/resources/data.csv"), new MessageHeaders(messageHeaders)); - ListenableFuture jobFuture = - (ListenableFuture) this.messageHandler.handleRequestMessage(message); + CompletableFuture jobFuture = + (CompletableFuture) this.messageHandler.handleRequestMessage(message); assertThat(jobFuture).isNotNull(); jobFuture.cancel(true); From b73298b581e994b8e50d5e3d9f532988f4aee744 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 15 Nov 2022 12:34:45 -0500 Subject: [PATCH 074/179] add `BinderFactoryAutoConfiguration` --- .../binder/pubsub/PubSubMessageChannelBinderTests.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/PubSubMessageChannelBinderTests.java b/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/PubSubMessageChannelBinderTests.java index 541c187225..bc18453b7e 100644 --- a/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/PubSubMessageChannelBinderTests.java +++ b/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/PubSubMessageChannelBinderTests.java @@ -53,11 +53,15 @@ import org.springframework.beans.DirectFieldAccessor; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener; +import org.springframework.boot.logging.LogLevel; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.cloud.stream.binder.Binding; import org.springframework.cloud.stream.binder.ExtendedConsumerProperties; import org.springframework.cloud.stream.binder.ExtendedProducerProperties; import org.springframework.cloud.stream.binding.BindingService; +import org.springframework.cloud.stream.config.BinderFactoryAutoConfiguration; +import org.springframework.cloud.stream.config.BindingServiceConfiguration; import org.springframework.cloud.stream.config.ConsumerEndpointCustomizer; import org.springframework.cloud.stream.config.ProducerMessageHandlerCustomizer; import org.springframework.cloud.stream.provisioning.ConsumerDestination; @@ -106,7 +110,10 @@ void init() { .withBean(PubSubAdmin.class, () -> pubSubAdmin) .withConfiguration( AutoConfigurations.of( - PubSubBinderConfiguration.class, PubSubExtendedBindingProperties.class)); + PubSubBinderConfiguration.class, + PubSubExtendedBindingProperties.class, + BinderFactoryAutoConfiguration.class, + BindingServiceConfiguration.class)); this.binder = new PubSubMessageChannelBinder(new String[0], this.channelProvisioner, this.pubSubTemplate, this.properties); } From 63e2c0bcd3aca63c9511dd3d0f29b2fcefe11af5 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 15 Nov 2022 15:12:38 -0500 Subject: [PATCH 075/179] rebase branch onto main --- .../example/BigQuerySampleConfiguration.java | 2 ++ .../main/java/com/example/WebController.java | 26 ++++++++++++------- .../src/main/resources/application.properties | 2 +- ...uerySampleApplicationIntegrationTests.java | 15 ++++++----- 4 files changed, 27 insertions(+), 18 deletions(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/java/com/example/BigQuerySampleConfiguration.java b/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/java/com/example/BigQuerySampleConfiguration.java index 1f5fd89d98..ac0b532c1d 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/java/com/example/BigQuerySampleConfiguration.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/java/com/example/BigQuerySampleConfiguration.java @@ -24,6 +24,7 @@ import java.util.concurrent.CompletableFuture; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; import org.springframework.integration.annotation.MessagingGateway; import org.springframework.integration.annotation.ServiceActivator; import org.springframework.integration.channel.DirectChannel; @@ -54,6 +55,7 @@ public MessageHandler messageSender(BigQueryTemplate bigQueryTemplate) { return messageHandler; } + @Primary @Bean public GatewayProxyFactoryBean gatewayProxyFactoryBean() { GatewayProxyFactoryBean factoryBean = new GatewayProxyFactoryBean(BigQueryFileGateway.class); diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/java/com/example/WebController.java b/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/java/com/example/WebController.java index d452984151..be9c7aa10b 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/java/com/example/WebController.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/java/com/example/WebController.java @@ -27,7 +27,6 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.concurrent.CompletableFuture; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; @@ -41,22 +40,30 @@ @Controller public class WebController { - @Autowired BigQueryFileGateway bigQueryFileGateway; + private final BigQueryFileGateway bigQueryFileGateway; - @Autowired BigQueryTemplate bigQueryTemplate; + private final BigQueryTemplate bigQueryTemplate; + + private static final String DATASET_NAME = "datasetName"; @Value("${spring.cloud.gcp.bigquery.datasetName}") private String datasetName; + public WebController(BigQueryFileGateway bigQueryFileGateway, + BigQueryTemplate bigQueryTemplate) { + this.bigQueryFileGateway = bigQueryFileGateway; + this.bigQueryTemplate = bigQueryTemplate; + } + @GetMapping("/") public ModelAndView renderIndex(ModelMap map) { - map.put("datasetName", this.datasetName); + map.put(DATASET_NAME, this.datasetName); return new ModelAndView("index.html", map); } @GetMapping("/write-api-json-upload") public ModelAndView renderUploadJson(ModelMap map) { - map.put("datasetName", this.datasetName); + map.put(DATASET_NAME, this.datasetName); return new ModelAndView("upload-json.html", map); } @@ -107,7 +114,7 @@ public ModelAndView handleJsonTextUpload( @RequestParam("jsonRows") String jsonRows, @RequestParam("tableName") String tableName, @RequestParam(name = "createTable", required = false) String createDefaultTable) { - CompletableFuture writeApiRes = null; + CompletableFuture writeApiRes; if (createDefaultTable != null && createDefaultTable.equals("createTable")) { // create the default table @@ -141,7 +148,7 @@ private ModelAndView getWriteApiResponse( message = "Error: " + e.getMessage(); } return new ModelAndView("upload-json.html") - .addObject("datasetName", this.datasetName) + .addObject(DATASET_NAME, this.datasetName) .addObject("message", message); } @@ -150,7 +157,7 @@ private ModelAndView getWriteApiResponse( * * @param file the CSV file to upload to BigQuery * @param tableName name of the table to load data into - * @return ModelAndView of the response the send back to users + * @return ModelAndView of the response to send back to users * @throws IOException if the file is unable to be loaded. */ @PostMapping("/uploadFile") @@ -185,7 +192,6 @@ public ModelAndView handleCsvTextUpload( private ModelAndView getResponse(CompletableFuture loadJob, String tableName) { String message; try { - Job job = loadJob.get(); message = "Successfully loaded data file to " + tableName; } catch (Exception e) { e.printStackTrace(); @@ -193,7 +199,7 @@ private ModelAndView getResponse(CompletableFuture loadJob, String tableNam } return new ModelAndView("index") - .addObject("datasetName", this.datasetName) + .addObject(DATASET_NAME, this.datasetName) .addObject("message", message); } } diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/resources/application.properties b/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/resources/application.properties index c8b7e1992f..a96211b09d 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/resources/application.properties +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/resources/application.properties @@ -1,2 +1,2 @@ # Specify your BigQuery dataset name. -spring.cloud.gcp.bigquery.datasetName=[YOUR_DATASET_NAME] +spring.cloud.gcp.bigquery.datasetName=test_dataset diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/test/java/com/example/BigQuerySampleApplicationIntegrationTests.java b/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/test/java/com/example/BigQuerySampleApplicationIntegrationTests.java index 592f6954a9..3fceb484a4 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/test/java/com/example/BigQuerySampleApplicationIntegrationTests.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/test/java/com/example/BigQuerySampleApplicationIntegrationTests.java @@ -91,9 +91,10 @@ private String getRandSuffix() { @Test void testJsonTextUpload() throws InterruptedException { String jsonTxt = - "{\"CompanyName\":\"TALES\",\"Description\":\"mark\",\"SerialNumber\":97,\"Leave\":0,\"EmpName\":\"Mark\"}\n" - + "{\"CompanyName\":\"1Q84\",\"Description\":\"ark\",\"SerialNumber\":978,\"Leave\":0,\"EmpName\":\"HARUKI\"}\n" - + "{\"CompanyName\":\"MY\",\"Description\":\"M\",\"SerialNumber\":9780,\"Leave\":0,\"EmpName\":\"Mark\"}"; + """ + {"CompanyName":"TALES","Description":"mark","SerialNumber":97,"Leave":0,"EmpName":"Mark"} + {"CompanyName":"1Q84","Description":"ark","SerialNumber":978,"Leave":0,"EmpName":"HARUKI"} + {"CompanyName":"MY","Description":"M","SerialNumber":9780,"Leave":0,"EmpName":"Mark"}"""; LinkedMultiValueMap map = new LinkedMultiValueMap<>(); map.add("jsonRows", jsonTxt); @@ -113,12 +114,12 @@ void testJsonTextUpload() throws InterruptedException { TableResult queryResult = this.bigQuery.query(queryJobConfiguration); assertThat(queryResult.getTotalRows()).isEqualTo(3); FieldValueList row = queryResult.getValues().iterator().next(); // match the first record - assertThat(row.get("SerialNumber").getLongValue() == 9780); + assertThat(row.get("SerialNumber").getLongValue()).isEqualTo(9780L); assertThat(row.get("EmpName").getStringValue()).isEqualTo("Mark"); } @Test - void testJsonFileUpload() throws InterruptedException, IOException { + void testJsonFileUpload() throws InterruptedException { LinkedMultiValueMap map = new LinkedMultiValueMap<>(); map.add("file", jsonFile); map.add("tableName", TABLE_NAME); @@ -140,12 +141,12 @@ void testJsonFileUpload() throws InterruptedException, IOException { TableResult queryResult = this.bigQuery.query(queryJobConfiguration); assertThat(queryResult.getTotalRows()).isEqualTo(3); FieldValueList row = queryResult.getValues().iterator().next(); // match the first record - assertThat(row.get("SerialNumber").getLongValue() == 9780); + assertThat(row.get("SerialNumber").getLongValue()).isEqualTo(9780L); assertThat(row.get("EmpName").getStringValue()).isEqualTo("Mark"); } @Test - void testFileUpload() throws InterruptedException, IOException { + void testFileUpload() throws InterruptedException { LinkedMultiValueMap map = new LinkedMultiValueMap<>(); map.add("file", csvFile); map.add("tableName", TABLE_NAME); From 9d756cd34e3ddce5ea0b6461af5d4577b0c17eef Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Wed, 16 Nov 2022 19:34:59 -0500 Subject: [PATCH 076/179] fix integration tests in kotlin example --- .../spring-cloud-gcp-kotlin-app-sample/README.adoc | 4 ++-- .../spring-cloud-gcp-kotlin-app-sample/pom.xml | 6 +++--- .../src/main/kotlin/com/example/app/Controller.kt | 4 ++-- .../src/main/kotlin/com/example/app/PubSubConfiguration.kt | 2 +- .../main/kotlin/com/example/app/RegistrationApplication.kt | 2 +- .../src/main/resources/application.properties | 2 +- .../RegistrationKotlinSampleApplicationIntegrationTests.kt | 6 +++--- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/README.adoc b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/README.adoc index eb19fe1e88..9a4c2fcd58 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/README.adoc +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/README.adoc @@ -18,9 +18,9 @@ image:http://gstatic.com/cloudssh/images/open-btn.svg[link=https://ssh.cloud.goo + Alternatively, if you have the https://cloud.google.com/sdk/[Google Cloud SDK] installed and initialized, and are logged in with https://developers.google.com/identity/protocols/application-default-credentials[application default credentials], Spring will auto-discover those parameters for you. -2. Create a Google Cloud MySQL instance and a database within the instance. +2. Create a Google Cloud Postgres instance and a database within the instance. -- You may create a Google Cloud MySQL instance on the https://console.cloud.google.com/sql/instances[Google Cloud Console Cloud SQL page]. +- You may create a Google Cloud Postgres instance on the https://console.cloud.google.com/sql/instances[Google Cloud Console Cloud SQL page]. - In the same page, you may create a database within your Cloud SQL instance. Name your database `registrants`. diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/pom.xml index fff144f83d..16b5d14969 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/pom.xml @@ -14,7 +14,7 @@ Spring Cloud GCP Code Sample - Kotlin App Sample - 1.6.21 + 1.7.20 @@ -69,7 +69,7 @@ com.google.cloud - spring-cloud-gcp-starter-sql-mysql + spring-cloud-gcp-starter-sql-postgresql @@ -79,7 +79,7 @@ - kotlin-test + kotlin-test-junit org.jetbrains.kotlin ${kotlin.version} test diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/main/kotlin/com/example/app/Controller.kt b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/main/kotlin/com/example/app/Controller.kt index 1adac92edc..f9c59a76b8 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/main/kotlin/com/example/app/Controller.kt +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/main/kotlin/com/example/app/Controller.kt @@ -34,7 +34,7 @@ import org.springframework.web.servlet.view.RedirectView @RestController class Controller(val pubSubTemplate: PubSubTemplate, val personRepository: PersonRepository) { - val REGISTRATION_TOPIC = "registrations" + private val registrationTopic = "registrations" @PostMapping("/registerPerson") fun registerPerson( @@ -42,7 +42,7 @@ class Controller(val pubSubTemplate: PubSubTemplate, val personRepository: Perso @RequestParam("lastName") lastName: String, @RequestParam("email") email: String): RedirectView { - pubSubTemplate.publish(REGISTRATION_TOPIC, Person(firstName, lastName, email)) + pubSubTemplate.publish(registrationTopic, Person(firstName, lastName, email)) return RedirectView("/") } diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/main/kotlin/com/example/app/PubSubConfiguration.kt b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/main/kotlin/com/example/app/PubSubConfiguration.kt index 6af335d113..28dbffa806 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/main/kotlin/com/example/app/PubSubConfiguration.kt +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/main/kotlin/com/example/app/PubSubConfiguration.kt @@ -56,7 +56,7 @@ class PubSubConfiguration { /** * This bean enables serialization/deserialization of Java objects to JSON allowing you - * utilize JSON message payloads in Cloud Pub/Sub. + * to utilize JSON message payloads in Cloud Pub/Sub. * @param objectMapper the object mapper to use * @return a Jackson message converter */ diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/main/kotlin/com/example/app/RegistrationApplication.kt b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/main/kotlin/com/example/app/RegistrationApplication.kt index d2abb15b87..843b22bb92 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/main/kotlin/com/example/app/RegistrationApplication.kt +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/main/kotlin/com/example/app/RegistrationApplication.kt @@ -28,7 +28,7 @@ import org.springframework.data.jpa.repository.config.EnableJpaRepositories * * @since 1.1 */ -@SpringBootApplication() +@SpringBootApplication @EnableJpaRepositories(basePackageClasses = [PersonRepository::class]) @EntityScan(basePackageClasses = [Person::class]) class Application diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/main/resources/application.properties b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/main/resources/application.properties index 41478f72cd..5aa23342b4 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/main/resources/application.properties +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/main/resources/application.properties @@ -2,7 +2,7 @@ spring.cloud.gcp.sql.database-name=registrants spring.cloud.gcp.sql.instance-connection-name=[YOUR_SQL_INSTANCE_NAME] # So app starts despite "table already exists" errors. -spring.datasource.continue-on-error=true +spring.sql.init.continue-on-error=true # Enforces database initialization spring.sql.init.mode=always diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/test/kotlin/com/example/RegistrationKotlinSampleApplicationIntegrationTests.kt b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/test/kotlin/com/example/RegistrationKotlinSampleApplicationIntegrationTests.kt index f4d6771425..865fd1d5cb 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/test/kotlin/com/example/RegistrationKotlinSampleApplicationIntegrationTests.kt +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/test/kotlin/com/example/RegistrationKotlinSampleApplicationIntegrationTests.kt @@ -45,7 +45,7 @@ import java.util.concurrent.TimeUnit classes = [Application::class], properties = [ "spring.datasource.password=test", - "spring.cloud.gcp.sql.instance-connection-name=spring-cloud-gcp-ci:us-central1:testmysql", + "spring.cloud.gcp.sql.instance-connection-name=spring-cloud-gcp-ci:us-central1:testpostgres", "spring.cloud.gcp.sql.database-name=code_samples_test_db", "spring.test.mockmvc.print=none" ] @@ -68,8 +68,8 @@ class RegistrationKotlinSampleApplicationIntegrationTests { .perform(get(REGISTRANTS_URL)) .andReturn() - val resultParams = mvcResult.modelAndView.modelMap - val personsList = resultParams.get("personsList") as List + val resultParams = mvcResult.modelAndView?.modelMap + val personsList = resultParams?.get("personsList") as List assertThat(personsList).hasSize(1) val person = personsList[0] From bcb76144cb584e8dabe049df60426eb651183b71 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 17 Nov 2022 20:40:30 -0500 Subject: [PATCH 077/179] upgrade spring-cloud-dependencies to 2022.0.0-RC2 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2ecbad5c2d..a91c99adeb 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,7 @@ - 2022.0.0-M4 + 2022.0.0-RC2 3.0.0-RC2 1.0.4 2.4.1 From 0d9541d4c1a3877c07c37927c3064d7c1ac8a11a Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 17 Nov 2022 20:41:17 -0500 Subject: [PATCH 078/179] upgrade spring-cloud-dependencies-parent to 4.0.0-M5 --- spring-cloud-gcp-dependencies/pom.xml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/spring-cloud-gcp-dependencies/pom.xml b/spring-cloud-gcp-dependencies/pom.xml index 1524da40d4..5a3c13b8c9 100644 --- a/spring-cloud-gcp-dependencies/pom.xml +++ b/spring-cloud-gcp-dependencies/pom.xml @@ -5,7 +5,7 @@ org.springframework.cloud spring-cloud-dependencies-parent - 3.1.4 + 4.0.0-M5 @@ -38,16 +38,6 @@ - - - - org.springframework.cloud - spring-cloud-function-dependencies - 3.2.7 - pom - import - - com.google.guava @@ -320,6 +310,19 @@ + + + spring-milestone + https://repo.spring.io/milestone + + + + + spring-milestone + https://repo.spring.io/milestone + + + diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-client/src/main/resources/application.properties b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-client/src/main/resources/application.properties index 1e51ebab23..e82237b0a1 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-client/src/main/resources/application.properties +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-client/src/main/resources/application.properties @@ -3,3 +3,4 @@ #spring.cloud.gcp.project-id=[YOUR_GCP_PROJECT_ID] #spring.cloud.gcp.credentials.location=file:[LOCAL_PATH_TO_CREDENTIALS] +spring.config.import=configserver: diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-server-local/src/main/resources/application.properties b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-server-local/src/main/resources/application.properties index 2f26726c79..cb21277840 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-server-local/src/main/resources/application.properties +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-server-local/src/main/resources/application.properties @@ -1,7 +1,7 @@ server.port=8888 spring.profiles.active=native -spring.cloud.config.server.native.searchLocations=file:/tmp/config/ +spring.cloud.config.server.native.searchLocations=file:/tmp/config # Customize the Pub/Sub Topic to be used as the message bus. #spring.cloud.bus.destination=custom-spring-cloud-bus-topic From 4ad297266b8b76898ce6cbec9938a0d405735a39 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Wed, 23 Nov 2022 16:16:30 -0500 Subject: [PATCH 087/179] polish smell code --- .../bigquery/core/BigQueryTemplate.java | 4 ++-- .../datastore/core/DatastoreTemplate.java | 10 +++++----- .../convert/DatastoreCustomConversions.java | 13 ++++++------ .../DefaultDatastoreEntityConverter.java | 8 ++++---- .../subscriber/PubSubSubscriberTemplate.java | 20 +++++++++---------- 5 files changed, 28 insertions(+), 27 deletions(-) diff --git a/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryTemplate.java b/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryTemplate.java index 15d635f6e2..55888a7e18 100644 --- a/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryTemplate.java +++ b/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryTemplate.java @@ -96,7 +96,7 @@ public class BigQueryTemplate implements BigQueryOperations { * @deprecated As of release 3.3.1, use * BigQueryTemplate(BigQuery,BigQueryWriteClient,Map,TaskScheduler) instead */ - @Deprecated + @Deprecated(forRemoval = true) public BigQueryTemplate(BigQuery bigQuery, String datasetName) { this(bigQuery, datasetName, new DefaultManagedTaskScheduler()); } @@ -111,7 +111,7 @@ public BigQueryTemplate(BigQuery bigQuery, String datasetName) { * @deprecated As of release 3.3.1, use * BigQueryTemplate(BigQuery,BigQueryWriteClient,Map,TaskScheduler) instead */ - @Deprecated + @Deprecated(forRemoval = true) public BigQueryTemplate(BigQuery bigQuery, String datasetName, TaskScheduler taskScheduler) { Assert.notNull(bigQuery, "BigQuery client object must not be null."); Assert.notNull(datasetName, "Dataset name must not be null"); diff --git a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/DatastoreTemplate.java b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/DatastoreTemplate.java index 59129c021b..662985815b 100644 --- a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/DatastoreTemplate.java +++ b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/DatastoreTemplate.java @@ -249,7 +249,7 @@ private Collection performFindByKey(Iterable ids, Class entityClass } private List findAllById(Set keys, Class entityClass, ReadContext context) { - List missingKeys = keys.stream().filter(context::notCached).collect(Collectors.toList()); + List missingKeys = keys.stream().filter(context::notCached).toList(); if (!missingKeys.isEmpty()) { List entities = getDatastoreReadWriter().fetch(missingKeys.toArray(new Key[] {})); @@ -305,8 +305,8 @@ private StructuredQuery applyPageable(StructuredQuery query, Pageable pageable) return query; } Cursor cursor = null; - if (pageable instanceof DatastorePageable) { - cursor = ((DatastorePageable) pageable).toCursor(); + if (pageable instanceof DatastorePageable datastorePageable) { + cursor = datastorePageable.toCursor(); } StructuredQuery.Builder builder = query.toBuilder(); if (cursor != null) { @@ -561,7 +561,7 @@ private List getReferenceEntitiesForSave( List keyValues = StreamSupport.stream((iterableVal).spliterator(), false) .map(o -> KeyValue.of(this.getKey(o, false))) - .collect(Collectors.toList()); + .toList(); value = ListValue.of(keyValues); } else { @@ -656,7 +656,7 @@ private List convertEntitiesForRead( return keys.stream() .map(key -> convertEntityResolveDescendantsAndReferences(entityClass, key, context)) .filter(Objects::nonNull) - .collect(Collectors.toList()); + .toList(); } private T convertEntityResolveDescendantsAndReferences( diff --git a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DatastoreCustomConversions.java b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DatastoreCustomConversions.java index 278aaa4958..fd2e886664 100644 --- a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DatastoreCustomConversions.java +++ b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DatastoreCustomConversions.java @@ -25,6 +25,7 @@ import org.springframework.core.convert.converter.Converter; import org.springframework.data.convert.CustomConversions; import org.springframework.data.convert.Jsr310Converters; +import org.springframework.lang.NonNull; /** * Value object to capture custom conversion. {@link DatastoreCustomConversions} @@ -43,11 +44,11 @@ public class DatastoreCustomConversions extends CustomConversions { converters.add( new Converter() { @Override - public Long convert(BaseKey key) { + public Long convert(@NonNull BaseKey baseKey) { Long id = null; // embedded entities have IncompleteKey, and have no inner value - if (key instanceof Key) { - id = ((Key) key).getId(); + if (baseKey instanceof Key key) { + id = key.getId(); if (id == null) { throw new DatastoreDataException( "The given key doesn't have a numeric ID but a conversion" @@ -61,11 +62,11 @@ public Long convert(BaseKey key) { converters.add( new Converter() { @Override - public String convert(BaseKey key) { + public String convert(@NonNull BaseKey baseKey) { String name = null; // embedded entities have IncompleteKey, and have no inner value - if (key instanceof Key) { - name = ((Key) key).getName(); + if (baseKey instanceof Key key) { + name = key.getName(); if (name == null) { throw new DatastoreDataException( "The given key doesn't have a String name value but " diff --git a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DefaultDatastoreEntityConverter.java b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DefaultDatastoreEntityConverter.java index 2d403effc8..8f9f18c2e7 100644 --- a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DefaultDatastoreEntityConverter.java +++ b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/DefaultDatastoreEntityConverter.java @@ -36,13 +36,13 @@ import java.util.Map; import java.util.Optional; import java.util.Set; -import java.util.stream.Collectors; import org.springframework.data.mapping.PersistentPropertyAccessor; import org.springframework.data.mapping.model.EntityInstantiator; import org.springframework.data.mapping.model.EntityInstantiators; import org.springframework.data.mapping.model.ParameterValueProvider; import org.springframework.data.mapping.model.PersistentEntityParameterValueProvider; import org.springframework.data.util.TypeInformation; +import org.springframework.lang.NonNull; import org.springframework.util.Assert; /** @@ -218,7 +218,7 @@ private boolean isDiscriminationFieldMatch( @Override @SuppressWarnings("unchecked") - public void write(Object source, BaseEntity.Builder sink) { + public void write(Object source, @NonNull BaseEntity.Builder sink) { DatastorePersistentEntity persistentEntity = this.mappingContext.getDatastorePersistentEntity(source.getClass()); @@ -227,7 +227,7 @@ public void write(Object source, BaseEntity.Builder sink) { if (!discriminationValues.isEmpty() || discriminationFieldName != null) { sink.set( discriminationFieldName, - discriminationValues.stream().map(StringValue::of).collect(Collectors.toList())); + discriminationValues.stream().map(StringValue::of).toList()); } PersistentPropertyAccessor accessor = persistentEntity.getPropertyAccessor(source); persistentEntity.doWithColumnBackedProperties( @@ -270,7 +270,7 @@ private Value setExcludeFromIndexes(Value convertedVal) { return ListValue.of( (List) ((ListValue) convertedVal) - .get().stream().map(this::setExcludeFromIndexes).collect(Collectors.toList())); + .get().stream().map(this::setExcludeFromIndexes).toList()); } else { return convertedVal.toBuilder().setExcludeFromIndexes(true).build(); } diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplate.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplate.java index 15ad35b6ae..adc224be61 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplate.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplate.java @@ -237,12 +237,12 @@ private List toAcknowledgeablePubsubMessageList( return messages.stream() .map( message -> - new PulledAcknowledgeablePubsubMessage( + (AcknowledgeablePubsubMessage) new PulledAcknowledgeablePubsubMessage( PubSubSubscriptionUtils.toProjectSubscriptionName( subscriptionId, this.subscriberFactory.getProjectId()), message.getMessage(), message.getAckId())) - .collect(Collectors.toList()); + .toList(); } @Override @@ -288,17 +288,17 @@ public CompletableFuture>> pul return completableFuture; } - private - List> toConvertedAcknowledgeablePubsubMessages( - Class payloadType, List ackableMessages) { + private List> toConvertedAcknowledgeablePubsubMessages( + Class payloadType, List ackableMessages) { return ackableMessages.stream() .map( m -> - new ConvertedPulledAcknowledgeablePubsubMessage<>( - m, - this.pubSubMessageConverter.fromPubSubMessage( - m.getPubsubMessage(), payloadType))) - .collect(Collectors.toList()); + (ConvertedAcknowledgeablePubsubMessage) + new ConvertedPulledAcknowledgeablePubsubMessage<>( + m, + this.pubSubMessageConverter + .fromPubSubMessage(m.getPubsubMessage(), payloadType))) + .toList(); } @Override From 55ff0a02df2c01740d3b06c14450605efe2b4ad3 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Fri, 25 Nov 2022 15:01:38 -0500 Subject: [PATCH 088/179] remove `createSubscriberStub` method as it is deprecated --- .../trace/pubsub/TracingSubscriberFactory.java | 5 ----- .../support/DefaultSubscriberFactory.java | 9 --------- .../pubsub/support/SubscriberFactory.java | 10 ---------- .../support/DefaultSubscriberFactoryTests.java | 17 ----------------- 4 files changed, 41 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracingSubscriberFactory.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracingSubscriberFactory.java index 6179f28843..e30e526424 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracingSubscriberFactory.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracingSubscriberFactory.java @@ -49,11 +49,6 @@ public PullRequest createPullRequest( return delegate.createPullRequest(subscriptionName, maxMessages, returnImmediately); } - @Override - public SubscriberStub createSubscriberStub() { - return pubSubTracing.subscriberStub(delegate.createSubscriberStub()); - } - @Override public SubscriberStub createSubscriberStub(String subscriptionName) { return pubSubTracing.subscriberStub(delegate.createSubscriberStub(subscriptionName)); diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/DefaultSubscriberFactory.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/DefaultSubscriberFactory.java index 325da7a64c..19f0bb1c7e 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/DefaultSubscriberFactory.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/DefaultSubscriberFactory.java @@ -349,15 +349,6 @@ public PullRequest createPullRequest( return pullRequestBuilder.build(); } - @Override - public SubscriberStub createSubscriberStub() { - try { - return GrpcSubscriberStub.create(buildGlobalSubscriberStubSettings()); - } catch (IOException ex) { - throw new PubSubException("Error creating the SubscriberStub", ex); - } - } - @Override public SubscriberStub createSubscriberStub(String subscriptionName) { try { diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/SubscriberFactory.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/SubscriberFactory.java index 72c8f17566..209db4658f 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/SubscriberFactory.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/SubscriberFactory.java @@ -60,16 +60,6 @@ public interface SubscriberFactory { PullRequest createPullRequest( String subscriptionName, Integer maxMessages, Boolean returnImmediately); - /** - * Create a {@link SubscriberStub} that is needed to execute {@link PullRequest}s. This method - * will only set global settings. - * - * @return the {@link SubscriberStub} used for executing {@link PullRequest}s. - * @deprecated Use the new {@code createSubscriberStub(subscriptionName)} instead. - */ - @Deprecated - SubscriberStub createSubscriberStub(); - /** * Create a {@link SubscriberStub} that is needed to execute {@link PullRequest}s. * diff --git a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/support/DefaultSubscriberFactoryTests.java b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/support/DefaultSubscriberFactoryTests.java index 9900b177f1..752380da51 100644 --- a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/support/DefaultSubscriberFactoryTests.java +++ b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/support/DefaultSubscriberFactoryTests.java @@ -717,23 +717,6 @@ void testBuildGlobalSubscriberStubSettings_retryableCodes_pickConfiguration() assertThat(settings.pullSettings().getRetryableCodes()).containsExactly(Code.INTERNAL); } - @Test - void createSubscriberStubSucceeds_noSubscriptionNameAndNewConfiguration() { - - when(this.mockTransportChannel.getEmptyCallContext()).thenReturn(this.mockApiCallContext); - when(this.mockApiCallContext.withCredentials(any())).thenReturn(this.mockApiCallContext); - when(this.mockApiCallContext.withTransportChannel(any())).thenReturn(this.mockApiCallContext); - - GcpProjectIdProvider projectIdProvider = () -> "project"; - DefaultSubscriberFactory factory = - new DefaultSubscriberFactory(projectIdProvider, this.pubSubConfig); - factory.setChannelProvider(FixedTransportChannelProvider.create(this.mockTransportChannel)); - factory.setCredentialsProvider(() -> NoCredentials.getInstance()); - - SubscriberStub stub = factory.createSubscriberStub(); - assertThat(stub.isShutdown()).isFalse(); - } - @Test void createSubscriberStubSucceeds() { From 1e699eb2bd3bbc913a3620738fc795ee9455bdcf Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Fri, 25 Nov 2022 21:05:30 -0500 Subject: [PATCH 089/179] upgrade to spring boot 3.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index a91c99adeb..2aa88c3df8 100644 --- a/pom.xml +++ b/pom.xml @@ -39,11 +39,11 @@ 2022.0.0-RC2 - 3.0.0-RC2 + 3.0.0 1.0.4 2.4.1 0.10.5 - 1.0.0-M8 + 1.0.0-RC1 3.1.4 From e44759844cc06dc951bcd995fbd1f615595cea55 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Fri, 25 Nov 2022 21:43:08 -0500 Subject: [PATCH 090/179] upgrade spring-boot-starter-parent to 3.0.0 --- spring-cloud-gcp-samples/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud-gcp-samples/pom.xml b/spring-cloud-gcp-samples/pom.xml index 943c261d36..021350a115 100644 --- a/spring-cloud-gcp-samples/pom.xml +++ b/spring-cloud-gcp-samples/pom.xml @@ -6,7 +6,7 @@ org.springframework.boot spring-boot-starter-parent - 3.0.0-RC2 + 3.0.0 From 9f529ad2d5ccee5a8870c70a8a845ecb72953ae0 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 28 Nov 2022 10:34:28 -0500 Subject: [PATCH 091/179] temporily fix integration test in trace sample --- .../main/java/com/example/WorkService.java | 27 +++++++++++++++---- ...raceSampleApplicationIntegrationTests.java | 15 ++++------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/WorkService.java b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/WorkService.java index 209e2f55b8..2a204e0ef4 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/WorkService.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/WorkService.java @@ -16,9 +16,12 @@ package com.example; +import brave.Span; +import brave.Tracer; +import brave.Tracing; +import brave.propagation.TraceContext; import com.google.cloud.spring.pubsub.core.PubSubTemplate; import com.google.cloud.spring.pubsub.support.GcpPubSubHeaders; -import io.micrometer.tracing.annotation.NewSpan; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Value; @@ -43,33 +46,47 @@ public class WorkService { private final MessageChannel pubsubOutputChannel; + private final Tracing tracing; + + private final Tracer tracer; + public WorkService( RestTemplate restTemplate, PubSubTemplate pubSubTemplate, - MessageChannel pubsubOutputChannel) { + MessageChannel pubsubOutputChannel, + Tracing tracing, + Tracer tracer) { this.restTemplate = restTemplate; this.pubSubTemplate = pubSubTemplate; this.pubsubOutputChannel = pubsubOutputChannel; + this.tracing = tracing; + this.tracer = tracer; } - @NewSpan public void visitMeetEndpoint(String meetUrl) { + TraceContext context = tracing.currentTraceContext().get(); + Span span = tracer.newChild(context).name("visit-meet-endpoint").start(); LOGGER.info("starting busy work"); for (int i = 0; i < 3; i++) { this.restTemplate.getForObject(meetUrl, String.class); } LOGGER.info("finished busy work"); + span.finish(); } - @NewSpan public void sendMessageSpringIntegration(String text) throws MessagingException { + TraceContext context = tracing.currentTraceContext().get(); + Span span = tracer.newChild(context).name("send-message-spring-integration").start(); final Message message = MessageBuilder.withPayload(text).setHeader(GcpPubSubHeaders.TOPIC, sampleTopic).build(); pubsubOutputChannel.send(message); + span.finish(); } - @NewSpan public void sendMessagePubSubTemplate(String text) throws MessagingException { + TraceContext context = tracing.currentTraceContext().get(); + Span span = tracer.newChild(context).name("send-message-pub-sub-template").start(); pubSubTemplate.publish(sampleTopic, text); + span.finish(); } } diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java index 1f6b22363d..c553161e09 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java @@ -202,16 +202,11 @@ void testTracesAreLoggedCorrectly() { assertThat(trace.getTraceId()).isEqualTo(uuidString); // The 16 expected spans are: - // get /, visit-meet-endpoint, get, get /meet, get, get /meet, get, get /meet, + // http get /, visit-meet-endpoint, http get, http get /meet, http get, + // http get /meet, http get, http get /meet, // send-message-spring-integration, publish, send-message-pub-sub-template, publish, // next-message, on-message, next-message, on-message - // One of the next problems is that the spans no longer have the same names as before. - // 14:41:07.857 [awaitility-thread] INFO c.e.TraceSampleApplicationIntegrationTests - - // Found trace! 2f732b09b8e94bcc8d9c4db2ccefafcb with 11 spans ([http get, - // messagesender.serviceactivator receive, messagesender receive, publish, publish, - // next-message, on-message, application.messagereceiver.serviceactivator receive, - // next-message, on-message, application.messagereceiver.serviceactivator receive]). assertThat(trace.getSpansCount()).isGreaterThanOrEqualTo(16); log.debug("Trace spans match."); @@ -222,10 +217,10 @@ void testTracesAreLoggedCorrectly() { assertThat(trace.getSpansList().stream().map(TraceSpan::getName).distinct()) .containsExactly( - "get /", + "http get /", "visit-meet-endpoint", - "get", - "get /meet", + "http get", + "http get /meet", "send-message-spring-integration", "publish", "send-message-pub-sub-template", From 11cf66823e7f7213f0ae5789d4ad5bc64b7be249 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 28 Nov 2022 10:45:31 -0500 Subject: [PATCH 092/179] remove errorprone_java8 --- pom.xml | 42 +++--------------------------------------- 1 file changed, 3 insertions(+), 39 deletions(-) diff --git a/pom.xml b/pom.xml index 2aa88c3df8..9a69aa132b 100644 --- a/pom.xml +++ b/pom.xml @@ -44,10 +44,9 @@ 2.4.1 0.10.5 1.0.0-RC1 - 3.1.4 - 3.8.1 + 3.10.1 2.8.2 3.0.0-M7 1.3.0 @@ -502,7 +501,7 @@ - + errorprone_java_9_and_up @@ -513,7 +512,7 @@ org.apache.maven.plugins - maven-compiler-plugin + ${maven-compiler-plugin.version} 3.10.1 ${maven.compiler.source} @@ -550,41 +549,6 @@ - - errorprone_java8 - - 1.8 - - - 9+181-r4173-1 - - - - - - maven-compiler-plugin - 3.10.1 - - true - - -J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/${javac.version}/javac-${javac.version}.jar - - -parameters - - - - - com.google.errorprone - error_prone_core - ${errorprone.version} - - - - - - - - release From a330db21e897709c960e7907e4b39526dcd115b7 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 28 Nov 2022 16:57:55 -0500 Subject: [PATCH 093/179] add spring aop dependency --- .../spring-cloud-gcp-starter-trace/pom.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml index 34091fe4d7..fb6f531ff4 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml @@ -18,6 +18,10 @@ com.google.cloud spring-cloud-gcp-starter + + org.springframework + spring-aspects + org.springframework.boot spring-boot-starter-actuator From 2f70f6a77e4879fa66eb35baf55bbd620865b347 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 28 Nov 2022 17:06:01 -0500 Subject: [PATCH 094/179] add`ObservedAspect` bean to enable `Observed` annotation --- .../trace/pubsub/TracePubSubAutoConfiguration.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java index fde0676971..a5b16aa97f 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfiguration.java @@ -22,6 +22,8 @@ import com.google.cloud.spring.autoconfigure.pubsub.GcpPubSubAutoConfiguration; import com.google.cloud.spring.pubsub.core.publisher.PublisherCustomizer; import com.google.cloud.spring.pubsub.support.PublisherFactory; +import io.micrometer.observation.ObservationRegistry; +import io.micrometer.observation.aop.ObservedAspect; import org.springframework.beans.factory.BeanFactory; import org.springframework.boot.actuate.autoconfigure.tracing.BraveAutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfiguration; @@ -69,4 +71,13 @@ PublisherCustomizer tracePublisherCustomizer(PubSubTracing pubSubTracing) { public MessagingTracing messagingTracing(Tracing tracing) { return MessagingTracing.create(tracing); } + + // To have the @Observed support we need to register this aspect + // Refers to https://spring.io/blog/2022/10/12/observability-with-spring-boot-3 + // for more info. + @Bean + @ConditionalOnMissingBean + ObservedAspect observedAspect(ObservationRegistry observationRegistry) { + return new ObservedAspect(observationRegistry); + } } From 7ba4e7846e96def27f17e45f57c677301917432f Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 28 Nov 2022 17:07:03 -0500 Subject: [PATCH 095/179] fix integration test in trace samples --- .../main/java/com/example/Application.java | 4 +-- .../main/java/com/example/WorkService.java | 27 ++++--------------- 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/Application.java b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/Application.java index e45567b10a..174f1e79fb 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/Application.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/Application.java @@ -34,21 +34,21 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.integration.annotation.ServiceActivator; import org.springframework.integration.channel.DirectChannel; import org.springframework.lang.NonNull; import org.springframework.messaging.MessageChannel; import org.springframework.messaging.MessageHandler; import org.springframework.messaging.handler.annotation.Header; -import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; /** Sample spring boot application. */ +@Configuration(proxyBeanMethods = false) @SpringBootApplication(exclude = ZipkinAutoConfiguration.class) -@Component public class Application implements WebMvcConfigurer { private static final Logger LOGGER = LoggerFactory.getLogger(Application.class); diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/WorkService.java b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/WorkService.java index 2a204e0ef4..3e69daf357 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/WorkService.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/WorkService.java @@ -16,12 +16,9 @@ package com.example; -import brave.Span; -import brave.Tracer; -import brave.Tracing; -import brave.propagation.TraceContext; import com.google.cloud.spring.pubsub.core.PubSubTemplate; import com.google.cloud.spring.pubsub.support.GcpPubSubHeaders; +import io.micrometer.observation.annotation.Observed; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Value; @@ -46,47 +43,33 @@ public class WorkService { private final MessageChannel pubsubOutputChannel; - private final Tracing tracing; - - private final Tracer tracer; - public WorkService( RestTemplate restTemplate, PubSubTemplate pubSubTemplate, - MessageChannel pubsubOutputChannel, - Tracing tracing, - Tracer tracer) { + MessageChannel pubsubOutputChannel) { this.restTemplate = restTemplate; this.pubSubTemplate = pubSubTemplate; this.pubsubOutputChannel = pubsubOutputChannel; - this.tracing = tracing; - this.tracer = tracer; } + @Observed(contextualName = "visit-meet-endpoint") public void visitMeetEndpoint(String meetUrl) { - TraceContext context = tracing.currentTraceContext().get(); - Span span = tracer.newChild(context).name("visit-meet-endpoint").start(); LOGGER.info("starting busy work"); for (int i = 0; i < 3; i++) { this.restTemplate.getForObject(meetUrl, String.class); } LOGGER.info("finished busy work"); - span.finish(); } + @Observed(contextualName = "send-message-spring-integration") public void sendMessageSpringIntegration(String text) throws MessagingException { - TraceContext context = tracing.currentTraceContext().get(); - Span span = tracer.newChild(context).name("send-message-spring-integration").start(); final Message message = MessageBuilder.withPayload(text).setHeader(GcpPubSubHeaders.TOPIC, sampleTopic).build(); pubsubOutputChannel.send(message); - span.finish(); } + @Observed(contextualName = "send-message-pub-sub-template") public void sendMessagePubSubTemplate(String text) throws MessagingException { - TraceContext context = tracing.currentTraceContext().get(); - Span span = tracer.newChild(context).name("send-message-pub-sub-template").start(); pubSubTemplate.publish(sampleTopic, text); - span.finish(); } } From bb2d57aad8997c75cad8969ec82e70b45760c4f6 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 28 Nov 2022 17:19:00 -0500 Subject: [PATCH 096/179] fix broken tests --- .../trace/pubsub/TracePubSubAutoConfigurationTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java index f5e15c3723..779783489f 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java @@ -40,6 +40,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.ObjectProvider; +import org.springframework.boot.actuate.autoconfigure.observation.ObservationAutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.cloud.autoconfigure.RefreshAutoConfiguration; @@ -60,7 +61,8 @@ void init() { TracePubSubAutoConfiguration.class, StackdriverTraceAutoConfiguration.class, GcpContextAutoConfiguration.class, - RefreshAutoConfiguration.class)) + RefreshAutoConfiguration.class, + ObservationAutoConfiguration.class)) .withUserConfiguration(MockConfiguration.class) .withBean( StackdriverTraceAutoConfiguration.SPAN_HANDLER_BEAN_NAME, From 64951babe1245a302d1437d7ab19d582c0fa0dff Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 28 Nov 2022 17:31:01 -0500 Subject: [PATCH 097/179] change package --- .../StackdriverHttpRequestParser.java | 4 +--- .../StackdriverTraceAutoConfiguration.java | 1 - .../trace/sleuth/package-info.java | 21 ------------------- 3 files changed, 1 insertion(+), 25 deletions(-) rename spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/{sleuth => }/StackdriverHttpRequestParser.java (89%) delete mode 100644 spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/sleuth/package-info.java diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/sleuth/StackdriverHttpRequestParser.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverHttpRequestParser.java similarity index 89% rename from spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/sleuth/StackdriverHttpRequestParser.java rename to spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverHttpRequestParser.java index 9b12f3ac3d..000b63ecc4 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/sleuth/StackdriverHttpRequestParser.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverHttpRequestParser.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.cloud.spring.autoconfigure.trace.sleuth; +package com.google.cloud.spring.autoconfigure.trace; import brave.SpanCustomizer; import brave.http.HttpRequest; @@ -25,8 +25,6 @@ /** * An {@link HttpRequestParser} that fills information for Stackdriver Trace. - * - *

Based on {@code org.springframework.cloud.sleuth.instrument.web.SleuthHttpClientParser}. */ public class StackdriverHttpRequestParser implements HttpRequestParser { diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java index d9c3d9ff2e..8b02b611ef 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java @@ -27,7 +27,6 @@ import com.google.api.gax.core.CredentialsProvider; import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.FixedExecutorProvider; -import com.google.cloud.spring.autoconfigure.trace.sleuth.StackdriverHttpRequestParser; import com.google.cloud.spring.core.DefaultCredentialsProvider; import com.google.cloud.spring.core.GcpProjectIdProvider; import com.google.cloud.spring.core.UserAgentHeaderProvider; diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/sleuth/package-info.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/sleuth/package-info.java deleted file mode 100644 index f03ab1791a..0000000000 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/sleuth/package-info.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2018-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Auto-configuration for Spring Cloud GCP Trace module related to Sleuth and Stackdriver - * integration. - */ -package com.google.cloud.spring.autoconfigure.trace.sleuth; From 74f470e53041ba665d4db171c678b09bb72eb9ad Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 28 Nov 2022 18:16:58 -0500 Subject: [PATCH 098/179] add param to fix integration tests --- .../spring/data/spanner/test/domain/SingerRepository.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/test/domain/SingerRepository.java b/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/test/domain/SingerRepository.java index 55cca1255e..4c0a1b1498 100644 --- a/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/test/domain/SingerRepository.java +++ b/spring-cloud-gcp-data-spanner/src/test/java/com/google/cloud/spring/data/spanner/test/domain/SingerRepository.java @@ -18,6 +18,7 @@ import com.google.cloud.spring.data.spanner.repository.SpannerRepository; import com.google.cloud.spring.data.spanner.repository.query.Query; +import org.springframework.data.repository.query.Param; public interface SingerRepository extends SpannerRepository { @Query( @@ -25,5 +26,5 @@ public interface SingerRepository extends SpannerRepository { value = "INSERT INTO singers_list (singerId, firstName, lastName) VALUES (@singerId, @firstName," + " @lastName)") - void insert(Integer singerId, String firstName, String lastName); + void insert(@Param("singerId") Integer singerId, @Param("firstName") String firstName, @Param("lastName") String lastName); } From bded71aae292be737df7c2c58b63a5be08d283fb Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 29 Nov 2022 11:00:41 -0500 Subject: [PATCH 099/179] change variable name for `r2dbc-mysql` dependency --- spring-cloud-gcp-dependencies/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-cloud-gcp-dependencies/pom.xml b/spring-cloud-gcp-dependencies/pom.xml index 5a3c13b8c9..e3cf955339 100644 --- a/spring-cloud-gcp-dependencies/pom.xml +++ b/spring-cloud-gcp-dependencies/pom.xml @@ -32,7 +32,7 @@ 26.1.5 1.7.2 31.1-jre - 0.8.2.RELEASE + 0.8.2.RELEASE 0.8.13.RELEASE @@ -284,7 +284,7 @@ dev.miku r2dbc-mysql - ${r2dbc-mysql-driver.version} + ${r2dbc-mysql.version} From d8dc16342b621661abd9f3220d6fdc52c939ec9f Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 29 Nov 2022 11:12:37 -0500 Subject: [PATCH 100/179] remove deprecated `BigQueryTemplate` constructors --- .../bigquery/core/BigQueryTemplate.java | 43 ++----------------- 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryTemplate.java b/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryTemplate.java index 55888a7e18..57dbe7563d 100644 --- a/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryTemplate.java +++ b/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryTemplate.java @@ -52,7 +52,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.scheduling.TaskScheduler; -import org.springframework.scheduling.concurrent.DefaultManagedTaskScheduler; import org.springframework.util.Assert; import org.springframework.util.StreamUtils; @@ -86,43 +85,7 @@ public class BigQueryTemplate implements BigQueryOperations { private final Logger logger = LoggerFactory.getLogger(BigQueryTemplate.class); - private int jsonWriterBatchSize; - - /** - * Creates the {@link BigQuery} template. - * - * @param bigQuery the underlying client object used to interface with BigQuery - * @param datasetName the name of the dataset in which all operations will take place - * @deprecated As of release 3.3.1, use - * BigQueryTemplate(BigQuery,BigQueryWriteClient,Map,TaskScheduler) instead - */ - @Deprecated(forRemoval = true) - public BigQueryTemplate(BigQuery bigQuery, String datasetName) { - this(bigQuery, datasetName, new DefaultManagedTaskScheduler()); - } - - /** - * Creates the {@link BigQuery} template. - * - * @param bigQuery the underlying client object used to interface with BigQuery - * @param datasetName the name of the dataset in which all operations will take place - * @param taskScheduler the {@link TaskScheduler} used to poll for the status of long-running - * BigQuery operations - * @deprecated As of release 3.3.1, use - * BigQueryTemplate(BigQuery,BigQueryWriteClient,Map,TaskScheduler) instead - */ - @Deprecated(forRemoval = true) - public BigQueryTemplate(BigQuery bigQuery, String datasetName, TaskScheduler taskScheduler) { - Assert.notNull(bigQuery, "BigQuery client object must not be null."); - Assert.notNull(datasetName, "Dataset name must not be null"); - Assert.notNull(taskScheduler, "TaskScheduler must not be null"); - - this.bigQuery = bigQuery; - this.datasetName = datasetName; - this.taskScheduler = taskScheduler; - this.bigQueryWriteClient = - null; // This constructor is Deprecated. We cannot use BigQueryWriteClient with this - } + private final int jsonWriterBatchSize; /** * A Full constructor which creates the {@link BigQuery} template. @@ -369,7 +332,7 @@ public WriteApiResponse getWriteApiResponse(String tableName, InputStream jsonIn throw new BigQueryException("Failed to append records. \n" + e); } - // Finalize the stream before commiting it + // Finalize the stream before committing it writer.finalizeWriteStream(); BatchCommitWriteStreamsResponse commitResponse = getCommitResponse(parentTable, writer); @@ -380,7 +343,7 @@ public WriteApiResponse getWriteApiResponse(String tableName, InputStream jsonIn } } - // set isSucccessful flag to true of there were no errors + // set isSuccessful flag to true of there were no errors if (apiResponse.getErrors().isEmpty()) { apiResponse.setSuccessful(true); } From f342c1269e82bc1ef04962cf5e5e14b41505b3e5 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 29 Nov 2022 11:17:17 -0500 Subject: [PATCH 101/179] remove deprecated `SpannerPersistentEntityImpl` method --- .../mapping/SpannerPersistentEntityImpl.java | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentEntityImpl.java b/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentEntityImpl.java index 5e4293e555..347c5df183 100644 --- a/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentEntityImpl.java +++ b/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentEntityImpl.java @@ -19,7 +19,6 @@ import com.google.cloud.spanner.Key; import com.google.cloud.spanner.Type; import com.google.cloud.spring.data.spanner.core.convert.ConversionUtils; -import com.google.cloud.spring.data.spanner.core.convert.ConverterAwareMappingSpannerEntityProcessor; import com.google.cloud.spring.data.spanner.core.convert.SpannerEntityProcessor; import com.google.cloud.spring.data.spanner.core.convert.SpannerEntityWriter; import java.util.ArrayList; @@ -79,7 +78,7 @@ public class SpannerPersistentEntityImpl private final SpannerEntityProcessor spannerEntityProcessor; - private StandardEvaluationContext context; + private final StandardEvaluationContext context; private SpannerCompositeKeyProperty idProperty; @@ -91,22 +90,6 @@ public class SpannerPersistentEntityImpl private final Set> jsonProperties = new HashSet<>(); - /** - * Creates a {@link SpannerPersistentEntityImpl}. - * - * @param information type information about the underlying entity type. - * @deprecated remove on next major release. use - * {@link #SpannerPersistentEntityImpl(TypeInformation, - * SpannerMappingContext, SpannerEntityProcessor)} instead. - */ - @Deprecated - public SpannerPersistentEntityImpl(TypeInformation information) { - this( - information, - new SpannerMappingContext(), - new ConverterAwareMappingSpannerEntityProcessor(new SpannerMappingContext())); - } - /** * Creates a {@link SpannerPersistentEntityImpl}. * From f0d250f2a33b5ab763bf48e321aa36dd682effa9 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 29 Nov 2022 11:29:03 -0500 Subject: [PATCH 102/179] remove deprecated `getSubscriber` method --- .../pubsub/GcpPubSubAutoConfigurationTests.java | 8 ++++++-- .../spring/pubsub/core/PubSubConfiguration.java | 13 ------------- .../pubsub/core/PubSubConfigurationTests.java | 14 +++++++++----- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubAutoConfigurationTests.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubAutoConfigurationTests.java index 61440be6e1..aaadc4e020 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubAutoConfigurationTests.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubAutoConfigurationTests.java @@ -38,6 +38,7 @@ import com.google.cloud.spring.pubsub.support.CachingPublisherFactory; import com.google.cloud.spring.pubsub.support.DefaultPublisherFactory; import com.google.cloud.spring.pubsub.support.DefaultSubscriberFactory; +import com.google.cloud.spring.pubsub.support.PubSubSubscriptionUtils; import com.google.cloud.spring.pubsub.support.PublisherFactory; import com.google.pubsub.v1.ProjectSubscriptionName; import java.util.List; @@ -909,7 +910,8 @@ void retrySettings_globalAndSelectiveConfigurationSet_selectiveTakesPrecedence() // property set PubSubConfiguration.Retry retrySettingsForOtherSubscriber = gcpPubSubProperties - .getSubscriber("other", projectIdProvider.getProjectId()) + .getSubscriptionProperties(PubSubSubscriptionUtils + .toProjectSubscriptionName("other", projectIdProvider.getProjectId())) .getRetry(); assertThat(retrySettingsForOtherSubscriber.getTotalTimeoutSeconds()).isEqualTo(10L); assertThat(retrySettingsForOtherSubscriber.getInitialRetryDelaySeconds()).isEqualTo( @@ -1140,7 +1142,9 @@ void flowControlSettings_selectiveConfigurationSet() { PubSubConfiguration.FlowControl flowControl = gcpPubSubProperties - .getSubscriber("subscription-name", projectIdProvider.getProjectId()) + .getSubscriptionProperties( + PubSubSubscriptionUtils + .toProjectSubscriptionName("subscription-name", projectIdProvider.getProjectId())) .getFlowControl(); assertThat(flowControl.getMaxOutstandingElementCount()).isEqualTo(11L); assertThat(flowControl.getMaxOutstandingRequestBytes()).isEqualTo(12L); diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/PubSubConfiguration.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/PubSubConfiguration.java index 83326319c7..3ca6e6a791 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/PubSubConfiguration.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/PubSubConfiguration.java @@ -132,19 +132,6 @@ public void initialize(String defaultProjectId) { this.fullyQualifiedSubscriptionProperties = Collections.unmodifiableMap(fullyQualifiedProps); } - /** - * Returns properties for the specified subscription name and project ID. - * - * @param name short subscription name - * @param projectId subscription project name - * @return user-provided subscription properties - * @deprecated use {@link #getSubscriptionProperties(ProjectSubscriptionName)} instead. - */ - @Deprecated - public Subscriber getSubscriber(String name, String projectId) { - return getSubscriptionProperties(PubSubSubscriptionUtils.toProjectSubscriptionName(name, projectId)); - } - /** * Returns properties for the specified fully-qualified {@link ProjectSubscriptionName}. * diff --git a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/PubSubConfigurationTests.java b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/PubSubConfigurationTests.java index e6d7360e9e..dbd8764331 100644 --- a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/PubSubConfigurationTests.java +++ b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/PubSubConfigurationTests.java @@ -20,6 +20,7 @@ import com.google.api.gax.batching.FlowController; import com.google.api.gax.rpc.StatusCode.Code; +import com.google.cloud.spring.pubsub.support.PubSubSubscriptionUtils; import com.google.pubsub.v1.ProjectSubscriptionName; import java.util.Collections; import org.junit.jupiter.api.BeforeEach; @@ -454,7 +455,8 @@ void testSubscriberMapProperties_defaultOrGlobal_notAddedToMap() { assertThat(pubSubConfiguration.getFullyQualifiedSubscriberProperties()).isEmpty(); assertThat( pubSubConfiguration - .getSubscriber("subscription-name", "projectId") + .getSubscriptionProperties(PubSubSubscriptionUtils + .toProjectSubscriptionName("subscription-name", "projectId")) .getExecutorThreads()) .isNull(); assertThat(pubSubConfiguration.getFullyQualifiedSubscriberProperties()).isEmpty(); @@ -471,7 +473,8 @@ void testSubscriberMapProperties_subscriptionName_returnCustom() { assertThat(pubSubConfiguration.getFullyQualifiedSubscriberProperties()).hasSize(1); assertThat( pubSubConfiguration - .getSubscriber("subscription-name", "projectId") + .getSubscriptionProperties(PubSubSubscriptionUtils + .toProjectSubscriptionName("subscription-name", "projectId")) .getExecutorThreads()) .isEqualTo(8); // asserts that map did not change from a getter. Might not be needed now that map is immutable. @@ -495,7 +498,8 @@ void testSubscriberMapProperties_fullNamePresentInMap_returnCustom() { assertThat(pubSubConfiguration.getFullyQualifiedSubscriberProperties()).hasSize(1); assertThat( pubSubConfiguration - .getSubscriber(QUALIFIED_SUBSCRIPTION_NAME, "projectId") + .getSubscriptionProperties(PubSubSubscriptionUtils + .toProjectSubscriptionName(QUALIFIED_SUBSCRIPTION_NAME, "projectId")) .getExecutorThreads()) .isEqualTo(8); assertThat( @@ -517,8 +521,8 @@ void testSubscriberMapProperties_fullNamePresentInMap_projectIdIgnored_returnCus assertThat(pubSubConfiguration.getFullyQualifiedSubscriberProperties()).hasSize(1); assertThat( pubSubConfiguration - .getSubscriber( - "projects/otherProjectId/subscriptions/subscription-name", "projectId") + .getSubscriptionProperties(PubSubSubscriptionUtils + .toProjectSubscriptionName("projects/otherProjectId/subscriptions/subscription-name", "projectId")) .getExecutorThreads()) .isEqualTo(8); assertThat( From 9324ffb6ea57eca1b027bddc84d28297851cf67b Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 29 Nov 2022 11:31:32 -0500 Subject: [PATCH 103/179] remove deprecated `computeSubscriberFlowControlSettings` method --- .../spring/pubsub/core/PubSubConfiguration.java | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/PubSubConfiguration.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/PubSubConfiguration.java index 3ca6e6a791..b19652dd24 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/PubSubConfiguration.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/PubSubConfiguration.java @@ -148,22 +148,6 @@ public Subscriber getSubscriptionProperties(ProjectSubscriptionName projectSubsc return globalSubscriber; } - /** - * Computes flow control settings to use. The subscription-specific property takes precedence if - * both global and subscription-specific properties are set. If subscription-specific settings are - * not set then global settings are picked. - * - * @param subscriptionName subscription name - * @param projectId project id - * @return flow control settings - * @deprecated use {@link #computeSubscriberFlowControlSettings(ProjectSubscriptionName)} - */ - @Deprecated - public FlowControl computeSubscriberFlowControlSettings( - String subscriptionName, String projectId) { - return computeSubscriberFlowControlSettings(ProjectSubscriptionName.of(projectId, subscriptionName)); - } - /** * Computes flow control settings to use. The subscription-specific property takes precedence if * both global and subscription-specific properties are set. If subscription-specific settings are From 1934009dc30a6503ee356663ea311d947f1b19ae Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 29 Nov 2022 11:37:34 -0500 Subject: [PATCH 104/179] remove deprecated `computeSubscriberRetrySettings` method --- .../pubsub/GcpPubSubAutoConfigurationTests.java | 12 +++++------- .../spring/pubsub/core/PubSubConfiguration.java | 15 --------------- .../pubsub/core/PubSubConfigurationTests.java | 6 ++++-- 3 files changed, 9 insertions(+), 24 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubAutoConfigurationTests.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubAutoConfigurationTests.java index aaadc4e020..3f18d1e72c 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubAutoConfigurationTests.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubAutoConfigurationTests.java @@ -775,7 +775,7 @@ void retrySettings_globalConfigurationSet() { GcpProjectIdProvider projectIdProvider = ctx.getBean(GcpProjectIdProvider.class); PubSubConfiguration.Retry retrySettings = gcpPubSubProperties.computeSubscriberRetrySettings( - "subscription-name", projectIdProvider.getProjectId()); + ProjectSubscriptionName.of(projectIdProvider.getProjectId(), "subscription-name")); assertThat(retrySettings.getTotalTimeoutSeconds()).isEqualTo(1L); assertThat(retrySettings.getInitialRetryDelaySeconds()).isEqualTo(2L); assertThat(retrySettings.getRetryDelayMultiplier()).isEqualTo(3); @@ -825,8 +825,7 @@ void retrySettings_selectiveConfigurationSet() { GcpProjectIdProvider projectIdProvider = ctx.getBean(GcpProjectIdProvider.class); PubSubConfiguration.Retry retrySettings = gcpPubSubProperties.computeSubscriberRetrySettings( - "subscription-name", projectIdProvider.getProjectId()); - + ProjectSubscriptionName.of(projectIdProvider.getProjectId(), "subscription-name")); assertThat(retrySettings.getTotalTimeoutSeconds()).isEqualTo(1L); assertThat(retrySettings.getInitialRetryDelaySeconds()).isEqualTo(2L); assertThat(retrySettings.getRetryDelayMultiplier()).isEqualTo(3); @@ -892,7 +891,7 @@ void retrySettings_globalAndSelectiveConfigurationSet_selectiveTakesPrecedence() // property set PubSubConfiguration.Retry retrySettings = gcpPubSubProperties.computeSubscriberRetrySettings( - "subscription-name", projectIdProvider.getProjectId()); + ProjectSubscriptionName.of(projectIdProvider.getProjectId(), "subscription-name")); assertThat(gcpPubSubProperties.getFullyQualifiedSubscriberProperties()) .containsKey(ProjectSubscriptionName.parse( "projects/fake project/subscriptions/subscription-name")); @@ -987,8 +986,7 @@ void retrySettings_globalAndDifferentSelectiveConfigurationSet_pickGlobal() { PubSubConfiguration.Retry retrySettings = gcpPubSubProperties.computeSubscriberRetrySettings( - "subscription-name", projectIdProvider.getProjectId()); - + ProjectSubscriptionName.of(projectIdProvider.getProjectId(), "subscription-name")); assertThat(retrySettings.getTotalTimeoutSeconds()).isEqualTo(10L); assertThat(retrySettings.getInitialRetryDelaySeconds()).isEqualTo(10L); assertThat(retrySettings.getRetryDelayMultiplier()).isEqualTo(10); @@ -1037,7 +1035,7 @@ void retrySettings_subsetOfProperties_pickGlobalWhenSelectiveNotSpecified() { GcpProjectIdProvider projectIdProvider = ctx.getBean(GcpProjectIdProvider.class); PubSubConfiguration.Retry retry = gcpPubSubProperties.computeSubscriberRetrySettings( - "subscription-name", projectIdProvider.getProjectId()); + ProjectSubscriptionName.of(projectIdProvider.getProjectId(), "subscription-name")); assertThat(retry.getTotalTimeoutSeconds()).isEqualTo(10L); assertThat(retry.getInitialRetryDelaySeconds()).isEqualTo(2L); assertThat(retry.getRetryDelayMultiplier()).isEqualTo(3); diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/PubSubConfiguration.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/PubSubConfiguration.java index b19652dd24..944d586718 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/PubSubConfiguration.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/PubSubConfiguration.java @@ -291,21 +291,6 @@ public String computePullEndpoint(String subscriptionName, String projectId) { return pullEndpoint != null ? pullEndpoint : this.globalSubscriber.getPullEndpoint(); } - /** - * Computes the retry settings. The subscription-specific property takes precedence if both global - * and subscription-specific properties are set. If subscription-specific settings are not set - * then the global settings are picked. - * - * @param subscriptionName subscription name - * @param projectId project id - * @return retry settings - * @deprecated Use {{@link #computeSubscriberRetrySettings(ProjectSubscriptionName)}} - */ - @Deprecated - public Retry computeSubscriberRetrySettings(String subscriptionName, String projectId) { - return computeSubscriberRetrySettings(ProjectSubscriptionName.of(projectId, subscriptionName)); - } - /** * Computes the retry settings. The subscription-specific property takes precedence if both global * and subscription-specific properties are set. If subscription-specific settings are not set diff --git a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/PubSubConfigurationTests.java b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/PubSubConfigurationTests.java index dbd8764331..15e0249bfc 100644 --- a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/PubSubConfigurationTests.java +++ b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/PubSubConfigurationTests.java @@ -385,7 +385,8 @@ void testComputeSubscriberRetrySettings_returnCustom() { pubSubConfiguration.initialize("projectId"); PubSubConfiguration.Retry result = - pubSubConfiguration.computeSubscriberRetrySettings("subscription-name", "projectId"); + pubSubConfiguration.computeSubscriberRetrySettings( + ProjectSubscriptionName.of("projectId", "subscription-name")); assertThat(result.getTotalTimeoutSeconds()).isEqualTo(10L); assertThat(result.getInitialRetryDelaySeconds()).isEqualTo(15L); @@ -415,7 +416,8 @@ void testComputeSubscriberRetrySettings_returnGlobal() { pubSubConfiguration.initialize("projectId"); PubSubConfiguration.Retry result = - pubSubConfiguration.computeSubscriberRetrySettings("subscription-name", "projectId"); + pubSubConfiguration.computeSubscriberRetrySettings( + ProjectSubscriptionName.of("projectId", "subscription-name")); assertThat(result.getTotalTimeoutSeconds()).isEqualTo(10L); assertThat(result.getInitialRetryDelaySeconds()).isEqualTo(15L); From 9cc6ba9a4599e23ed4680bb8703738f36cf0e3ad Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 29 Nov 2022 11:59:36 -0500 Subject: [PATCH 105/179] remove deprecated constructor --- .../pubsub/support/DefaultSubscriberFactory.java | 12 ------------ .../support/DefaultSubscriberFactoryTests.java | 16 ++++++++-------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/DefaultSubscriberFactory.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/DefaultSubscriberFactory.java index 19f0bb1c7e..010fc2204f 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/DefaultSubscriberFactory.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/DefaultSubscriberFactory.java @@ -93,18 +93,6 @@ public class DefaultSubscriberFactory implements SubscriberFactory { private Code[] retryableCodes; - /** - * Default {@link DefaultSubscriberFactory} constructor. - * - * @param projectIdProvider provides the default GCP project ID for selecting the subscriptions - * @deprecated Use the new {@link DefaultSubscriberFactory - * (GcpProjectIdProvider,PubSubConfiguration)} instead - */ - @Deprecated - public DefaultSubscriberFactory(GcpProjectIdProvider projectIdProvider) { - this(projectIdProvider, getBlankConfiguration(projectIdProvider)); - } - private static PubSubConfiguration getBlankConfiguration(GcpProjectIdProvider projectIdProvider) { if (projectIdProvider == null) { return null; diff --git a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/support/DefaultSubscriberFactoryTests.java b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/support/DefaultSubscriberFactoryTests.java index 752380da51..b260ca7345 100644 --- a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/support/DefaultSubscriberFactoryTests.java +++ b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/support/DefaultSubscriberFactoryTests.java @@ -84,7 +84,7 @@ void setUp() { @Test void testNewSubscriber() { - DefaultSubscriberFactory factory = new DefaultSubscriberFactory(() -> "angeldust"); + DefaultSubscriberFactory factory = new DefaultSubscriberFactory(() -> "angeldust", pubSubConfig); factory.setCredentialsProvider(this.credentialsProvider); Subscriber subscriber = factory.createSubscriber("midnight cowboy", (message, consumer) -> {}); @@ -117,7 +117,7 @@ void testNewSubscriber_constructorWithPubSubConfiguration_nullPubSubConfiguratio @Test void testNewDefaultSubscriberFactory_nullProjectProvider() { - assertThatThrownBy(() -> new DefaultSubscriberFactory(null)) + assertThatThrownBy(() -> new DefaultSubscriberFactory(null, pubSubConfig)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("The project ID provider can't be null."); } @@ -125,7 +125,7 @@ void testNewDefaultSubscriberFactory_nullProjectProvider() { @Test void testNewDefaultSubscriberFactory_nullProject() { - assertThatThrownBy(() -> new DefaultSubscriberFactory(() -> null)) + assertThatThrownBy(() -> new DefaultSubscriberFactory(() -> null, pubSubConfig)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("The project ID can't be null or empty."); @@ -133,7 +133,7 @@ void testNewDefaultSubscriberFactory_nullProject() { @Test void testCreatePullRequest_greaterThanZeroMaxMessages() { - DefaultSubscriberFactory factory = new DefaultSubscriberFactory(() -> "project"); + DefaultSubscriberFactory factory = new DefaultSubscriberFactory(() -> "project", pubSubConfig); factory.setCredentialsProvider(this.credentialsProvider); assertThatThrownBy(() -> factory.createPullRequest("test", -1, true)) @@ -143,7 +143,7 @@ void testCreatePullRequest_greaterThanZeroMaxMessages() { @Test void testCreatePullRequest_nonNullMaxMessages() { - DefaultSubscriberFactory factory = new DefaultSubscriberFactory(() -> "project"); + DefaultSubscriberFactory factory = new DefaultSubscriberFactory(() -> "project", pubSubConfig); factory.setCredentialsProvider(this.credentialsProvider); PullRequest request = factory.createPullRequest("test", null, true); @@ -728,7 +728,7 @@ void createSubscriberStubSucceeds() { DefaultSubscriberFactory factory = new DefaultSubscriberFactory(projectIdProvider, this.pubSubConfig); factory.setChannelProvider(FixedTransportChannelProvider.create(this.mockTransportChannel)); - factory.setCredentialsProvider(() -> NoCredentials.getInstance()); + factory.setCredentialsProvider(NoCredentials::getInstance); SubscriberStub stub = factory.createSubscriberStub("unusedSubscription"); assertThat(stub.isShutdown()).isFalse(); @@ -758,7 +758,7 @@ void testNewSubscriber_shouldNotAddToHealthCheck() { when(healthTrackerRegistry.isTracked(subscriptionName)).thenReturn(true); - DefaultSubscriberFactory factory = new DefaultSubscriberFactory(() -> "angeldust"); + DefaultSubscriberFactory factory = new DefaultSubscriberFactory(() -> "angeldust", pubSubConfig); factory.setCredentialsProvider(this.credentialsProvider); factory.setHealthTrackerRegistry(healthTrackerRegistry); @@ -777,7 +777,7 @@ void testNewSubscriber_shouldAddToHealthCheck() { when(healthTrackerRegistry.isTracked(subscriptionName)).thenReturn(false); - DefaultSubscriberFactory factory = new DefaultSubscriberFactory(() -> "angeldust"); + DefaultSubscriberFactory factory = new DefaultSubscriberFactory(() -> "angeldust", pubSubConfig); factory.setCredentialsProvider(this.credentialsProvider); factory.setHealthTrackerRegistry(healthTrackerRegistry); From 03aaa86bebcd4c58d9930cebeff526d64a553ff0 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 29 Nov 2022 13:24:42 -0500 Subject: [PATCH 106/179] remove used private method --- .../spring/pubsub/support/DefaultSubscriberFactory.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/DefaultSubscriberFactory.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/DefaultSubscriberFactory.java index 010fc2204f..55373404c3 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/DefaultSubscriberFactory.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/DefaultSubscriberFactory.java @@ -93,15 +93,6 @@ public class DefaultSubscriberFactory implements SubscriberFactory { private Code[] retryableCodes; - private static PubSubConfiguration getBlankConfiguration(GcpProjectIdProvider projectIdProvider) { - if (projectIdProvider == null) { - return null; - } - PubSubConfiguration config = new PubSubConfiguration(); - config.initialize(projectIdProvider.getProjectId()); - return config; - } - /** * Default {@link DefaultSubscriberFactory} constructor. * From 54783374d1169fcc192b83652bf3bab487b8c73b Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 29 Nov 2022 13:41:38 -0500 Subject: [PATCH 107/179] remove deprecated methods --- .../extensions/LogstashLoggingEventEnhancer.java | 13 +++++++++---- .../LogstashLoggingEventEnhancerTests.java | 5 +++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/spring-cloud-gcp-logging/src/main/java/com/google/cloud/spring/logging/extensions/LogstashLoggingEventEnhancer.java b/spring-cloud-gcp-logging/src/main/java/com/google/cloud/spring/logging/extensions/LogstashLoggingEventEnhancer.java index f0d01a9361..ca59c65c5d 100644 --- a/spring-cloud-gcp-logging/src/main/java/com/google/cloud/spring/logging/extensions/LogstashLoggingEventEnhancer.java +++ b/spring-cloud-gcp-logging/src/main/java/com/google/cloud/spring/logging/extensions/LogstashLoggingEventEnhancer.java @@ -21,6 +21,7 @@ import com.google.cloud.logging.logback.LoggingEventEnhancer; import com.google.cloud.spring.logging.JsonLoggingEventEnhancer; import java.util.Iterator; +import java.util.List; import java.util.Map; import java.util.function.Consumer; import net.logstash.logback.marker.ObjectAppendingMarker; @@ -41,14 +42,19 @@ public class LogstashLoggingEventEnhancer @Override public void enhanceLogEntry(LogEntry.Builder builder, ILoggingEvent event) { addLogstashMarkerIfNecessary( - event.getMarker(), + getFirstMarker(event.getMarkerList()), marker -> builder.addLabel(marker.getFieldName(), marker.getFieldValue().toString())); } @Override public void enhanceJsonLogEntry(Map jsonMap, ILoggingEvent event) { addLogstashMarkerIfNecessary( - event.getMarker(), marker -> jsonMap.put(marker.getFieldName(), marker.getFieldValue())); + getFirstMarker(event.getMarkerList()), + marker -> jsonMap.put(marker.getFieldName(), marker.getFieldValue())); + } + + private Marker getFirstMarker(List markers) { + return markers == null || markers.isEmpty() ? null : markers.get(0); } private void addLogstashMarkerIfNecessary( @@ -57,8 +63,7 @@ private void addLogstashMarkerIfNecessary( return; } - if (marker instanceof ObjectAppendingMarker) { - ObjectAppendingMarker objectAppendingMarker = (ObjectAppendingMarker) marker; + if (marker instanceof ObjectAppendingMarker objectAppendingMarker) { markerAdderFunction.accept(objectAppendingMarker); } diff --git a/spring-cloud-gcp-logging/src/test/java/com/google/cloud/spring/logging/extensions/LogstashLoggingEventEnhancerTests.java b/spring-cloud-gcp-logging/src/test/java/com/google/cloud/spring/logging/extensions/LogstashLoggingEventEnhancerTests.java index 22a9507013..968e159e7d 100644 --- a/spring-cloud-gcp-logging/src/test/java/com/google/cloud/spring/logging/extensions/LogstashLoggingEventEnhancerTests.java +++ b/spring-cloud-gcp-logging/src/test/java/com/google/cloud/spring/logging/extensions/LogstashLoggingEventEnhancerTests.java @@ -23,6 +23,7 @@ import com.google.cloud.logging.LogEntry; import com.google.cloud.logging.Payload; import java.util.HashMap; +import java.util.List; import java.util.Map; import net.logstash.logback.marker.Markers; import org.junit.jupiter.api.BeforeEach; @@ -41,8 +42,8 @@ void setup() { enhancer = new LogstashLoggingEventEnhancer(); loggingEvent = Mockito.mock(ILoggingEvent.class); - when(loggingEvent.getMarker()) - .thenReturn(Markers.append("k1", "v1").and(Markers.append("k2", "v2"))); + when(loggingEvent.getMarkerList()) + .thenReturn(List.of(Markers.append("k1", "v1").and(Markers.append("k2", "v2")))); } @Test From 96d96a0c78bd8e8df42d4250cdc85ca3cec712a4 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 29 Nov 2022 15:21:08 -0500 Subject: [PATCH 108/179] remove deprecated method --- .../cloud/spring/pubsub/PubSubAdmin.java | 6 ++---- .../cloud/spring/pubsub/PubSubAdminTests.java | 18 +++++++++--------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/PubSubAdmin.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/PubSubAdmin.java index cf2cc5e258..c98cdef90d 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/PubSubAdmin.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/PubSubAdmin.java @@ -290,8 +290,7 @@ public Subscription getSubscription(String subscriptionName) { Assert.hasText(subscriptionName, "No subscription name was specified"); try { - return this.subscriptionAdminClient.getSubscription( - PubSubSubscriptionUtils.toProjectSubscriptionName(subscriptionName, this.projectId)); + return this.subscriptionAdminClient.getSubscription(subscriptionName); } catch (ApiException aex) { if (aex.getStatusCode().getCode() == StatusCode.Code.NOT_FOUND) { return null; @@ -311,8 +310,7 @@ public Subscription getSubscription(String subscriptionName) { public void deleteSubscription(String subscriptionName) { Assert.hasText(subscriptionName, "No subscription name was specified"); - this.subscriptionAdminClient.deleteSubscription( - PubSubSubscriptionUtils.toProjectSubscriptionName(subscriptionName, this.projectId)); + this.subscriptionAdminClient.deleteSubscription(subscriptionName); } /** diff --git a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/PubSubAdminTests.java b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/PubSubAdminTests.java index 20cde0df3d..9dfbaddfb8 100644 --- a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/PubSubAdminTests.java +++ b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/PubSubAdminTests.java @@ -19,6 +19,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -29,7 +30,6 @@ import com.google.cloud.pubsub.v1.SubscriptionAdminClient; import com.google.cloud.pubsub.v1.TopicAdminClient; import com.google.pubsub.v1.ProjectName; -import com.google.pubsub.v1.ProjectSubscriptionName; import com.google.pubsub.v1.PushConfig; import com.google.pubsub.v1.Subscription; import com.google.pubsub.v1.TopicName; @@ -236,7 +236,7 @@ void testGetSubscription() { () -> "test-project", this.mockTopicAdminClient, this.mockSubscriptionAdminClient) .getSubscription("fooSubscription"); verify(this.mockSubscriptionAdminClient) - .getSubscription(ProjectSubscriptionName.of("test-project", "fooSubscription")); + .getSubscription("fooSubscription"); } @Test @@ -245,12 +245,12 @@ void testGetSubscription_fullName() { () -> "test-project", this.mockTopicAdminClient, this.mockSubscriptionAdminClient) .getSubscription("projects/differentProject/subscriptions/fooSubscription"); verify(this.mockSubscriptionAdminClient) - .getSubscription(ProjectSubscriptionName.of("differentProject", "fooSubscription")); + .getSubscription("projects/differentProject/subscriptions/fooSubscription"); } @Test void testGetSubscription_notFound() { - when(this.mockSubscriptionAdminClient.getSubscription(any(ProjectSubscriptionName.class))) + when(this.mockSubscriptionAdminClient.getSubscription(anyString())) .thenThrow(new ApiException(null, GrpcStatusCode.of(io.grpc.Status.Code.NOT_FOUND), false)); assertThat( new PubSubAdmin( @@ -260,12 +260,12 @@ void testGetSubscription_notFound() { .getSubscription("fooSubscription")) .isNull(); verify(this.mockSubscriptionAdminClient) - .getSubscription(ProjectSubscriptionName.of("test-project", "fooSubscription")); + .getSubscription("fooSubscription"); } @Test void testGetSubscription_serviceDown() { - when(this.mockSubscriptionAdminClient.getSubscription(any(ProjectSubscriptionName.class))) + when(this.mockSubscriptionAdminClient.getSubscription(anyString())) .thenThrow( new ApiException(null, GrpcStatusCode.of(io.grpc.Status.Code.UNAVAILABLE), false)); PubSubAdmin psa = @@ -275,7 +275,7 @@ void testGetSubscription_serviceDown() { assertThatExceptionOfType(ApiException.class) .isThrownBy(() -> psa.getSubscription("fooSubscription")); verify(this.mockSubscriptionAdminClient) - .getSubscription(ProjectSubscriptionName.of("test-project", "fooSubscription")); + .getSubscription("fooSubscription"); } @Test @@ -284,7 +284,7 @@ void testDeleteSubscription() { () -> "test-project", this.mockTopicAdminClient, this.mockSubscriptionAdminClient) .deleteSubscription("fooSubscription"); verify(this.mockSubscriptionAdminClient) - .deleteSubscription(ProjectSubscriptionName.of("test-project", "fooSubscription")); + .deleteSubscription("fooSubscription"); } @Test @@ -293,7 +293,7 @@ void testDeleteSubscription_fullName() { () -> "test-project", this.mockTopicAdminClient, this.mockSubscriptionAdminClient) .deleteSubscription("projects/differentProject/subscriptions/fooSubscription"); verify(this.mockSubscriptionAdminClient) - .deleteSubscription(ProjectSubscriptionName.of("differentProject", "fooSubscription")); + .deleteSubscription("projects/differentProject/subscriptions/fooSubscription"); } @Test From 9848f3f01047024598250b132da6de141ace4974 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 29 Nov 2022 21:02:17 -0500 Subject: [PATCH 109/179] remove deprecated `getUpdateTime` method --- .../cloud/spring/storage/GoogleStorageResource.java | 4 ++-- .../spring/storage/integration/GcsFileInfo.java | 4 ++-- .../GcsAcceptModifiedAfterFileListFilter.java | 8 +++++--- .../GcsDiscardRecentModifiedFileListFilter.java | 7 ++++--- .../GcsPersistentAcceptOnceFileListFilter.java | 3 ++- .../inbound/GcsInboundFileSynchronizer.java | 2 +- .../GcsAcceptModifiedAfterFileListFilterTest.java | 13 +++++++------ .../GcsDiscardRecentModifiedFileListFilterTest.java | 13 +++++++------ .../GcsPersistentAcceptOnceFileListFilterTest.java | 2 +- .../inbound/GcsInboundFileSynchronizerTests.java | 4 ++++ 10 files changed, 35 insertions(+), 25 deletions(-) diff --git a/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/GoogleStorageResource.java b/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/GoogleStorageResource.java index 93f3086248..d917a3ee0e 100644 --- a/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/GoogleStorageResource.java +++ b/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/GoogleStorageResource.java @@ -255,7 +255,7 @@ public long contentLength() throws IOException { @Override public long lastModified() throws IOException { - return throwExceptionForNullBlob(getBlob()).getUpdateTime(); + return throwExceptionForNullBlob(getBlob()).getUpdateTimeOffsetDateTime().toEpochSecond(); } /** @@ -270,7 +270,7 @@ public long lastModified() throws IOException { */ @Override @NonNull - public GoogleStorageResource createRelative(String relativePath) { + public GoogleStorageResource createRelative(@NonNull String relativePath) { return new GoogleStorageResource( this.storage, getURI().resolve(relativePath).toString(), this.autoCreateFiles); } diff --git a/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/GcsFileInfo.java b/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/GcsFileInfo.java index 5e79813ae3..5923edffe5 100644 --- a/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/GcsFileInfo.java +++ b/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/GcsFileInfo.java @@ -24,7 +24,7 @@ /** An object that holds metadata information for a Cloud Storage file. */ public class GcsFileInfo extends AbstractFileInfo { - private BlobInfo gcsFile; + private final BlobInfo gcsFile; public GcsFileInfo(BlobInfo gcsFile) { Assert.notNull(gcsFile, "The GCS blob can't be null."); @@ -48,7 +48,7 @@ public long getSize() { @Override public long getModified() { - return this.gcsFile.getUpdateTime(); + return this.gcsFile.getUpdateTimeOffsetDateTime().toEpochSecond(); } @Override diff --git a/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/filters/GcsAcceptModifiedAfterFileListFilter.java b/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/filters/GcsAcceptModifiedAfterFileListFilter.java index 0bf44d1bda..cf04f34432 100644 --- a/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/filters/GcsAcceptModifiedAfterFileListFilter.java +++ b/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/filters/GcsAcceptModifiedAfterFileListFilter.java @@ -29,8 +29,9 @@ * The {@link GcsAcceptModifiedAfterFileListFilter} is a filter which accepts all files that were * modified after a specified point in time. * - *

More specifically, it accepts (includes) all files whose {@link BlobInfo#getUpdateTime()} is - * after (greater than or equal to) the {@link #acceptAfterCutoffTimestamp}. + *

More specifically, it accepts (includes) all files whose + * {@link BlobInfo#getUpdateTimeOffsetDateTime()} is after (greater than or equal to) the + * {@link #acceptAfterCutoffTimestamp}. * *

{@link #acceptAfterCutoffTimestamp} defaults to Instant.now() (UTC) in millis, but an * alternative {@link Instant} can be provided via the constructor. @@ -78,7 +79,8 @@ public boolean accept(BlobInfo file) { } private boolean fileUpdateTimeOnOrAfterPointInTime(BlobInfo file) { - return file.getUpdateTime() >= acceptAfterCutoffTimestamp; + return file.getUpdateTimeOffsetDateTime().toInstant().toEpochMilli() + >= acceptAfterCutoffTimestamp; } @Override diff --git a/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/filters/GcsDiscardRecentModifiedFileListFilter.java b/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/filters/GcsDiscardRecentModifiedFileListFilter.java index d23f190c37..14ee46c105 100644 --- a/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/filters/GcsDiscardRecentModifiedFileListFilter.java +++ b/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/filters/GcsDiscardRecentModifiedFileListFilter.java @@ -28,8 +28,8 @@ * The {@link GcsDiscardRecentModifiedFileListFilter} is a filter which excludes all files that were * updated less than some specified amount of time ago. * - *

More specifically, it excludes all files whose {@link BlobInfo#getUpdateTime()} is within - * {@link #age} of the current time. + *

More specifically, it excludes all files whose {@link BlobInfo#getUpdateTimeOffsetDateTime()} + * is within {@link #age} of the current time. * *

When {@link #discardCallback} is provided, it called for all the rejected files. */ @@ -76,7 +76,8 @@ public boolean accept(BlobInfo file) { } private boolean fileIsAged(BlobInfo file) { - return file.getUpdateTime() + this.age.toMillis() <= System.currentTimeMillis(); + return file.getUpdateTimeOffsetDateTime().toInstant().toEpochMilli() + this.age.toMillis() + <= System.currentTimeMillis(); } @Override diff --git a/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/filters/GcsPersistentAcceptOnceFileListFilter.java b/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/filters/GcsPersistentAcceptOnceFileListFilter.java index 23196ee8cd..18f58158a8 100644 --- a/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/filters/GcsPersistentAcceptOnceFileListFilter.java +++ b/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/filters/GcsPersistentAcceptOnceFileListFilter.java @@ -30,7 +30,8 @@ public GcsPersistentAcceptOnceFileListFilter(ConcurrentMetadataStore store, Stri @Override protected long modified(BlobInfo blobInfo) { - return (blobInfo != null && blobInfo.getUpdateTime() != null) ? blobInfo.getUpdateTime() : -1; + return (blobInfo != null && blobInfo.getUpdateTimeOffsetDateTime() != null) + ? blobInfo.getUpdateTimeOffsetDateTime().toInstant().toEpochMilli() : -1; } @Override diff --git a/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/inbound/GcsInboundFileSynchronizer.java b/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/inbound/GcsInboundFileSynchronizer.java index 02285fafa4..2a33c98a19 100644 --- a/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/inbound/GcsInboundFileSynchronizer.java +++ b/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/inbound/GcsInboundFileSynchronizer.java @@ -44,7 +44,7 @@ protected String getFilename(BlobInfo file) { @Override protected long getModified(BlobInfo file) { - return file.getUpdateTime(); + return file.getUpdateTimeOffsetDateTime().toInstant().toEpochMilli(); } @Override diff --git a/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/filters/GcsAcceptModifiedAfterFileListFilterTest.java b/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/filters/GcsAcceptModifiedAfterFileListFilterTest.java index bd2ec4130b..51d1478c6b 100644 --- a/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/filters/GcsAcceptModifiedAfterFileListFilterTest.java +++ b/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/filters/GcsAcceptModifiedAfterFileListFilterTest.java @@ -22,6 +22,7 @@ import com.google.cloud.storage.BlobInfo; import java.time.Instant; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.concurrent.atomic.AtomicBoolean; import org.junit.jupiter.api.Test; @@ -37,7 +38,7 @@ void addDiscardCallback() { filter.addDiscardCallback(blobInfo -> callbackTriggered.set(true)); BlobInfo blobInfo = mock(BlobInfo.class); - when(blobInfo.getUpdateTime()).thenReturn(1L); + when(blobInfo.getUpdateTimeOffsetDateTime()).thenReturn(OffsetDateTime.now().minusDays(1L)); filter.accept(blobInfo); @@ -47,23 +48,23 @@ void addDiscardCallback() { @Test void filterFiles() { - Instant now = Instant.now(); + OffsetDateTime now = OffsetDateTime.now(); BlobInfo oldBlob = mock(BlobInfo.class); - when(oldBlob.getUpdateTime()).thenReturn(now.toEpochMilli() - 1); + when(oldBlob.getUpdateTimeOffsetDateTime()).thenReturn(now.minusMinutes(1L)); BlobInfo currentBlob = mock(BlobInfo.class); - when(currentBlob.getUpdateTime()).thenReturn(now.toEpochMilli()); + when(currentBlob.getUpdateTimeOffsetDateTime()).thenReturn(now); BlobInfo newBlob = mock(BlobInfo.class); - when(newBlob.getUpdateTime()).thenReturn(now.toEpochMilli() + 1); + when(newBlob.getUpdateTimeOffsetDateTime()).thenReturn(now.plusMinutes(1L)); ArrayList expected = new ArrayList<>(); expected.add(currentBlob); expected.add(newBlob); assertThat( - new GcsAcceptModifiedAfterFileListFilter(now) + new GcsAcceptModifiedAfterFileListFilter(now.toInstant()) .filterFiles(new BlobInfo[] {oldBlob, currentBlob, newBlob})) .isEqualTo(expected); } diff --git a/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/filters/GcsDiscardRecentModifiedFileListFilterTest.java b/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/filters/GcsDiscardRecentModifiedFileListFilterTest.java index 31dd8f9f44..83bc98df98 100644 --- a/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/filters/GcsDiscardRecentModifiedFileListFilterTest.java +++ b/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/filters/GcsDiscardRecentModifiedFileListFilterTest.java @@ -22,10 +22,11 @@ import com.google.cloud.storage.BlobInfo; import java.time.Duration; +import java.time.OffsetDateTime; import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.concurrent.atomic.AtomicBoolean; -import org.junit.Assert; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; class GcsDiscardRecentModifiedFileListFilterTest { @@ -38,8 +39,8 @@ void testFileLessThanMinimumAgeIsFilteredOut() { filter.addDiscardCallback(blobInfo -> callbackTriggered.set(true)); BlobInfo blobInfo = mock(BlobInfo.class); - when(blobInfo.getUpdateTime()) - .thenReturn(ZonedDateTime.now(ZoneId.systemDefault()).toInstant().toEpochMilli()); + when(blobInfo.getUpdateTimeOffsetDateTime()) + .thenReturn(OffsetDateTime.now(ZoneId.systemDefault())); assertThat(filter.filterFiles(new BlobInfo[] {blobInfo})).isEmpty(); assertThat(filter.accept(blobInfo)).isFalse(); @@ -51,12 +52,12 @@ void testFileLessThanMinimumAgeIsFilteredOut() { void testFileOlderThanMinimumAgeIsReturned() { GcsDiscardRecentModifiedFileListFilter filter = new GcsDiscardRecentModifiedFileListFilter(Duration.ofSeconds(60)); - filter.addDiscardCallback(blobInfo -> Assert.fail("Not expected")); + filter.addDiscardCallback(blobInfo -> Assertions.fail("Not expected")); BlobInfo blobInfo = mock(BlobInfo.class); - when(blobInfo.getUpdateTime()) + when(blobInfo.getUpdateTimeOffsetDateTime()) .thenReturn( - ZonedDateTime.now(ZoneId.systemDefault()).minusMinutes(3).toInstant().toEpochMilli()); + OffsetDateTime.now(ZoneId.systemDefault()).minusMinutes(3)); assertThat(filter.filterFiles(new BlobInfo[] {blobInfo})).hasSize(1); assertThat(filter.accept(blobInfo)).isTrue(); diff --git a/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/filters/GcsPersistentAcceptOnceFileListFilterTest.java b/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/filters/GcsPersistentAcceptOnceFileListFilterTest.java index b6b41f3357..26f8fb7b6f 100644 --- a/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/filters/GcsPersistentAcceptOnceFileListFilterTest.java +++ b/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/filters/GcsPersistentAcceptOnceFileListFilterTest.java @@ -38,7 +38,7 @@ void modified_blobInfoIsNull_shouldReturnMinusOne() { @Test void modified_updateTimeIsNull_shouldReturnMinusOne() { BlobInfo blobInfo = mock(BlobInfo.class); - when(blobInfo.getUpdateTime()).thenReturn(null); + when(blobInfo.getUpdateTimeOffsetDateTime()).thenReturn(null); assertThat( new GcsPersistentAcceptOnceFileListFilter(mock(ConcurrentMetadataStore.class), "") diff --git a/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/inbound/GcsInboundFileSynchronizerTests.java b/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/inbound/GcsInboundFileSynchronizerTests.java index 01ccb67987..9d232c610d 100644 --- a/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/inbound/GcsInboundFileSynchronizerTests.java +++ b/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/inbound/GcsInboundFileSynchronizerTests.java @@ -20,6 +20,7 @@ import static org.mockito.ArgumentMatchers.eq; import static org.mockito.BDDMockito.willAnswer; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; import com.google.cloud.PageImpl; import com.google.cloud.storage.Blob; @@ -29,6 +30,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.time.OffsetDateTime; import java.util.stream.Collectors; import java.util.stream.Stream; import org.apache.commons.logging.Log; @@ -121,6 +123,8 @@ public Storage gcs() { Blob blob1 = mock(Blob.class); Blob blob2 = mock(Blob.class); + when(blob1.getUpdateTimeOffsetDateTime()).thenReturn(OffsetDateTime.now()); + when(blob2.getUpdateTimeOffsetDateTime()).thenReturn(OffsetDateTime.now()); willAnswer(invocation -> "legend of heroes").given(blob1).getName(); willAnswer(invocation -> "trails in the sky").given(blob2).getName(); From f3d673a811978cbba83d8a987b16ac1830341138 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 29 Nov 2022 22:58:17 -0500 Subject: [PATCH 110/179] fix broken tests --- .../it/PubSubChannelAdaptersIntegrationTests.java | 3 +-- .../pubsub/it/PubSubTemplateIntegrationTests.java | 5 ++--- ...essageChannelBinderEmulatorIntegrationTests.java | 2 +- .../com/google/cloud/spring/pubsub/PubSubAdmin.java | 8 ++++++-- .../pubsub/support/PubSubSubscriptionUtils.java | 2 +- .../cloud/spring/pubsub/PubSubAdminTests.java | 13 +++++++++---- .../TraceSampleApplicationIntegrationTests.java | 2 +- 7 files changed, 21 insertions(+), 14 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubChannelAdaptersIntegrationTests.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubChannelAdaptersIntegrationTests.java index a4ed4b0803..05c0591af0 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubChannelAdaptersIntegrationTests.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubChannelAdaptersIntegrationTests.java @@ -120,7 +120,7 @@ void sendAndReceiveMessageAsString() { .run( context -> { Map headers = new HashMap<>(); - // Only String values for now.. + // Only String values for now. headers.put("storm", "lift your skinny fists"); headers.put("static", "lift your skinny fists"); headers.put("sleep", "lift your skinny fists"); @@ -259,7 +259,6 @@ void sendAndReceiveMessageAutoAckWithFailure() { } @Test - @SuppressWarnings("deprecation") void sendAndReceiveMessageManualAckThroughAcknowledgementHeader() { this.contextRunner .withUserConfiguration(PollableConfiguration.class, CommonConfiguration.class) diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubTemplateIntegrationTests.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubTemplateIntegrationTests.java index 141ce1c784..91cf6d73db 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubTemplateIntegrationTests.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubTemplateIntegrationTests.java @@ -50,7 +50,6 @@ import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; -import java.util.stream.Collectors; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.awaitility.Awaitility; @@ -181,10 +180,10 @@ void testPullAndAck() { messagesSet.addAll( newMessages.stream() .map(message -> message.getPubsubMessage().getData().toStringUtf8()) - .collect(Collectors.toList())); + .toList()); } - assertThat(messagesSet.size()).as("check that we received all the messages").isEqualTo(3); + assertThat(messagesSet).as("check that we received all the messages").hasSize(3); ackableMessages.forEach( message -> { diff --git a/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/PubSubMessageChannelBinderEmulatorIntegrationTests.java b/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/PubSubMessageChannelBinderEmulatorIntegrationTests.java index 4502c6fd41..a1ec157874 100644 --- a/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/PubSubMessageChannelBinderEmulatorIntegrationTests.java +++ b/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/PubSubMessageChannelBinderEmulatorIntegrationTests.java @@ -47,7 +47,7 @@ class PubSubMessageChannelBinderEmulatorIntegrationTests ExtendedConsumerProperties, ExtendedProducerProperties> { - private String hostPort; + private final String hostPort; private TestInfo testInfo; diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/PubSubAdmin.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/PubSubAdmin.java index c98cdef90d..cdb0e696a5 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/PubSubAdmin.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/PubSubAdmin.java @@ -290,7 +290,9 @@ public Subscription getSubscription(String subscriptionName) { Assert.hasText(subscriptionName, "No subscription name was specified"); try { - return this.subscriptionAdminClient.getSubscription(subscriptionName); + return this.subscriptionAdminClient.getSubscription( + PubSubSubscriptionUtils + .toProjectSubscriptionName(subscriptionName, this.projectId).toString()); } catch (ApiException aex) { if (aex.getStatusCode().getCode() == StatusCode.Code.NOT_FOUND) { return null; @@ -310,7 +312,9 @@ public Subscription getSubscription(String subscriptionName) { public void deleteSubscription(String subscriptionName) { Assert.hasText(subscriptionName, "No subscription name was specified"); - this.subscriptionAdminClient.deleteSubscription(subscriptionName); + this.subscriptionAdminClient.deleteSubscription( + PubSubSubscriptionUtils + .toProjectSubscriptionName(subscriptionName, this.projectId).toString()); } /** diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/PubSubSubscriptionUtils.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/PubSubSubscriptionUtils.java index daa7eb3560..3a5db2f2d9 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/PubSubSubscriptionUtils.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/PubSubSubscriptionUtils.java @@ -33,7 +33,7 @@ private PubSubSubscriptionUtils() {} * Create a {@link ProjectSubscriptionName} based on a subscription name within a project or the * fully-qualified subscription name. If the specified subscription is in the {@code * projects/[project_name]/subscriptions/[subscription_name]} format, then the {@code projectId} - * is ignored} + * is ignored. * * @param subscription the subscription name in the project or the fully-qualified project name * @param projectId the project ID to use if the subscription is not a fully-qualified name diff --git a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/PubSubAdminTests.java b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/PubSubAdminTests.java index 9dfbaddfb8..ca36ccd022 100644 --- a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/PubSubAdminTests.java +++ b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/PubSubAdminTests.java @@ -29,6 +29,7 @@ import com.google.cloud.NoCredentials; import com.google.cloud.pubsub.v1.SubscriptionAdminClient; import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.cloud.spring.pubsub.support.PubSubSubscriptionUtils; import com.google.pubsub.v1.ProjectName; import com.google.pubsub.v1.PushConfig; import com.google.pubsub.v1.Subscription; @@ -236,7 +237,8 @@ void testGetSubscription() { () -> "test-project", this.mockTopicAdminClient, this.mockSubscriptionAdminClient) .getSubscription("fooSubscription"); verify(this.mockSubscriptionAdminClient) - .getSubscription("fooSubscription"); + .getSubscription( + PubSubSubscriptionUtils.toProjectSubscriptionName("fooSubscription", "test-project").toString()); } @Test @@ -260,7 +262,8 @@ void testGetSubscription_notFound() { .getSubscription("fooSubscription")) .isNull(); verify(this.mockSubscriptionAdminClient) - .getSubscription("fooSubscription"); + .getSubscription( + PubSubSubscriptionUtils.toProjectSubscriptionName("fooSubscription", "test-project").toString()); } @Test @@ -275,7 +278,8 @@ void testGetSubscription_serviceDown() { assertThatExceptionOfType(ApiException.class) .isThrownBy(() -> psa.getSubscription("fooSubscription")); verify(this.mockSubscriptionAdminClient) - .getSubscription("fooSubscription"); + .getSubscription( + PubSubSubscriptionUtils.toProjectSubscriptionName("fooSubscription", "test-project").toString()); } @Test @@ -284,7 +288,8 @@ void testDeleteSubscription() { () -> "test-project", this.mockTopicAdminClient, this.mockSubscriptionAdminClient) .deleteSubscription("fooSubscription"); verify(this.mockSubscriptionAdminClient) - .deleteSubscription("fooSubscription"); + .deleteSubscription( + PubSubSubscriptionUtils.toProjectSubscriptionName("fooSubscription", "test-project").toString()); } @Test diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java index c553161e09..215e9e16e0 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java @@ -260,7 +260,7 @@ void testTracesAreLoggedCorrectly() { ((JsonPayload) logEntry.getPayload()) .getDataAsMap() .get("message")) - .collect(Collectors.toList()); + .toList(); log.info( "\n========================= [START OF LOG CONTENTS] =========================\n" From feebdf4cbf93fcdbf23fe82d02414f35cb3eab50 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Wed, 30 Nov 2022 13:55:04 -0500 Subject: [PATCH 111/179] change `getModified` to return milliseconds rather than seconds --- .../google/cloud/spring/storage/integration/GcsFileInfo.java | 2 +- .../cloud/spring/storage/integration/GcsFileInfoTests.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/GcsFileInfoTests.java diff --git a/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/GcsFileInfo.java b/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/GcsFileInfo.java index 5923edffe5..a26ac74a4d 100644 --- a/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/GcsFileInfo.java +++ b/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/integration/GcsFileInfo.java @@ -48,7 +48,7 @@ public long getSize() { @Override public long getModified() { - return this.gcsFile.getUpdateTimeOffsetDateTime().toEpochSecond(); + return this.gcsFile.getUpdateTimeOffsetDateTime().toInstant().toEpochMilli(); } @Override diff --git a/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/GcsFileInfoTests.java b/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/GcsFileInfoTests.java new file mode 100644 index 0000000000..a4e378df8e --- /dev/null +++ b/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/GcsFileInfoTests.java @@ -0,0 +1,2 @@ +package com.google.cloud.spring.storage.integration;public class GcsFileInfoTests { +} From 3efe0793abf31df9a3083f127d005bda04d48066 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Wed, 30 Nov 2022 13:55:51 -0500 Subject: [PATCH 112/179] polish --- .../spring/storage/GoogleStorageTests.java | 121 +++++++++--------- 1 file changed, 61 insertions(+), 60 deletions(-) diff --git a/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/GoogleStorageTests.java b/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/GoogleStorageTests.java index c11dec591f..247d8c74b6 100644 --- a/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/GoogleStorageTests.java +++ b/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/GoogleStorageTests.java @@ -17,6 +17,10 @@ package com.google.cloud.spring.storage; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; @@ -37,7 +41,7 @@ import java.io.IOException; import java.io.OutputStream; import java.util.concurrent.TimeUnit; -import org.junit.Assert; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; @@ -89,40 +93,39 @@ void testValidObject() throws Exception { when(mockedBlob.getSize()).thenReturn(4096L); when(this.mockStorage.get(validBlobId)).thenReturn(mockedBlob); - Assert.assertTrue(this.remoteResource.exists()); - Assert.assertEquals(4096L, this.remoteResource.contentLength()); + assertTrue(this.remoteResource.exists()); + assertEquals(4096L, this.remoteResource.contentLength()); } @Test - void testValidObjectWithUnderscore() throws Exception { + void testValidObjectWithUnderscore() { BlobId validBlobWithUnderscore = BlobId.of("test_spring", "images/spring.png"); Blob mockedBlob = mock(Blob.class); when(mockStorage.get(validBlobWithUnderscore)).thenReturn(mockedBlob); - Assert.assertTrue(this.remoteResourceWithUnderscore.exists()); + assertTrue(this.remoteResourceWithUnderscore.exists()); } @Test void testValidBucket() throws IOException { - Assert.assertEquals("gs://test-spring/", this.bucketResource.getDescription()); - Assert.assertEquals("test-spring", this.bucketResource.getFilename()); - Assert.assertEquals("gs://test-spring/", this.bucketResource.getURI().toString()); + assertEquals("gs://test-spring/", this.bucketResource.getDescription()); + assertEquals("test-spring", this.bucketResource.getFilename()); + assertEquals("gs://test-spring/", this.bucketResource.getURI().toString()); String relative = this.bucketResource.createRelative("aaa/bbb").getURI().toString(); - Assert.assertEquals("gs://test-spring/aaa/bbb", relative); - Assert.assertEquals( - relative, this.bucketResource.createRelative("/aaa/bbb").getURI().toString()); + assertEquals("gs://test-spring/aaa/bbb", relative); + assertEquals(relative, this.bucketResource.createRelative("/aaa/bbb").getURI().toString()); - Assert.assertNull(((GoogleStorageResource) this.bucketResource).getBlobName()); - Assert.assertTrue(((GoogleStorageResource) this.bucketResource).isBucket()); + Assertions.assertNull(((GoogleStorageResource) this.bucketResource).getBlobName()); + assertTrue(((GoogleStorageResource) this.bucketResource).isBucket()); - Assert.assertTrue(this.bucketResource.exists()); - Assert.assertTrue(((GoogleStorageResource) this.bucketResource).bucketExists()); + assertTrue(this.bucketResource.exists()); + assertTrue(((GoogleStorageResource) this.bucketResource).bucketExists()); } @Test void testBucketNotEndingInSlash() { - Assert.assertTrue(new GoogleStorageResource(this.mockStorage, "gs://test-spring").isBucket()); + assertTrue(new GoogleStorageResource(this.mockStorage, "gs://test-spring").isBucket()); } @Test @@ -137,10 +140,10 @@ void testSpecifyBucketCorrect() { GoogleStorageResource googleStorageResource = new GoogleStorageResource(this.mockStorage, location, false); - Assert.assertTrue(googleStorageResource.isBucket()); - Assert.assertEquals("test-spring", googleStorageResource.getBucketName()); - Assert.assertEquals("test-spring", googleStorageResource.getBucket().getName()); - Assert.assertTrue(googleStorageResource.exists()); + assertTrue(googleStorageResource.isBucket()); + assertEquals("test-spring", googleStorageResource.getBucketName()); + assertEquals("test-spring", googleStorageResource.getBucket().getName()); + assertTrue(googleStorageResource.exists()); } @Test @@ -152,11 +155,11 @@ void testSpecifyPathCorrect() { GoogleStorageResource googleStorageResource = new GoogleStorageResource(this.mockStorage, "gs://test-spring/images/spring.png", false); - Assert.assertTrue(googleStorageResource.exists()); + assertTrue(googleStorageResource.exists()); } @Test - void testBucketOutputStream() throws IOException { + void testBucketOutputStream() { assertThatThrownBy(() -> ((WritableResource) this.bucketResource).getOutputStream()) .isInstanceOf(IllegalStateException.class) @@ -164,7 +167,7 @@ void testBucketOutputStream() throws IOException { } @Test - void testBucketNoBlobInputStream() throws IOException { + void testBucketNoBlobInputStream() { assertThatThrownBy(() -> this.bucketResource.getInputStream()) .isInstanceOf(IllegalStateException.class) @@ -172,7 +175,7 @@ void testBucketNoBlobInputStream() throws IOException { } @Test - void testBucketNoBlobContentLength() throws IOException { + void testBucketNoBlobContentLength() { assertThatThrownBy(() -> this.bucketResource.contentLength()) .isInstanceOf(IllegalStateException.class) @@ -180,7 +183,7 @@ void testBucketNoBlobContentLength() throws IOException { } @Test - void testBucketNoBlobFile() throws IOException { + void testBucketNoBlobFile() { assertThatThrownBy(() -> this.bucketResource.getFile()) .isInstanceOf(UnsupportedOperationException.class) @@ -188,7 +191,7 @@ void testBucketNoBlobFile() throws IOException { } @Test - void testBucketNoBlobLastModified() throws IOException { + void testBucketNoBlobLastModified() { assertThatThrownBy(() -> this.bucketResource.lastModified()) .isInstanceOf(IllegalStateException.class) @@ -196,11 +199,11 @@ void testBucketNoBlobLastModified() throws IOException { } @Test - void testBucketNoBlobResourceStatuses() throws IOException { - Assert.assertFalse(this.bucketResource.isOpen()); - Assert.assertFalse(this.bucketResource.isReadable()); - Assert.assertFalse(((WritableResource) this.bucketResource).isWritable()); - Assert.assertTrue(this.bucketResource.exists()); + void testBucketNoBlobResourceStatuses() { + assertFalse(this.bucketResource.isOpen()); + assertFalse(this.bucketResource.isReadable()); + assertFalse(((WritableResource) this.bucketResource).isWritable()); + assertTrue(this.bucketResource.exists()); } @Test @@ -208,9 +211,9 @@ void testWritable() throws Exception { WriteChannel writeChannel = mock(WriteChannel.class); when(this.mockStorage.writer(any(BlobInfo.class))).thenReturn(writeChannel); - Assert.assertTrue(this.remoteResource instanceof WritableResource); + assertTrue(this.remoteResource instanceof WritableResource); WritableResource writableResource = (WritableResource) this.remoteResource; - Assert.assertTrue(writableResource.isWritable()); + assertTrue(writableResource.isWritable()); writableResource.getOutputStream(); } @@ -225,18 +228,18 @@ void testWritableOutputStream() throws Exception { GoogleStorageResource resource = new GoogleStorageResource(this.mockStorage, location); OutputStream os = resource.getOutputStream(); - Assert.assertNotNull(os); + assertNotNull(os); } @Test - void testWritableOutputStreamNoAutoCreateOnNullBlob() throws Exception { + void testWritableOutputStreamNoAutoCreateOnNullBlob() { String location = "gs://test-spring/test"; when(this.mockStorage.get(BlobId.of("test-spring", "test"))).thenReturn(null); GoogleStorageResource resource = new GoogleStorageResource(this.mockStorage, location, false); - assertThatThrownBy(() -> resource.getOutputStream()) + assertThatThrownBy(resource::getOutputStream) .isInstanceOf(FileNotFoundException.class) .hasMessage("The blob was not found: gs://test-spring/test"); } @@ -255,7 +258,7 @@ void testWritableOutputStreamWithAutoCreateOnNullBlob() throws Exception { GoogleStorageResource resource = new GoogleStorageResource(this.mockStorage, location); GoogleStorageResource spyResource = spy(resource); OutputStream os = spyResource.getOutputStream(); - Assert.assertNotNull(os); + assertNotNull(os); } @Test @@ -274,7 +277,7 @@ void testWritableOutputStreamWithAutoCreateOnNonExistantBlob() throws Exception GoogleStorageResource resource = new GoogleStorageResource(this.mockStorage, location); GoogleStorageResource spyResource = spy(resource); OutputStream os = spyResource.getOutputStream(); - Assert.assertNotNull(os); + assertNotNull(os); } @Test @@ -291,27 +294,27 @@ void testCreateBlobWithContents() { } @Test - void testGetInputStreamOnNullBlob() throws Exception { + void testGetInputStreamOnNullBlob() { String location = "gs://test-spring/test"; Storage storage = mock(Storage.class); when(storage.get(BlobId.of("test-spring", "test"))).thenReturn(null); GoogleStorageResource resource = new GoogleStorageResource(storage, location, false); - assertThatThrownBy(() -> resource.getInputStream()) + assertThatThrownBy(resource::getInputStream) .isInstanceOf(FileNotFoundException.class) .hasMessage("The blob was not found: gs://test-spring/test"); } @Test - void testGetFilenameOnNonExistingBlob() throws Exception { + void testGetFilenameOnNonExistingBlob() { String location = "gs://test-spring/test"; Storage storage = mock(Storage.class); when(storage.get(BlobId.of("test-spring", "test"))).thenReturn(null); GoogleStorageResource resource = new GoogleStorageResource(storage, location, false); - Assert.assertEquals("test", resource.getFilename()); + assertEquals("test", resource.getFilename()); } @Test @@ -319,40 +322,38 @@ void testisAutoCreateFilesGetterSetter() { String location = "gs://test-spring/test"; Storage storage = mock(Storage.class); GoogleStorageResource resource = new GoogleStorageResource(storage, location); - Assert.assertTrue(resource.isAutoCreateFiles()); + assertTrue(resource.isAutoCreateFiles()); } @Test - void testCreateRelative() throws IOException { + void testCreateRelative() { String location = "gs://test-spring/test.png"; Storage storage = mock(Storage.class); GoogleStorageResource resource = new GoogleStorageResource(storage, location); - GoogleStorageResource relative = - (GoogleStorageResource) resource.createRelative("relative.png"); - Assert.assertEquals("gs://test-spring/relative.png", relative.getURI().toString()); + GoogleStorageResource relative = resource.createRelative("relative.png"); + assertEquals("gs://test-spring/relative.png", relative.getURI().toString()); } @Test - void testCreateRelativeSubdirs() throws IOException { + void testCreateRelativeSubdirs() { String location = "gs://test-spring/t1/test.png"; Storage storage = mock(Storage.class); GoogleStorageResource resource = new GoogleStorageResource(storage, location); - GoogleStorageResource relative = - (GoogleStorageResource) resource.createRelative("r1/relative.png"); - Assert.assertEquals("gs://test-spring/t1/r1/relative.png", relative.getURI().toString()); + GoogleStorageResource relative = resource.createRelative("r1/relative.png"); + assertEquals("gs://test-spring/t1/r1/relative.png", relative.getURI().toString()); } @Test - void nullSignedUrlForNullBlob() throws IOException { + void nullSignedUrlForNullBlob() { String location = "gs://test-spring/t1/test.png"; Storage storage = mock(Storage.class); GoogleStorageResource resource = new GoogleStorageResource(storage, location, false); when(storage.get(any(BlobId.class))).thenReturn(null); - Assert.assertNull(resource.createSignedUrl(TimeUnit.DAYS, 1)); + Assertions.assertNull(resource.createSignedUrl(TimeUnit.DAYS, 1)); } @Test - void signedUrlFunctionCalled() throws IOException { + void signedUrlFunctionCalled() { String location = "gs://test-spring/t1/test.png"; Storage storage = mock(Storage.class); Blob blob = mock(Blob.class); @@ -374,10 +375,10 @@ void testBucketDoesNotExist() { GoogleStorageResource bucket = new GoogleStorageResource(this.mockStorage, "gs://non-existing/"); - Assert.assertFalse(bucket.bucketExists()); - Assert.assertFalse(bucket.exists()); + assertFalse(bucket.bucketExists()); + assertFalse(bucket.exists()); - Assert.assertNotNull(bucket.createBucket()); + assertNotNull(bucket.createBucket()); } @Test @@ -389,8 +390,8 @@ void testBucketExistsButResourceDoesNot() { when(this.mockStorage.get("test-spring")).thenReturn(mockedBucket); when(mockedBucket.exists()).thenReturn(true); - Assert.assertTrue(resource.bucketExists()); - Assert.assertFalse(resource.exists()); + assertTrue(resource.bucketExists()); + assertFalse(resource.exists()); } /** Configuration for the tests. */ @@ -399,7 +400,7 @@ void testBucketExistsButResourceDoesNot() { static class StorageApplication { @Bean - public static Storage mockStorage() throws Exception { + public static Storage mockStorage() { return mock(Storage.class); } From 5861565cfe916e59421f2a89bcffcffb073c3175 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Wed, 30 Nov 2022 13:56:08 -0500 Subject: [PATCH 113/179] improve test coverage --- .../storage/integration/GcsFileInfoTests.java | 96 ++++++++++++++++++- 1 file changed, 95 insertions(+), 1 deletion(-) diff --git a/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/GcsFileInfoTests.java b/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/GcsFileInfoTests.java index a4e378df8e..524a1d9734 100644 --- a/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/GcsFileInfoTests.java +++ b/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/integration/GcsFileInfoTests.java @@ -1,2 +1,96 @@ -package com.google.cloud.spring.storage.integration;public class GcsFileInfoTests { +package com.google.cloud.spring.storage.integration; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import com.google.cloud.storage.BlobInfo; +import java.time.OffsetDateTime; +import java.util.Date; +import java.util.Random; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.api.TestInstance.Lifecycle; + +@TestInstance(Lifecycle.PER_CLASS) +class GcsFileInfoTests { + + private final BlobInfo gcsFile = mock(BlobInfo.class); + + private final GcsFileInfo gcsFileInfo = new GcsFileInfo(gcsFile); + + private final OffsetDateTime now = OffsetDateTime.now(); + + private final Random random = new Random(); + + private boolean randomBoolean; + + private long randomSize; + + @BeforeAll + void init() { + randomBoolean = random.nextBoolean(); + randomSize = random.nextLong(); + when(gcsFile.isDirectory()).thenReturn(randomBoolean); + when(gcsFile.getSize()).thenReturn(randomSize); + when(gcsFile.getUpdateTimeOffsetDateTime()).thenReturn(now); + when(gcsFile.getName()).thenReturn("fake-name"); + } + + @Test + void isDirectoryTest() { + assertThat(gcsFileInfo.isDirectory()).isEqualTo(randomBoolean); + } + + @Test + void isLinkTest() { + assertThat(gcsFileInfo.isLink()).isFalse(); + } + + @Test + void getSizeTest() { + assertThat(gcsFileInfo.getSize()).isEqualTo(randomSize); + } + + @Test + void getModifiedTest() { + assertThat(gcsFileInfo.getModified()).isEqualTo(now.toInstant().toEpochMilli()); + } + + @Test + void getFileNameTest() { + assertThat(gcsFileInfo.getFilename()).isEqualTo("fake-name"); + } + + @Test + void getPermissionsTest() { + assertThatThrownBy(gcsFileInfo::getPermissions) + .isInstanceOf(UnsupportedOperationException.class); + } + + @Test + void getFileInfoTest() { + assertThat(gcsFileInfo.getFileInfo()).isEqualTo(gcsFile); + } + + @Test + void toStringTest() { + assertThat(gcsFileInfo).hasToString( + "FileInfo [isDirectory=" + + randomBoolean + + ", isLink=" + + false + + ", Size=" + + randomSize + + ", ModifiedTime=" + + new Date(now.toInstant().toEpochMilli()) + + ", Filename=" + + "fake-name" + + ", RemoteDirectory=" + + null + + "]" + ); + } } From 2d3f05eadce4f965829953e40487de52c2c68d78 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Fri, 2 Dec 2022 17:21:32 -0500 Subject: [PATCH 114/179] delete the mysql r2dbc sample from samples module --- spring-cloud-gcp-samples/pom.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/spring-cloud-gcp-samples/pom.xml b/spring-cloud-gcp-samples/pom.xml index 021350a115..db0bb7352e 100644 --- a/spring-cloud-gcp-samples/pom.xml +++ b/spring-cloud-gcp-samples/pom.xml @@ -66,13 +66,10 @@ spring-cloud-gcp-pubsub-bus-config-sample spring-cloud-gcp-pubsub-stream-dead-letter-sample spring-cloud-gcp-pubsub-stream-functional-sample - - spring-cloud-gcp-pubsub-reactive-sample spring-cloud-gcp-integration-pubsub-json-sample spring-cloud-gcp-security-iap-sample spring-cloud-gcp-sql-postgres-sample - spring-cloud-gcp-sql-mysql-r2dbc-sample spring-cloud-gcp-sql-postgres-r2dbc-sample spring-cloud-gcp-vision-ocr-demo spring-cloud-gcp-firestore-sample From e47a96d2745dd88cfce46be9317c62a172b58d33 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Fri, 2 Dec 2022 17:56:01 -0500 Subject: [PATCH 115/179] remove mysql r2dbc support --- spring-cloud-gcp-autoconfigure/pom.xml | 15 +--- ...R2dbcCloudSqlEnvironmentPostProcessor.java | 16 ++-- ...CloudSqlEnvironmentPostProcessorTests.java | 75 ++----------------- spring-cloud-gcp-dependencies/pom.xml | 16 ---- spring-cloud-gcp-starters/pom.xml | 1 - 5 files changed, 14 insertions(+), 109 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/pom.xml b/spring-cloud-gcp-autoconfigure/pom.xml index ceba37d6b8..432418bc23 100644 --- a/spring-cloud-gcp-autoconfigure/pom.xml +++ b/spring-cloud-gcp-autoconfigure/pom.xml @@ -117,20 +117,7 @@ test - - - com.google.cloud.sql - cloud-sql-connector-r2dbc-mysql - true - - - dev.miku - r2dbc-mysql - true - - - - + com.google.cloud.sql cloud-sql-connector-r2dbc-postgres diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/sql/R2dbcCloudSqlEnvironmentPostProcessor.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/sql/R2dbcCloudSqlEnvironmentPostProcessor.java index 4028e39ddf..45a293416b 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/sql/R2dbcCloudSqlEnvironmentPostProcessor.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/sql/R2dbcCloudSqlEnvironmentPostProcessor.java @@ -84,10 +84,10 @@ String createUrl(DatabaseType databaseType, GcpCloudSqlProperties sqlProperties) } /** - * Returns {@link DatabaseType} constant based on whether mySQL or postgreSQL R2DBC driver and + * Returns {@link DatabaseType} constant based on whether postgresSQL R2DBC driver and * connector dependencies are present on the classpath. Returns null if Cloud SQL is not enabled * in Spring Cloud GCP, CredentialFactory is not present or ConnectionFactory (which is used to - * enable Spring R2DBC auto-configuration) is not present. + * enable Spring R2DBC autoconfiguration) is not present. * * @param environment environment to post-process * @return database type @@ -95,14 +95,10 @@ String createUrl(DatabaseType databaseType, GcpCloudSqlProperties sqlProperties) DatabaseType getEnabledDatabaseType(ConfigurableEnvironment environment) { if (isR2dbcEnabled(environment) && isOnClasspath("com.google.cloud.sql.CredentialFactory") - && isOnClasspath("io.r2dbc.spi.ConnectionFactory")) { - if (isOnClasspath("com.google.cloud.sql.core.GcpConnectionFactoryProviderMysql") - && isOnClasspath("dev.miku.r2dbc.mysql.MySqlConnectionFactoryProvider")) { - return DatabaseType.MYSQL; - } else if (isOnClasspath("com.google.cloud.sql.core.GcpConnectionFactoryProviderPostgres") - && isOnClasspath("io.r2dbc.postgresql.PostgresqlConnectionFactoryProvider")) { - return DatabaseType.POSTGRESQL; - } + && isOnClasspath("io.r2dbc.spi.ConnectionFactory") + && isOnClasspath("com.google.cloud.sql.core.GcpConnectionFactoryProviderPostgres") + && isOnClasspath("io.r2dbc.postgresql.PostgresqlConnectionFactoryProvider")) { + return DatabaseType.POSTGRESQL; } return null; } diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/sql/R2dbcCloudSqlEnvironmentPostProcessorTests.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/sql/R2dbcCloudSqlEnvironmentPostProcessorTests.java index 44a34dbd76..ea6046e79b 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/sql/R2dbcCloudSqlEnvironmentPostProcessorTests.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/sql/R2dbcCloudSqlEnvironmentPostProcessorTests.java @@ -20,6 +20,7 @@ import java.util.Arrays; import java.util.HashSet; +import java.util.List; import java.util.Set; import org.junit.jupiter.api.Test; import org.springframework.boot.SpringApplication; @@ -29,7 +30,7 @@ /** Tests for {@link R2dbcCloudSqlEnvironmentPostProcessor}. */ class R2dbcCloudSqlEnvironmentPostProcessorTests { - private R2dbcCloudSqlEnvironmentPostProcessor r2dbcPostProcessor = + private final R2dbcCloudSqlEnvironmentPostProcessor r2dbcPostProcessor = new R2dbcCloudSqlEnvironmentPostProcessor(); ApplicationContextRunner contextRunner = @@ -39,15 +40,6 @@ class R2dbcCloudSqlEnvironmentPostProcessorTests { r2dbcPostProcessor.postProcessEnvironment( configurableApplicationContext.getEnvironment(), new SpringApplication())); - @Test - void testCreateUrl_mySql() { - GcpCloudSqlProperties properties = new GcpCloudSqlProperties(); - properties.setDatabaseName("my-database"); - properties.setInstanceConnectionName("my-instance-connection-name"); - String r2dbcUrl = r2dbcPostProcessor.createUrl(DatabaseType.MYSQL, properties); - assertThat(r2dbcUrl).isEqualTo("r2dbc:gcp:mysql://my-instance-connection-name/my-database"); - } - @Test void testCreateUrl_postgres() { GcpCloudSqlProperties properties = new GcpCloudSqlProperties(); @@ -57,51 +49,6 @@ void testCreateUrl_postgres() { assertThat(r2dbcUrl).isEqualTo("r2dbc:gcp:postgres://my-instance-connection-name/my-database"); } - @Test - void testSetR2dbcProperty_mySql_defaultUsername() { - this.contextRunner - .withPropertyValues( - "spring.cloud.gcp.sql.databaseName=my-database", - "spring.cloud.gcp.sql.instanceConnectionName=my-project:region:my-instance") - .run( - context -> { - assertThat(context.getEnvironment().getProperty("spring.r2dbc.url")) - .isEqualTo("r2dbc:gcp:mysql://my-project:region:my-instance/my-database"); - assertThat(context.getEnvironment().getProperty("spring.r2dbc.username")) - .isEqualTo("root"); - }); - } - - @Test - void testSetR2dbcProperty_mySql_usernameProvided() { - this.contextRunner - .withPropertyValues( - "spring.cloud.gcp.sql.databaseName=my-database", - "spring.cloud.gcp.sql.instanceConnectionName=my-project:region:my-instance", - "spring.r2dbc.username=my-username") - .run( - context -> { - assertThat(context.getEnvironment().getProperty("spring.r2dbc.url")) - .isEqualTo("r2dbc:gcp:mysql://my-project:region:my-instance/my-database"); - assertThat(context.getEnvironment().getProperty("spring.r2dbc.username")) - .isEqualTo("my-username"); - }); - } - - @Test - void testSetR2dbcProperty_mySql_urlProvidedByUserIgnored() { - this.contextRunner - .withPropertyValues( - "spring.cloud.gcp.sql.databaseName=my-database", - "spring.cloud.gcp.sql.instanceConnectionName=my-project:region:my-instance", - "spring.r2dbc.url=ignored") - .run( - context -> { - assertThat(context.getEnvironment().getProperty("spring.r2dbc.url")) - .isEqualTo("r2dbc:gcp:mysql://my-project:region:my-instance/my-database"); - }); - } - @Test void testSetR2dbcProperty_postgres() { verifyThatCorrectUrlAndUsernameSet(new String[] {"io.r2dbc.postgresql"}, @@ -109,13 +56,6 @@ void testSetR2dbcProperty_postgres() { "r2dbc:gcp:postgres://my-project:region:my-instance/my-database"); } - @Test - void testSetR2dbcProperty_mysql() { - verifyThatCorrectUrlAndUsernameSet(new String[] {"dev.miku.r2dbc.mysql"}, - "root", - "r2dbc:gcp:mysql://my-project:region:my-instance/my-database"); - } - /** * Verifies that correct database properties got injected into context, given a passed-in list of * packages to retain on the classpath. @@ -125,14 +65,13 @@ void testSetR2dbcProperty_mysql() { * @param url expected {@code spring.r2dbc.username} value to verify */ private void verifyThatCorrectUrlAndUsernameSet( - String[] driverPackagesToInclude, String username, String url) { + String[] driverPackagesToInclude, + String username, + String url) { // Because `FilteredClassLoader` accepts a list of packages to remove from classpath, // `driverPackagesToInclude` is used to calculate the inverse list of packages to _exclude_. - Set driverPackagesToExclude = new HashSet<>(Arrays.asList( - "dev.miku.r2dbc.mysql", - "io.r2dbc.postgresql" - )); - driverPackagesToExclude.removeAll(Arrays.asList(driverPackagesToInclude)); + Set driverPackagesToExclude = new HashSet<>(List.of("io.r2dbc.postgresql")); + Arrays.asList(driverPackagesToInclude).forEach(driverPackagesToExclude::remove); this.contextRunner .withPropertyValues( diff --git a/spring-cloud-gcp-dependencies/pom.xml b/spring-cloud-gcp-dependencies/pom.xml index e3cf955339..aac6f0e9b6 100644 --- a/spring-cloud-gcp-dependencies/pom.xml +++ b/spring-cloud-gcp-dependencies/pom.xml @@ -271,22 +271,6 @@ 0.8.12.RELEASE - - - com.google.cloud.sql - cloud-sql-connector-r2dbc-mysql - ${cloud-sql-socket-factory.version} - - - - dev.miku - r2dbc-mysql - ${r2dbc-mysql.version} - - com.google.cloud.sql diff --git a/spring-cloud-gcp-starters/pom.xml b/spring-cloud-gcp-starters/pom.xml index 48a42bcb06..9dec63b001 100644 --- a/spring-cloud-gcp-starters/pom.xml +++ b/spring-cloud-gcp-starters/pom.xml @@ -34,7 +34,6 @@ spring-cloud-gcp-starter-metrics spring-cloud-gcp-starter-sql-mysql spring-cloud-gcp-starter-sql-postgresql - spring-cloud-gcp-starter-sql-mysql-r2dbc spring-cloud-gcp-starter-sql-postgres-r2dbc spring-cloud-gcp-starter-security-iap spring-cloud-gcp-starter-vision From aeca912c498fcca376856790bb6220614611f5c4 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Fri, 2 Dec 2022 21:58:06 -0500 Subject: [PATCH 116/179] upgrade r2dbc-postgresql to 1.0.0 --- spring-cloud-gcp-dependencies/pom.xml | 16 ++-------------- .../pom.xml | 4 ++-- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/spring-cloud-gcp-dependencies/pom.xml b/spring-cloud-gcp-dependencies/pom.xml index aac6f0e9b6..c9dbb44f2d 100644 --- a/spring-cloud-gcp-dependencies/pom.xml +++ b/spring-cloud-gcp-dependencies/pom.xml @@ -33,7 +33,7 @@ 1.7.2 31.1-jre 0.8.2.RELEASE - 0.8.13.RELEASE + 1.0.0.RELEASE @@ -259,18 +259,6 @@ ${cloud-sql-socket-factory.version} - - dev.miku - r2dbc-mysql - 0.8.2.RELEASE - - - - io.r2dbc - r2dbc-postgresql - 0.8.12.RELEASE - - com.google.cloud.sql @@ -278,7 +266,7 @@ ${cloud-sql-socket-factory.version} - org.postgres + org.postgresql r2dbc-postgresql ${r2dbc-postgres-driver.version} diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-postgres-r2dbc/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-postgres-r2dbc/pom.xml index 2fb2e9398b..cbfc128167 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-postgres-r2dbc/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-postgres-r2dbc/pom.xml @@ -23,13 +23,13 @@ spring-boot-starter-data-r2dbc - + com.google.cloud.sql cloud-sql-connector-r2dbc-postgres - io.r2dbc + org.postgresql r2dbc-postgresql From 1071518d8e3b13b8221255a0fade50a10195c982 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Fri, 2 Dec 2022 21:58:40 -0500 Subject: [PATCH 117/179] polish --- .../src/main/java/com/example/User.java | 6 +++--- .../src/main/java/com/example/WebController.java | 2 +- .../SqlR2dbcPostgresSampleApplicationIntegrationTests.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-r2dbc-sample/src/main/java/com/example/User.java b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-r2dbc-sample/src/main/java/com/example/User.java index a6c1e69c94..9be9f018ad 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-r2dbc-sample/src/main/java/com/example/User.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-r2dbc-sample/src/main/java/com/example/User.java @@ -21,9 +21,9 @@ @Table("users") public class User { - private String email; - private String firstName; - private String lastName; + private final String email; + private final String firstName; + private final String lastName; public User(String email, String firstName, String lastName) { this.email = email; diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-r2dbc-sample/src/main/java/com/example/WebController.java b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-r2dbc-sample/src/main/java/com/example/WebController.java index bc591cb1e1..bf74832852 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-r2dbc-sample/src/main/java/com/example/WebController.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-r2dbc-sample/src/main/java/com/example/WebController.java @@ -36,6 +36,6 @@ public WebController(R2dbcEntityTemplate template) { @GetMapping("/getTuples") public Flux getTuples() { - return template.select(User.class).all().map(user -> user.toString()); + return template.select(User.class).all().map(User::toString); } } diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-r2dbc-sample/src/test/java/com/example/SqlR2dbcPostgresSampleApplicationIntegrationTests.java b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-r2dbc-sample/src/test/java/com/example/SqlR2dbcPostgresSampleApplicationIntegrationTests.java index c2ef177ae1..f66527ec49 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-r2dbc-sample/src/test/java/com/example/SqlR2dbcPostgresSampleApplicationIntegrationTests.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-r2dbc-sample/src/test/java/com/example/SqlR2dbcPostgresSampleApplicationIntegrationTests.java @@ -38,7 +38,7 @@ "spring.r2dbc.password=test" }) @EnabledIfSystemProperty(named = "it.cloudsql", matches = "true") -public class SqlR2dbcPostgresSampleApplicationIntegrationTests { +class SqlR2dbcPostgresSampleApplicationIntegrationTests { @Autowired private TestRestTemplate testRestTemplate; @@ -46,7 +46,7 @@ public class SqlR2dbcPostgresSampleApplicationIntegrationTests { void testSqlRowsAccess() { ResponseEntity result = this.testRestTemplate.exchange( - "/getTuples", HttpMethod.GET, null, new ParameterizedTypeReference() {}); + "/getTuples", HttpMethod.GET, null, new ParameterizedTypeReference<>() {}); assertThat(result.getBody()) .isEqualTo( From 280fbbcdda495c04d82afef4c347a50c77bb400c Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Fri, 2 Dec 2022 23:01:37 -0500 Subject: [PATCH 118/179] fix broken unit test --- spring-cloud-gcp-autoconfigure/pom.xml | 5 +++-- .../sql/R2dbcCloudSqlEnvironmentPostProcessorTests.java | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/pom.xml b/spring-cloud-gcp-autoconfigure/pom.xml index 432418bc23..6d217e1505 100644 --- a/spring-cloud-gcp-autoconfigure/pom.xml +++ b/spring-cloud-gcp-autoconfigure/pom.xml @@ -117,14 +117,15 @@ test - + com.google.cloud.sql cloud-sql-connector-r2dbc-postgres true + - io.r2dbc + org.postgresql r2dbc-postgresql true diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/sql/R2dbcCloudSqlEnvironmentPostProcessorTests.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/sql/R2dbcCloudSqlEnvironmentPostProcessorTests.java index ea6046e79b..288496f5d7 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/sql/R2dbcCloudSqlEnvironmentPostProcessorTests.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/sql/R2dbcCloudSqlEnvironmentPostProcessorTests.java @@ -51,7 +51,8 @@ void testCreateUrl_postgres() { @Test void testSetR2dbcProperty_postgres() { - verifyThatCorrectUrlAndUsernameSet(new String[] {"io.r2dbc.postgresql"}, + verifyThatCorrectUrlAndUsernameSet( + new String[] {"io.r2dbc.postgresql"}, "postgres", "r2dbc:gcp:postgres://my-project:region:my-instance/my-database"); } From cff3fa46be5c129f5cbb4c7398378172eb7bbbc7 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sat, 3 Dec 2022 09:52:24 -0500 Subject: [PATCH 119/179] improve line coverage --- .../trace/pubsub/TracePubSubAutoConfigurationTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java index 779783489f..f561a9e522 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java @@ -35,6 +35,7 @@ import com.google.cloud.spring.autoconfigure.trace.StackdriverTraceAutoConfiguration; import com.google.cloud.spring.pubsub.core.publisher.PublisherCustomizer; import io.grpc.ManagedChannel; +import io.micrometer.observation.aop.ObservedAspect; import java.util.List; import java.util.stream.Collectors; import org.junit.jupiter.api.BeforeEach; @@ -93,6 +94,8 @@ void testPubSubTracingDisabledByDefault() { context -> { assertThat(context.getBeansOfType(TracePubSubBeanPostProcessor.class)).isEmpty(); assertThat(context.getBeansOfType(PubSubTracing.class)).isEmpty(); + assertThat(context.getBeansOfType(MessagingTracing.class)).isEmpty(); + assertThat(context.getBeansOfType(ObservedAspect.class)).isEmpty(); }); } @@ -102,11 +105,12 @@ void testPubSubTracingEnabled() { this.contextRunner .withPropertyValues("spring.cloud.gcp.trace.pubsub.enabled=true") .withBean(Tracing.class, () -> tracing) - .withBean(MessagingTracing.class, () -> MessagingTracing.newBuilder(tracing).build()) .run( context -> { assertThat(context.getBean(TracePubSubBeanPostProcessor.class)).isNotNull(); assertThat(context.getBean(PubSubTracing.class)).isNotNull(); + assertThat(context.getBean(MessagingTracing.class)).isNotNull(); + assertThat(context.getBean(ObservedAspect.class)).isNotNull(); }); } @@ -126,7 +130,7 @@ void tracePubSubCustomizerAppliedLast() { customizersProvider.orderedStream().collect(Collectors.toList()); assertThat(customizers).hasSize(2); - // Object provider lists highest priority first, so default priority `noopCustomizer` + // Object provider lists the highest priority first, so default priority `noopCustomizer` // will be second assertThat(customizers.get(1)).isSameAs(noopCustomizer); From dc22210f5789965ac53ec7db89102ab494debfb2 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sat, 3 Dec 2022 16:58:47 -0500 Subject: [PATCH 120/179] change lastModifed to return milliseconds --- .../google/cloud/spring/storage/GoogleStorageResource.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/GoogleStorageResource.java b/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/GoogleStorageResource.java index d917a3ee0e..57d8cc4336 100644 --- a/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/GoogleStorageResource.java +++ b/spring-cloud-gcp-storage/src/main/java/com/google/cloud/spring/storage/GoogleStorageResource.java @@ -255,7 +255,10 @@ public long contentLength() throws IOException { @Override public long lastModified() throws IOException { - return throwExceptionForNullBlob(getBlob()).getUpdateTimeOffsetDateTime().toEpochSecond(); + return throwExceptionForNullBlob(getBlob()) + .getUpdateTimeOffsetDateTime() + .toInstant() + .toEpochMilli(); } /** From 4370cc71249f7e33b972484406f89f3aacd0f5fe Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sat, 3 Dec 2022 16:59:02 -0500 Subject: [PATCH 121/179] improve test coverage --- .../storage/GoogleStorageResourceTest.java | 48 ++++++++++++++++--- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/GoogleStorageResourceTest.java b/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/GoogleStorageResourceTest.java index 610d07ddb8..7bb873f4fc 100644 --- a/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/GoogleStorageResourceTest.java +++ b/spring-cloud-gcp-storage/src/test/java/com/google/cloud/spring/storage/GoogleStorageResourceTest.java @@ -18,25 +18,32 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import com.google.cloud.storage.Blob; import com.google.cloud.storage.BlobId; +import com.google.cloud.storage.BlobInfo; import com.google.cloud.storage.Bucket; import com.google.cloud.storage.Storage; import java.io.IOException; +import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; class GoogleStorageResourceTest { + private final Storage mockStorage = mock(Storage.class); + private final Bucket mockBucket = mock(Bucket.class); + private final Blob mockBlob = mock(Blob.class); + @Test void testConstructorValidation() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> new GoogleStorageResource(null, "gs://foo", false)) .withMessageContaining("Storage object can not be null"); - Storage mockStorage = mock(Storage.class); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> new GoogleStorageResource(mockStorage, (String) null, false)); assertThatExceptionOfType(IllegalArgumentException.class) @@ -50,9 +57,6 @@ void testConstructorValidation() { @Test void getUrlBucket() throws IOException { - Storage mockStorage = mock(Storage.class); - Bucket mockBucket = mock(Bucket.class); - when(mockStorage.get("my-bucket")).thenReturn(mockBucket); when(mockBucket.getSelfLink()).thenReturn("https://www.googleapis.com/storage/v1/b/my-bucket"); @@ -62,9 +66,6 @@ void getUrlBucket() throws IOException { @Test void getUrlObject() throws IOException { - Storage mockStorage = mock(Storage.class); - Blob mockBlob = mock(Blob.class); - when(mockStorage.get(BlobId.of("my-bucket", "my-object"))).thenReturn(mockBlob); when(mockBlob.getSelfLink()) .thenReturn("https://www.googleapis.com/storage/v1/b/my-bucket/o/my-object"); @@ -72,4 +73,37 @@ void getUrlObject() throws IOException { GoogleStorageResource gsr = new GoogleStorageResource(mockStorage, "gs://my-bucket/my-object"); assertThat(gsr.getURL()).isNotNull(); } + + @Test + void getLastModifiedTest() throws IOException { + OffsetDateTime now = OffsetDateTime.now(); + when(mockStorage.get(any(BlobId.class))).thenReturn(mockBlob); + when(mockBlob.getUpdateTimeOffsetDateTime()).thenReturn(now); + GoogleStorageResource gsr = new GoogleStorageResource(mockStorage, "gs://my-bucket/my-object"); + assertThat(gsr.lastModified()).isEqualTo(now.toInstant().toEpochMilli()); + } + + @Test + void isReadableTest() { + GoogleStorageLocation location = mock(GoogleStorageLocation.class); + GoogleStorageResource gsr = new GoogleStorageResource(mockStorage, location, false); + when(location.isBucket()).thenReturn(true); + assertThat(gsr.isReadable()).isFalse(); + when(location.isBucket()).thenReturn(false); + assertThat(gsr.isReadable()).isTrue(); + } + + @Test + void createBlobTest() { + GoogleStorageResource gsr = new GoogleStorageResource(mockStorage, "gs://my-bucket/my-object"); + gsr.createBlob(); + verify(mockStorage) + .create(BlobInfo.newBuilder("my-bucket", "my-object").build()); + } + + @Test + void getGoogleStorageLocationTest() { + GoogleStorageResource gsr = new GoogleStorageResource(mockStorage, "gs://my-bucket/my-object"); + assertThat(gsr.getGoogleStorageLocation().uriString()).isEqualTo("gs://my-bucket/my-object"); + } } From 2827c4d341bbf2d3b9156d04b965872e82b50dc2 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sat, 3 Dec 2022 21:45:58 -0500 Subject: [PATCH 122/179] improve test coverage --- .../BigQueryFileMessageHandlerTests.java | 150 ++++++++++++++++-- 1 file changed, 140 insertions(+), 10 deletions(-) diff --git a/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/integration/outbound/BigQueryFileMessageHandlerTests.java b/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/integration/outbound/BigQueryFileMessageHandlerTests.java index 32022c7ec8..29a2fb52f1 100644 --- a/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/integration/outbound/BigQueryFileMessageHandlerTests.java +++ b/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/integration/outbound/BigQueryFileMessageHandlerTests.java @@ -17,6 +17,7 @@ package com.google.cloud.spring.bigquery.integration.outbound; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatCode; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -26,13 +27,22 @@ import com.google.cloud.bigquery.Job; import com.google.cloud.bigquery.Schema; import com.google.cloud.spring.bigquery.core.BigQueryTemplate; +import java.io.IOException; import java.io.InputStream; +import java.math.BigInteger; +import java.time.Duration; import java.util.Collections; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.springframework.core.io.Resource; +import org.springframework.expression.Expression; import org.springframework.integration.expression.ValueExpression; import org.springframework.messaging.Message; +import org.springframework.messaging.MessageHandlingException; import org.springframework.messaging.MessageHeaders; import org.springframework.messaging.support.MessageBuilder; @@ -42,23 +52,48 @@ class BigQueryFileMessageHandlerTests { private BigQueryFileMessageHandler messageHandler; + private final CompletableFuture completableFuture = new CompletableFuture<>(); + @BeforeEach void setup() { bigQueryTemplate = mock(BigQueryTemplate.class); - CompletableFuture result = new CompletableFuture<>(); - result.complete(mock(Job.class)); - when(bigQueryTemplate.writeDataToTable(any(), any(), any(), any())).thenReturn(result); - + completableFuture.complete(mock(Job.class)); + when(bigQueryTemplate.writeDataToTable(any(), any(), any(), any())).thenReturn( + completableFuture); messageHandler = new BigQueryFileMessageHandler(bigQueryTemplate); - } - - @Test - void testHandleMessage_async() { messageHandler.setTableName("testTable"); messageHandler.setFormatOptions(FormatOptions.csv()); messageHandler.setSync(false); messageHandler.setTableSchema(Schema.of()); + } + + @Test + void testHandleResourceMessage() throws IOException { + Resource payload = mock(Resource.class); + Message message = + MessageBuilder.createMessage(payload, new MessageHeaders(Collections.emptyMap())); + + Object result = messageHandler.handleRequestMessage(message); + verify(bigQueryTemplate) + .writeDataToTable("testTable", payload.getInputStream(), FormatOptions.csv(), Schema.of()); + assertThat(result).isNotNull().isInstanceOf(CompletableFuture.class); + } + + @Test + void testHandleResourceMessageThrowsException() throws IOException { + Resource payload = mock(Resource.class); + when(payload.getInputStream()).thenThrow(IOException.class); + Message message = + MessageBuilder.createMessage(payload, new MessageHeaders(Collections.emptyMap())); + + assertThatCode(() -> messageHandler.handleRequestMessage(message)) + .isInstanceOf(MessageHandlingException.class) + .hasStackTraceContaining("Failed to write data to BigQuery tables in message handler"); + } + + @Test + void testHandleInputStreamMessage_async() { InputStream payload = mock(InputStream.class); Message message = MessageBuilder.createMessage(payload, new MessageHeaders(Collections.emptyMap())); @@ -72,8 +107,6 @@ void testHandleMessage_async() { @Test void testHandleMessage_sync() { - messageHandler.setTableName("testTable"); - messageHandler.setFormatOptions(FormatOptions.csv()); messageHandler.setSync(true); messageHandler.setTableSchemaExpression(new ValueExpression<>(Schema.of())); @@ -87,4 +120,101 @@ void testHandleMessage_sync() { .writeDataToTable("testTable", payload, FormatOptions.csv(), Schema.of()); assertThat(result).isNotNull().isInstanceOf(Job.class); } + + @Test + void testHandleMessage_ThrowsExecutionExceptionTest() + throws ExecutionException, InterruptedException, TimeoutException { + CompletableFuture mockCompletableFuture = mock(CompletableFuture.class); + when(bigQueryTemplate.writeDataToTable(any(), any(), any(), any())).thenReturn( + mockCompletableFuture); + when(mockCompletableFuture.get(1L, TimeUnit.SECONDS)) + .thenThrow(ExecutionException.class); + messageHandler.setSync(true); + messageHandler.setTableSchemaExpression(new ValueExpression<>(Schema.of())); + messageHandler.setTimeout(Duration.ofSeconds(1)); + InputStream payload = mock(InputStream.class); + Message message = + MessageBuilder.createMessage(payload, new MessageHeaders(Collections.emptyMap())); + + assertThatCode(() -> messageHandler.handleRequestMessage(message)) + .isInstanceOf(MessageHandlingException.class) + .hasStackTraceContaining("Failed to wait for BigQuery Job to complete in message handler"); + } + + @Test + void testHandleMessage_ThrowsInterruptedExceptionTest() + throws ExecutionException, InterruptedException, TimeoutException { + CompletableFuture mockCompletableFuture = mock(CompletableFuture.class); + when(bigQueryTemplate.writeDataToTable(any(), any(), any(), any())).thenReturn( + mockCompletableFuture); + when(mockCompletableFuture.get(1L, TimeUnit.SECONDS)) + .thenThrow(InterruptedException.class); + messageHandler.setSync(true); + messageHandler.setTableSchemaExpression(new ValueExpression<>(Schema.of())); + messageHandler.setTimeout(Duration.ofSeconds(1)); + InputStream payload = mock(InputStream.class); + Message message = + MessageBuilder.createMessage(payload, new MessageHeaders(Collections.emptyMap())); + + assertThatCode(() -> messageHandler.handleRequestMessage(message)) + .isInstanceOf(MessageHandlingException.class) + .hasStackTraceContaining("Failed to wait for BigQuery Job (interrupted) in message handler"); + } + + @Test + void testHandleMessageWithIllegalArgumentTest() { + messageHandler.setSync(true); + messageHandler.setTableSchemaExpression(new ValueExpression<>(Schema.of())); + + BigInteger payload = mock(BigInteger.class); + Message message = + MessageBuilder.createMessage(payload, new MessageHeaders(Collections.emptyMap())); + + assertThatCode(() -> messageHandler.handleRequestMessage(message)) + .isInstanceOf(IllegalArgumentException.class) + .hasMessage(String.format( + "Unsupported message payload type: %s. The supported payload types " + + "are: java.io.File, byte[], org.springframework.core.io.Resource, " + + "and java.io.InputStream.", + payload.getClass().getName())); + } + + @Test + void setTableNameExpressionThrowsExceptionTest() { + assertThatCode(() -> messageHandler.setTableNameExpression(null)) + .isInstanceOf(IllegalArgumentException.class) + .hasMessage("Table name expression must not be null."); + } + + @Test + void setTableNameExpressionTest() { + assertThatCode(() -> messageHandler.setTableNameExpression(mock(Expression.class))) + .doesNotThrowAnyException(); + } + + @Test + void setFormatOptionsExpressionThrowsExceptionTest() { + assertThatCode(() -> messageHandler.setFormatOptionsExpression(null)) + .isInstanceOf(IllegalArgumentException.class) + .hasMessage("Format options expression cannot be null."); + } + + @Test + void setFormatOptionsExpressionTest() { + assertThatCode(() -> messageHandler.setFormatOptionsExpression(mock(Expression.class))) + .doesNotThrowAnyException(); + } + + @Test + void setTimeOutThrowsExceptionTest() { + assertThatCode(() -> messageHandler.setTimeout(null)) + .isInstanceOf(IllegalArgumentException.class) + .hasMessage("Timeout duration must not be null."); + } + + @Test + void setTimeOutTest() { + assertThatCode(() -> messageHandler.setTimeout(Duration.ZERO)) + .doesNotThrowAnyException(); + } } From f8589835f30d8b7fb94fdc407c116ba3e6a83eb0 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sun, 4 Dec 2022 16:04:52 -0500 Subject: [PATCH 123/179] improve test coverage --- .../spring/bigquery/BigQueryTemplateTest.java | 77 ++++++++++++++++++- 1 file changed, 73 insertions(+), 4 deletions(-) diff --git a/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/BigQueryTemplateTest.java b/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/BigQueryTemplateTest.java index 324dbcab95..59ba2c4a80 100644 --- a/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/BigQueryTemplateTest.java +++ b/spring-cloud-gcp-bigquery/src/test/java/com/google/cloud/spring/bigquery/BigQueryTemplateTest.java @@ -16,7 +16,13 @@ package com.google.cloud.spring.bigquery; +import static com.google.cloud.bigquery.JobInfo.CreateDisposition.CREATE_IF_NEEDED; +import static com.google.cloud.bigquery.JobInfo.CreateDisposition.CREATE_NEVER; +import static com.google.cloud.bigquery.JobInfo.WriteDisposition.WRITE_APPEND; +import static com.google.cloud.bigquery.JobInfo.WriteDisposition.WRITE_EMPTY; +import static com.google.cloud.bigquery.JobInfo.WriteDisposition.WRITE_TRUNCATE; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatCode; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; @@ -92,7 +98,7 @@ public void setUp() { rpcFactoryMock = mock(BigQueryRpcFactory.class); bigqueryRpcMock = mock(BigQueryRpc.class); when(rpcFactoryMock.create(any(BigQueryOptions.class))).thenReturn(bigqueryRpcMock); - options = createBigQueryOptionsForProject(PROJECT, rpcFactoryMock); + options = createBigQueryOptionsForProject(rpcFactoryMock); bigQueryWriteClientMock = mock(BigQueryWriteClient.class); bigquery = options.getService(); bqInitSettings.put("DATASET_NAME", DATASET); @@ -105,14 +111,77 @@ public void setUp() { } private BigQueryOptions createBigQueryOptionsForProject( - String project, BigQueryRpcFactory rpcFactory) { + BigQueryRpcFactory rpcFactory) { return BigQueryOptions.newBuilder() - .setProjectId(project) + .setProjectId(BigQueryTemplateTest.PROJECT) .setServiceRpcFactory(rpcFactory) .setRetrySettings(ServiceOptions.getNoRetrySettings()) .build(); } + @Test + void getDatasetNameTest() { + assertThat(bqTemplateSpy.getDatasetName()).isEqualTo(DATASET); + } + + @Test + void getJsonWriterBatchSizeTest() { + assertThat(bqTemplateSpy.getJsonWriterBatchSize()).isEqualTo(JSON_WRITER_BATCH_SIZE); + } + + @Test + void setAutoDetectSchemaTest() { + assertThatCode(() -> bqTemplateSpy.setAutoDetectSchema(true)) + .doesNotThrowAnyException(); + assertThatCode(() -> bqTemplateSpy.setAutoDetectSchema(false)) + .doesNotThrowAnyException(); + } + + @Test + void setWriteDispositionTest() { + assertThatCode(() -> bqTemplateSpy.setWriteDisposition(WRITE_TRUNCATE)) + .doesNotThrowAnyException(); + assertThatCode(() -> bqTemplateSpy.setWriteDisposition(WRITE_APPEND)) + .doesNotThrowAnyException(); + assertThatCode(() -> bqTemplateSpy.setWriteDisposition(WRITE_EMPTY)) + .doesNotThrowAnyException(); + } + + @Test + void setWriteDispositionThrowsExceptionTest() { + assertThatCode(() -> bqTemplateSpy.setWriteDisposition(null)) + .isInstanceOf(IllegalArgumentException.class) + .hasStackTraceContaining("BigQuery write disposition must not be null."); + } + + @Test + void setCreateDispositionTest() { + assertThatCode(() -> bqTemplateSpy.setCreateDisposition(CREATE_IF_NEEDED)) + .doesNotThrowAnyException(); + assertThatCode(() -> bqTemplateSpy.setCreateDisposition(CREATE_NEVER)) + .doesNotThrowAnyException(); + } + + @Test + void setCreateDispositionThrowsExceptionTest() { + assertThatCode(() -> bqTemplateSpy.setCreateDisposition(null)) + .isInstanceOf(IllegalArgumentException.class) + .hasStackTraceContaining("BigQuery create disposition must not be null."); + } + + @Test + void setJobPollIntervalTest() { + assertThatCode(() -> bqTemplateSpy.setJobPollInterval(Duration.ofSeconds(1L))) + .doesNotThrowAnyException(); + } + + @Test + void setJobPollIntervalThrowsExceptionTest() { + assertThatCode(() -> bqTemplateSpy.setJobPollInterval(null)) + .isInstanceOf(IllegalArgumentException.class) + .hasStackTraceContaining("BigQuery job polling interval must not be null"); + } + @Test void getWriteApiResponseTest() throws DescriptorValidationException, IOException, InterruptedException { @@ -179,7 +248,7 @@ void writeJsonStreamWithSchemaTest() @Test void writeJsonStreamFailsOnGenericWritingException() - throws DescriptorValidationException, IOException, InterruptedException, ExecutionException { + throws DescriptorValidationException, IOException, InterruptedException { InputStream jsonInputStream = new ByteArrayInputStream(newLineSeperatedJson.getBytes()); doReturn(mock(Table.class)) From c6e688e0ff8b4d63de47a8411b209f0265304399 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sun, 4 Dec 2022 16:28:20 -0500 Subject: [PATCH 124/179] upgrade `spring-cloud-dependencies-parent` to `4.0.0-RC3` --- spring-cloud-gcp-dependencies/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud-gcp-dependencies/pom.xml b/spring-cloud-gcp-dependencies/pom.xml index c9dbb44f2d..2195ba453d 100644 --- a/spring-cloud-gcp-dependencies/pom.xml +++ b/spring-cloud-gcp-dependencies/pom.xml @@ -5,7 +5,7 @@ org.springframework.cloud spring-cloud-dependencies-parent - 4.0.0-M5 + 4.0.0-RC3 From 0f43c1c3f73d9dc06eab666d378e8cce0c320ae2 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Wed, 7 Dec 2022 11:33:24 -0500 Subject: [PATCH 125/179] restore kotlin sample to use mysql instance --- .../spring-cloud-gcp-kotlin-samples/pom.xml | 1 - .../spring-cloud-gcp-kotlin-app-sample/README.adoc | 4 ++-- .../spring-cloud-gcp-kotlin-app-sample/pom.xml | 2 +- .../RegistrationKotlinSampleApplicationIntegrationTests.kt | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/pom.xml index 1b8dd83319..87a86c7472 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/pom.xml @@ -10,7 +10,6 @@ 3.5.0-SNAPSHOT - com.google.cloud spring-cloud-gcp-kotlin-samples 3.5.0-SNAPSHOT diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/README.adoc b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/README.adoc index 9a4c2fcd58..eb19fe1e88 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/README.adoc +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/README.adoc @@ -18,9 +18,9 @@ image:http://gstatic.com/cloudssh/images/open-btn.svg[link=https://ssh.cloud.goo + Alternatively, if you have the https://cloud.google.com/sdk/[Google Cloud SDK] installed and initialized, and are logged in with https://developers.google.com/identity/protocols/application-default-credentials[application default credentials], Spring will auto-discover those parameters for you. -2. Create a Google Cloud Postgres instance and a database within the instance. +2. Create a Google Cloud MySQL instance and a database within the instance. -- You may create a Google Cloud Postgres instance on the https://console.cloud.google.com/sql/instances[Google Cloud Console Cloud SQL page]. +- You may create a Google Cloud MySQL instance on the https://console.cloud.google.com/sql/instances[Google Cloud Console Cloud SQL page]. - In the same page, you may create a database within your Cloud SQL instance. Name your database `registrants`. diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/pom.xml index 16b5d14969..f8ae4fc121 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/pom.xml @@ -69,7 +69,7 @@ com.google.cloud - spring-cloud-gcp-starter-sql-postgresql + spring-cloud-gcp-starter-sql-mysql diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/test/kotlin/com/example/RegistrationKotlinSampleApplicationIntegrationTests.kt b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/test/kotlin/com/example/RegistrationKotlinSampleApplicationIntegrationTests.kt index 865fd1d5cb..fbf025e0fc 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/test/kotlin/com/example/RegistrationKotlinSampleApplicationIntegrationTests.kt +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/src/test/kotlin/com/example/RegistrationKotlinSampleApplicationIntegrationTests.kt @@ -45,7 +45,7 @@ import java.util.concurrent.TimeUnit classes = [Application::class], properties = [ "spring.datasource.password=test", - "spring.cloud.gcp.sql.instance-connection-name=spring-cloud-gcp-ci:us-central1:testpostgres", + "spring.cloud.gcp.sql.instance-connection-name=spring-cloud-gcp-ci:us-central1:testmysql", "spring.cloud.gcp.sql.database-name=code_samples_test_db", "spring.test.mockmvc.print=none" ] From 8b3ac1819d3a7e12f7b8e80da96d484df1adf6c1 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 8 Dec 2022 16:55:38 -0500 Subject: [PATCH 126/179] add java 19 support for unit tests --- .github/workflows/unitTests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unitTests.yaml b/.github/workflows/unitTests.yaml index 9495f5817d..e564a80d27 100644 --- a/.github/workflows/unitTests.yaml +++ b/.github/workflows/unitTests.yaml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - java: [17] + java: [17, 19] steps: - name: Get current date id: date From c3c0e72617bb71d2c674b07f11ed68530b5049c0 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 8 Dec 2022 19:39:01 -0500 Subject: [PATCH 127/179] remove unused beans in trace --- .../StackdriverTraceAutoConfiguration.java | 33 ------------------- ...tackdriverTraceAutoConfigurationTests.java | 9 ----- .../TracePubSubAutoConfigurationTest.java | 4 --- 3 files changed, 46 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java index 8b02b611ef..75ed8e3ade 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java @@ -19,8 +19,6 @@ import brave.TracingCustomizer; import brave.baggage.BaggagePropagation; import brave.handler.SpanHandler; -import brave.http.HttpRequestParser; -import brave.http.HttpTracingCustomizer; import brave.propagation.B3Propagation; import brave.propagation.Propagation; import brave.propagation.stackdriver.StackdriverTracePropagation; @@ -49,7 +47,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; import zipkin2.CheckResult; import zipkin2.Span; @@ -259,34 +256,4 @@ public void closeScheduler() { this.defaultTraceSenderThreadPool.shutdown(); } } - - /** Configuration for Sleuth. */ - @Configuration(proxyBeanMethods = false) - @ConditionalOnProperty( - name = "spring.sleuth.http.enabled", - havingValue = "true", - matchIfMissing = true) - @AutoConfigureBefore(BraveAutoConfiguration.class) - public static class StackdriverTraceHttpAutoconfiguration { - @Bean - @ConditionalOnProperty( - name = "spring.sleuth.http.legacy.enabled", - havingValue = "false", - matchIfMissing = true) - @ConditionalOnMissingBean - HttpRequestParser stackdriverHttpRequestParser() { - return new StackdriverHttpRequestParser(); - } - - @Bean - @ConditionalOnProperty( - name = "spring.sleuth.http.legacy.enabled", - havingValue = "false", - matchIfMissing = true) - @ConditionalOnMissingBean - HttpTracingCustomizer stackdriverHttpTracingCustomizer( - HttpRequestParser stackdriverHttpRequestParser) { - return builder -> builder.clientRequestParser(stackdriverHttpRequestParser); - } - } } diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfigurationTests.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfigurationTests.java index 9d3af8d913..52fe8ec8f2 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfigurationTests.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfigurationTests.java @@ -24,14 +24,9 @@ import static org.mockito.Mockito.when; import brave.Tracer; -import brave.Tracing; import brave.TracingCustomizer; import brave.handler.SpanHandler; -import brave.http.HttpRequestParser; -import brave.http.HttpTracingCustomizer; import brave.propagation.TraceContextOrSamplingFlags; -import brave.sampler.Sampler; -import brave.sampler.SamplerFunction; import com.google.api.gax.core.ExecutorProvider; import com.google.cloud.spring.autoconfigure.core.GcpContextAutoConfiguration; import com.google.cloud.spring.autoconfigure.trace.StackdriverTraceAutoConfigurationTests.MultipleSpanHandlersConfig.GcpTraceService; @@ -99,8 +94,6 @@ void test() { () -> SpanHandler.NOOP) .run( context -> { - assertThat(context.getBean(HttpRequestParser.class)).isNotNull(); - assertThat(context.getBean(HttpTracingCustomizer.class)).isNotNull(); assertThat( context.getBean( StackdriverTraceAutoConfiguration.SENDER_BEAN_NAME, Sender.class)) @@ -176,8 +169,6 @@ void supportsMultipleReporters() { .withUserConfiguration(MultipleSpanHandlersConfig.class) .run( context -> { - assertThat(context.getBean(HttpRequestParser.class)).isNotNull(); - assertThat(context.getBean(HttpTracingCustomizer.class)).isNotNull(); assertThat(context.getBean(ManagedChannel.class)).isNotNull(); assertThat(context.getBeansOfType(Sender.class)).hasSize(2); assertThat(context.getBeansOfType(Sender.class)) diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java index f561a9e522..6580191ce6 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java @@ -25,8 +25,6 @@ import brave.Tracing; import brave.handler.SpanHandler; -import brave.http.HttpRequestParser; -import brave.http.HttpTracingCustomizer; import brave.messaging.MessagingTracing; import com.google.api.core.ApiFunction; import com.google.cloud.pubsub.v1.Publisher; @@ -79,8 +77,6 @@ void init() { void test() { this.contextRunner.run( context -> { - assertThat(context.getBean(HttpRequestParser.class)).isNotNull(); - assertThat(context.getBean(HttpTracingCustomizer.class)).isNotNull(); assertThat( context.getBean(StackdriverTraceAutoConfiguration.SENDER_BEAN_NAME, Sender.class)) .isNotNull(); From 18cbbdd583b3e8d9918fb9fe85af94f123cf617e Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 8 Dec 2022 19:58:31 -0500 Subject: [PATCH 128/179] remove `ListenableFuture` in vision --- docs/src/main/asciidoc/vision.adoc | 8 +++---- .../java/com/example/OcrStatusReporter.java | 8 +++---- .../main/java/com/example/WebController.java | 20 ++++++++--------- .../spring/vision/DocumentOcrTemplate.java | 22 +++++++++---------- 4 files changed, 27 insertions(+), 31 deletions(-) diff --git a/docs/src/main/asciidoc/vision.adoc b/docs/src/main/asciidoc/vision.adoc index f78025351d..e8abdef8f3 100644 --- a/docs/src/main/asciidoc/vision.adoc +++ b/docs/src/main/asciidoc/vision.adoc @@ -188,10 +188,10 @@ When OCR is run on a document, the Cloud Vision APIs will output a collection of The `DocumentOcrTemplate` provides the following method for running OCR on a document saved in Google Cloud Storage: -`ListenableFuture runOcrForDocument(GoogleStorageLocation document, GoogleStorageLocation outputFilePathPrefix)` +`CompletableFuture runOcrForDocument(GoogleStorageLocation document, GoogleStorageLocation outputFilePathPrefix)` The method allows you to specify the location of the document and the output location for where all the JSON output files will be saved in Google Cloud Storage. -It returns a `ListenableFuture` containing `DocumentOcrResultSet` which contains the OCR content of the document. +It returns a `CompletableFuture` containing `DocumentOcrResultSet` which contains the OCR content of the document. NOTE: Running OCR on a document is an operation that can take between several minutes to several hours depending on how large the document is. It is recommended to register callbacks to the returned ListenableFuture or ignore it and process the JSON output files at a later point in time using `readOcrOutputFile` or `readOcrOutputFileSet`. @@ -210,7 +210,7 @@ public void runOcrOnDocument() { GoogleStorageLocation outputLocationPrefix = GoogleStorageLocation.forFolder( "your-bucket", "output_folder/test.pdf/"); - ListenableFuture result = + CompletableFuture result = this.documentOcrTemplate.runOcrForDocument( document, outputLocationPrefix); @@ -229,7 +229,7 @@ In some use-cases, you may need to directly read OCR output files stored in Goog - `readOcrOutputFileSet(GoogleStorageLocation jsonOutputFilePathPrefix)`: Reads a collection of OCR output files under a file path prefix and returns the parsed contents. -All of the files under the path should correspond to the same document. +All the files under the path should correspond to the same document. - `readOcrOutputFile(GoogleStorageLocation jsonFile)`: Reads a single OCR output file and returns the parsed contents. diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-vision-ocr-demo/src/main/java/com/example/OcrStatusReporter.java b/spring-cloud-gcp-samples/spring-cloud-gcp-vision-ocr-demo/src/main/java/com/example/OcrStatusReporter.java index c4d969abe5..5b42e9f4a7 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-vision-ocr-demo/src/main/java/com/example/OcrStatusReporter.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-vision-ocr-demo/src/main/java/com/example/OcrStatusReporter.java @@ -19,8 +19,8 @@ import com.google.cloud.spring.vision.DocumentOcrResultSet; import java.util.HashMap; import java.util.Map; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; -import org.springframework.util.concurrent.ListenableFuture; public class OcrStatusReporter { @@ -31,7 +31,7 @@ public OcrStatusReporter() { } public void registerFuture( - String documentPath, ListenableFuture resultFuture) { + String documentPath, CompletableFuture resultFuture) { pendingOcrOperations.put(documentPath, new OcrOperationStatus(documentPath, resultFuture)); } @@ -42,10 +42,10 @@ public Map getDocumentOcrStatuses() { public static final class OcrOperationStatus { final String gcsLocation; - final ListenableFuture ocrResultFuture; + final CompletableFuture ocrResultFuture; public OcrOperationStatus( - String gcsLocation, ListenableFuture ocrResultFuture) { + String gcsLocation, CompletableFuture ocrResultFuture) { this.gcsLocation = gcsLocation; this.ocrResultFuture = ocrResultFuture; } diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-vision-ocr-demo/src/main/java/com/example/WebController.java b/spring-cloud-gcp-samples/spring-cloud-gcp-vision-ocr-demo/src/main/java/com/example/WebController.java index aa9032589d..11a3111fc5 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-vision-ocr-demo/src/main/java/com/example/WebController.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-vision-ocr-demo/src/main/java/com/example/WebController.java @@ -16,7 +16,6 @@ package com.example; -import com.google.api.client.util.ByteStreams; import com.google.cloud.WriteChannel; import com.google.cloud.spring.storage.GoogleStorageLocation; import com.google.cloud.spring.vision.DocumentOcrResultSet; @@ -26,16 +25,17 @@ import com.google.cloud.storage.Storage; import com.google.cloud.storage.Storage.BucketGetOption; import com.google.cloud.vision.v1.TextAnnotation; +import com.google.common.io.ByteStreams; import com.google.protobuf.InvalidProtocolBufferException; import java.io.IOException; import java.nio.channels.Channels; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; import org.springframework.ui.ModelMap; -import org.springframework.util.concurrent.ListenableFuture; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -116,7 +116,7 @@ public ModelAndView submitDocument(@RequestParam("documentUrl") String documentU GoogleStorageLocation.forFolder( outputBlobId.getBucket(), "ocr_results/" + documentLocation.getBlobName()); - ListenableFuture result = + CompletableFuture result = documentOcrTemplate.runOcrForDocument(documentLocation, outputLocation); ocrStatusReporter.registerFuture(documentLocation.uriString(), result); @@ -145,13 +145,11 @@ private static String getFileType(Resource documentResource) { int extensionIdx = documentResource.getFilename().lastIndexOf("."); String fileType = documentResource.getFilename().substring(extensionIdx); - switch (fileType) { - case ".tif": - return "image/tiff"; - case ".pdf": - return "application/pdf"; - default: - throw new IllegalArgumentException("Does not support processing file type: " + fileType); - } + return switch (fileType) { + case ".tif" -> "image/tiff"; + case ".pdf" -> "application/pdf"; + default -> throw new IllegalArgumentException( + "Does not support processing file type: " + fileType); + }; } } diff --git a/spring-cloud-gcp-vision/src/main/java/com/google/cloud/spring/vision/DocumentOcrTemplate.java b/spring-cloud-gcp-vision/src/main/java/com/google/cloud/spring/vision/DocumentOcrTemplate.java index 9bad9c5dd0..ecda8acbba 100644 --- a/spring-cloud-gcp-vision/src/main/java/com/google/cloud/spring/vision/DocumentOcrTemplate.java +++ b/spring-cloud-gcp-vision/src/main/java/com/google/cloud/spring/vision/DocumentOcrTemplate.java @@ -38,12 +38,10 @@ import com.google.cloud.vision.v1.TextAnnotation; import java.util.Collections; import java.util.List; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.Executor; -import java.util.stream.Collectors; import java.util.stream.StreamSupport; import org.springframework.util.Assert; -import org.springframework.util.concurrent.ListenableFuture; -import org.springframework.util.concurrent.SettableListenableFuture; /** * Template providing convenient operations for interfacing with Google Cloud Vision's Document OCR @@ -90,15 +88,15 @@ public DocumentOcrTemplate( * *

Note: OCR processing operations may take several minutes to complete, so it may not be * advisable to block on the completion of the operation. One may use the returned {@link - * ListenableFuture} to register callbacks or track the status of the operation. + * CompletableFuture} to register callbacks or track the status of the operation. * * @param document The {@link GoogleStorageLocation} of the document to run OCR processing * @param outputFilePathPrefix The {@link GoogleStorageLocation} of a file, folder, or a bucket * describing the path for which all output files shall be saved under - * @return A {@link ListenableFuture} allowing you to register callbacks or wait for the + * @return A {@link CompletableFuture} allowing you to register callbacks or wait for the * completion of the operation. */ - public ListenableFuture runOcrForDocument( + public CompletableFuture runOcrForDocument( GoogleStorageLocation document, GoogleStorageLocation outputFilePathPrefix) { Assert.isTrue( @@ -155,7 +153,7 @@ public DocumentOcrResultSet readOcrOutputFileSet(GoogleStorageLocation jsonOutpu List blobPages = StreamSupport.stream(blobsInFolder.getValues().spliterator(), false) .filter(blob -> blob.getContentType().equals("application/octet-stream")) - .collect(Collectors.toList()); + .toList(); return new DocumentOcrResultSet(blobPages); } @@ -182,17 +180,17 @@ public DocumentOcrResultSet readOcrOutputFile(GoogleStorageLocation jsonFile) { return new DocumentOcrResultSet(Collections.singletonList(jsonOutputBlob)); } - private ListenableFuture extractOcrResultFuture( + private CompletableFuture extractOcrResultFuture( OperationFuture grpcFuture) { - SettableListenableFuture result = new SettableListenableFuture<>(); + CompletableFuture result = new CompletableFuture<>(); ApiFutures.addCallback( grpcFuture, - new ApiFutureCallback() { + new ApiFutureCallback<>() { @Override public void onFailure(Throwable throwable) { - result.setException(throwable); + result.completeExceptionally(throwable); } @Override @@ -208,7 +206,7 @@ public void onSuccess(AsyncBatchAnnotateFilesResponse asyncBatchAnnotateFilesRes GoogleStorageLocation outputFolderLocation = new GoogleStorageLocation(outputLocationUri); - result.set(readOcrOutputFileSet(outputFolderLocation)); + result.complete(readOcrOutputFileSet(outputFolderLocation)); } }, this.executor); From c76916a28a2d827b6b1506559d1c995b94262f4c Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 8 Dec 2022 19:58:51 -0500 Subject: [PATCH 129/179] fix integration test in vision --- .../spring/vision/it/DocumentOcrTemplateIntegrationTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-cloud-gcp-vision/src/test/java/com/google/cloud/spring/vision/it/DocumentOcrTemplateIntegrationTests.java b/spring-cloud-gcp-vision/src/test/java/com/google/cloud/spring/vision/it/DocumentOcrTemplateIntegrationTests.java index 8d0963e802..e9ab827e2d 100644 --- a/spring-cloud-gcp-vision/src/test/java/com/google/cloud/spring/vision/it/DocumentOcrTemplateIntegrationTests.java +++ b/spring-cloud-gcp-vision/src/test/java/com/google/cloud/spring/vision/it/DocumentOcrTemplateIntegrationTests.java @@ -25,6 +25,7 @@ import com.google.protobuf.InvalidProtocolBufferException; import java.util.ArrayList; import java.util.Iterator; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; @@ -34,7 +35,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit.jupiter.SpringExtension; -import org.springframework.util.concurrent.ListenableFuture; @EnabledIfSystemProperty(named = "it.vision", matches = "true") @ExtendWith(SpringExtension.class) @@ -53,7 +53,7 @@ void testDocumentOcrTemplate() GoogleStorageLocation outputLocationPrefix = GoogleStorageLocation.forFile("vision-integration-test-bucket", "it_output/test-"); - ListenableFuture result = + CompletableFuture result = this.documentOcrTemplate.runOcrForDocument(document, outputLocationPrefix); DocumentOcrResultSet ocrPages = result.get(5, TimeUnit.MINUTES); From 6befc8734bdd6b59eeb8d804ec4dc75fe7d83048 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 8 Dec 2022 20:00:29 -0500 Subject: [PATCH 130/179] remove unused import --- .../java/com/example/TraceSampleApplicationIntegrationTests.java | 1 - 1 file changed, 1 deletion(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java index 215e9e16e0..e4a855e06e 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/test/java/com/example/TraceSampleApplicationIntegrationTests.java @@ -45,7 +45,6 @@ import java.util.List; import java.util.UUID; import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; From bea4103870de7645f93afa90a9c5a880cc2501c2 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 8 Dec 2022 20:17:03 -0500 Subject: [PATCH 131/179] upgrade to newest version --- pom.xml | 4 ++-- spring-cloud-gcp-dependencies/pom.xml | 1 - .../spring-cloud-gcp-data-datastore-basic-sample/pom.xml | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 9a69aa132b..9f9fb7c128 100644 --- a/pom.xml +++ b/pom.xml @@ -38,12 +38,12 @@ - 2022.0.0-RC2 + 2022.0.0-RC3 3.0.0 1.0.4 2.4.1 0.10.5 - 1.0.0-RC1 + 1.0.0 3.10.1 diff --git a/spring-cloud-gcp-dependencies/pom.xml b/spring-cloud-gcp-dependencies/pom.xml index 2195ba453d..c10d506974 100644 --- a/spring-cloud-gcp-dependencies/pom.xml +++ b/spring-cloud-gcp-dependencies/pom.xml @@ -32,7 +32,6 @@ 26.1.5 1.7.2 31.1-jre - 0.8.2.RELEASE 1.0.0.RELEASE diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml index dedf3733c0..5cdb0d66c0 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml @@ -10,7 +10,6 @@ 4.0.0 - com.google.cloud spring-cloud-gcp-data-datastore-basic-sample Spring Cloud GCP Code Sample - Datastore Bookshelf @@ -39,7 +38,7 @@ org.springframework.shell spring-shell-starter - 3.0.0-M1 + 3.0.0-M3 From 4f4d08ad70b17faf500f2d8f59c38fbb0a8637de Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 8 Dec 2022 20:39:23 -0500 Subject: [PATCH 132/179] restore version --- pom.xml | 2 +- .../spring-cloud-gcp-data-datastore-basic-sample/pom.xml | 2 +- .../DatastoreBookshelfExampleIntegrationTests.java | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 9f9fb7c128..6bbb21907b 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,7 @@ - 2022.0.0-RC3 + 2022.0.0-RC2 3.0.0 1.0.4 2.4.1 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml index 5cdb0d66c0..601e470cf8 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml @@ -38,7 +38,7 @@ org.springframework.shell spring-shell-starter - 3.0.0-M3 + 3.0.0-M1 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/test/java/com/example/DatastoreBookshelfExampleIntegrationTests.java b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/test/java/com/example/DatastoreBookshelfExampleIntegrationTests.java index 3acfbab174..ba7b9e783b 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/test/java/com/example/DatastoreBookshelfExampleIntegrationTests.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/test/java/com/example/DatastoreBookshelfExampleIntegrationTests.java @@ -66,8 +66,9 @@ void testSerializedPage() { this.bookRepository.save(book); Awaitility.await().atMost(15, TimeUnit.SECONDS).until(() -> this.bookRepository.count() == 1); String responseBody = sendRequest("/allbooksserialized", null, HttpMethod.GET); - assertThat(responseBody).contains("content\":[{\"id\":12345678}],\"pageable\":"); - assertThat(responseBody).containsPattern("\"urlSafeCursor\":\".+\""); + assertThat(responseBody) + .contains("content\":[{\"id\":12345678}],\"pageable\":") + .containsPattern("\"urlSafeCursor\":\".+\"");; } @Test @@ -76,8 +77,7 @@ void testSaveBook() { String book2 = (String) this.shell.evaluate(() -> "save-book book2 author2 2000"); String allBooks = (String) this.shell.evaluate(() -> "find-all-books"); - assertThat(allBooks).containsSequence(book1); - assertThat(allBooks).containsSequence(book2); + assertThat(allBooks).containsSequence(book1).containsSequence(book2); assertThat(this.shell.evaluate(() -> "find-by-author author1")).isEqualTo("[" + book1 + "]"); From 9a1a4b9eef747e5a988672f581bb55140db3af16 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 8 Dec 2022 20:48:50 -0500 Subject: [PATCH 133/179] remove `StackdriverHttpRequestParser` --- docs/src/main/asciidoc/trace.adoc | 1 - .../trace/StackdriverHttpRequestParser.java | 43 ------------------- 2 files changed, 44 deletions(-) delete mode 100644 spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverHttpRequestParser.java diff --git a/docs/src/main/asciidoc/trace.adoc b/docs/src/main/asciidoc/trace.adoc index 074ee35f69..315f9a1c6d 100644 --- a/docs/src/main/asciidoc/trace.adoc +++ b/docs/src/main/asciidoc/trace.adoc @@ -112,7 +112,6 @@ This is required by Cloud Trace. - Does not use Span joins. Span joins will share the span ID between the client and server Spans. Cloud Trace requires that every Span ID within a Trace to be unique, so Span joins are not supported. -- Uses `StackdriverHttpRequestParser` by default to populate Stackdriver related fields. === Overriding the auto-configuration diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverHttpRequestParser.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverHttpRequestParser.java deleted file mode 100644 index 000b63ecc4..0000000000 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverHttpRequestParser.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2017-2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.spring.autoconfigure.trace; - -import brave.SpanCustomizer; -import brave.http.HttpRequest; -import brave.http.HttpRequestParser; -import brave.http.HttpTags; -import brave.propagation.TraceContext; -import java.net.URI; - -/** - * An {@link HttpRequestParser} that fills information for Stackdriver Trace. - */ -public class StackdriverHttpRequestParser implements HttpRequestParser { - - @Override - public void parse(HttpRequest request, TraceContext context, SpanCustomizer customizer) { - HttpRequestParser.DEFAULT.parse(request, context, customizer); - HttpTags.URL.tag(request, context, customizer); - HttpTags.ROUTE.tag(request, context, customizer); - - String url = request.url(); - URI uri = URI.create(url); - if (uri.getHost() != null) { - customizer.tag("http.host", uri.getHost()); - } - } -} From 0b738e45cb9ef503e2338814557f8f43bdeb7dcb Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sun, 11 Dec 2022 14:56:40 -0500 Subject: [PATCH 134/179] update docs of secret manager --- docs/src/main/asciidoc/secretmanager.adoc | 18 +--- docs/src/main/md/secretmanager.md | 19 +--- .../README.adoc | 50 ---------- .../pom.xml | 78 --------------- .../com/example/PubSubBinderApplication.java | 35 ------- .../main/java/com/example/SinkExample.java | 67 ------------- .../main/java/com/example/SourceExample.java | 53 ----------- .../main/java/com/example/UserMessage.java | 53 ----------- .../src/main/resources/application.properties | 8 -- .../src/main/resources/static/index.html | 15 --- .../com/example/SampleAppIntegrationTest.java | 77 --------------- .../src/test/resources/logback-test.xml | 14 --- .../README.adoc | 40 -------- .../pom.xml | 78 --------------- .../com/example/PubSubBinderApplication.java | 29 ------ .../main/java/com/example/SinkExample.java | 57 ----------- .../main/java/com/example/SourceExample.java | 45 --------- .../main/java/com/example/UserMessage.java | 72 -------------- .../src/main/resources/application.properties | 13 --- .../src/main/resources/static/index.html | 23 ----- .../PubSubBinderSampleAppIntegrationTest.java | 94 ------------------- .../src/test/resources/logback-test.xml | 14 --- 22 files changed, 9 insertions(+), 943 deletions(-) delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/README.adoc delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/pom.xml delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/PubSubBinderApplication.java delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/SinkExample.java delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/SourceExample.java delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/UserMessage.java delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/resources/application.properties delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/resources/static/index.html delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/test/java/com/example/SampleAppIntegrationTest.java delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/test/resources/logback-test.xml delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/README.adoc delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/pom.xml delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/java/com/example/PubSubBinderApplication.java delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/java/com/example/SinkExample.java delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/java/com/example/SourceExample.java delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/java/com/example/UserMessage.java delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/resources/application.properties delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/resources/static/index.html delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/test/java/com/example/PubSubBinderSampleAppIntegrationTest.java delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/test/resources/logback-test.xml diff --git a/docs/src/main/asciidoc/secretmanager.adoc b/docs/src/main/asciidoc/secretmanager.adoc index 604baabe13..2f5d69b780 100644 --- a/docs/src/main/asciidoc/secretmanager.adoc +++ b/docs/src/main/asciidoc/secretmanager.adoc @@ -36,11 +36,8 @@ dependencies { By default, Spring Cloud GCP Secret Manager will authenticate using Application Default Credentials. This can be overridden using the authentication properties. -NOTE: All the below settings must be specified in a https://cloud.spring.io/spring-cloud-commons/multi/multi__spring_cloud_context_application_context_services.html#_the_bootstrap_application_context[`bootstrap.properties`] (or `bootstrap.yaml`) file which is the properties file used to configure settings for bootstrap-phase Spring configuration. - |=== | Name | Description | Required | Default value -| `spring.cloud.gcp.secretmanager.enabled` | Enables the Secret Manager bootstrap property and template configuration. | No | `true` | `spring.cloud.gcp.secretmanager.credentials.location` | OAuth2 credentials for authenticating to the Google Cloud Secret Manager API. | No | By default, infers credentials from https://cloud.google.com/docs/authentication/production[Application Default Credentials]. | `spring.cloud.gcp.secretmanager.credentials.encoded-key` | Base64-encoded contents of OAuth2 account private key for authenticating to the Google Cloud Secret Manager API. | No | By default, infers credentials from https://cloud.google.com/docs/authentication/production[Application Default Credentials]. | `spring.cloud.gcp.secretmanager.project-id` | The default GCP Project used to access Secret Manager API for the template and property source. | No | By default, infers the project from https://cloud.google.com/docs/authentication/production[Application Default Credentials]. @@ -80,13 +77,15 @@ sm:// You can use this syntax in the following places: -1. In your `application.properties` or `bootstrap.properties` files: +1. In your `application.properties` file: + [source] ---- # Example of the project-secret long-form syntax. +spring.config.import=sm:// spring.datasource.password=${sm://projects/my-gcp-project/secrets/my-secret} ---- +The former is used to enable https://spring.io/blog/2020/08/14/config-file-processing-in-spring-boot-2-4[Spring Boot's Config Data API]. 2. Access the value using the `@Value` annotation. + @@ -123,20 +122,11 @@ import the actuator starter dependency to your project, spring-boot-starter-actuator ---- -add the following properties to your project's `application.properties`. The latter is used to enable https://spring.io/blog/2020/08/14/config-file-processing-in-spring-boot-2-4[Spring Boot's Config Data API]. +add the following properties to your project's `application.properties`. + [source] ---- management.endpoints.web.exposure.include=refresh -spring.config.import=sm:// ----- -+ -finally, add the following property to your project's `bootstrap.properties` to disable -Secret Manager bootstrap phrase. -+ -[source] ----- -spring.cloud.gcp.secretmanager.legacy=false ---- 2. After running the application, update your secret stored in the Secret Manager. diff --git a/docs/src/main/md/secretmanager.md b/docs/src/main/md/secretmanager.md index 4bf47b1c10..d34c55a8c6 100644 --- a/docs/src/main/md/secretmanager.md +++ b/docs/src/main/md/secretmanager.md @@ -43,19 +43,9 @@ By default, Spring Cloud GCP Secret Manager will authenticate using Application Default Credentials. This can be overridden using the authentication properties. -

- -All of the below settings must be specified in a -[`bootstrap.properties`](https://cloud.spring.io/spring-cloud-commons/multi/multi__spring_cloud_context_application_context_services.html#_the_bootstrap_application_context) -(or `bootstrap.yaml`) file which is the properties file used to -configure settings for bootstrap-phase Spring configuration. - -
- | | | | | |-----------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -------- | ------------------------------------------------------------------------------------------------------------------------------- | | Name | Description | Required | Default value | -| `spring.cloud.gcp.secretmanager.enabled` | Enables the Secret Manager bootstrap property and template configuration. | No | `true` | | `spring.cloud.gcp.secretmanager.credentials.location` | OAuth2 credentials for authenticating to the Google Cloud Secret Manager API. | No | By default, infers credentials from [Application Default Credentials](https://cloud.google.com/docs/authentication/production). | | `spring.cloud.gcp.secretmanager.credentials.encoded-key` | Base64-encoded contents of OAuth2 account private key for authenticating to the Google Cloud Secret Manager API. | No | By default, infers credentials from [Application Default Credentials](https://cloud.google.com/docs/authentication/production). | | `spring.cloud.gcp.secretmanager.project-id` | The default GCP Project used to access Secret Manager API for the template and property source. | No | By default, infers the project from [Application Default Credentials](https://cloud.google.com/docs/authentication/production). | @@ -96,12 +86,14 @@ secrets: You can use this syntax in the following places: -1. In your `application.properties` or `bootstrap.properties` files: +1. In your `application.properties` file: # Example of the project-secret long-form syntax. + spring.config.import=sm:// spring.datasource.password=${sm://projects/my-gcp-project/secrets/my-secret} + The former is used to enable [Spring Boot's Config Data API](https://spring.io/blog/2020/08/14/config-file-processing-in-spring-boot-2-4). -2. Access the value using the `@Value` annotation. +3. Access the value using the `@Value` annotation. // Example of using shortest form syntax. @Value("${sm://my-secret}") @@ -135,10 +127,9 @@ template. spring-boot-starter-actuator -- add the following property to your project's `application.properties`. The latter is used to enable [Spring Boot's Config Data API](https://spring.io/blog/2020/08/14/config-file-processing-in-spring-boot-2-4). +- add the following property to your project's `application.properties`. management.endpoints.web.exposure.include=refresh - spring.config.import=sm:// - finally, add the following property to your project's `bootstrap.properties` to disable Secret Manager bootstrap phrase. diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/README.adoc b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/README.adoc deleted file mode 100644 index 52977a2ec2..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/README.adoc +++ /dev/null @@ -1,50 +0,0 @@ -= Spring Cloud GCP Stream for Pub/Sub Polling Code Sample - -This code sample demonstrates how to use the Spring Cloud Stream binder for Google Cloud Pub/Sub. -The sample app prompts a user for a message and their user name. -That data is added to a `UserMessage` object, together with the time of message creation, and is sent through Google Cloud Pub/Sub to a sink which simply logs the message. - -If the topic and subscription for the sink and source don't exist, the binder will automatically create them in Google Cloud Pub/Sub based on the values in link:src/main/resources/application.properties[application.properties]. - -The `SourceExample` in this sample is the same as in link:../spring-cloud-gcp-pubsub-stream-sample/[Streaming PubSub Sample]; there is nothing polling-specific in it. -`SinkExample`, however, describes a poll-style interaction with a Pub/Sub subscription. - -The following code, combined with `@EnableScheduling` annotation in `PubSubBinderApplication`, triggers retrieval of a message every second. -Note that `destIn` bean is provided by Spring Cloud Stream, using the _spring-cloud-gcp-pubsub-stream-binder_ dependency for the bean implementation. - -[source,java] ----- -@Scheduled(fixedRate = 1000) -public void poller() { - - destIn.poll(this.messageHandler, ParameterizedTypeReference.forType(UserMessage.class)); -} ----- - - -== Running the code sample - -image:http://gstatic.com/cloudssh/images/open-btn.svg[link=https://ssh.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2FGoogleCloudPlatform%2Fspring-cloud-gcp&cloudshell_open_in_editor=spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/README.adoc] - -1. Configure your credentials and project ID by following link:../../docs/src/main/asciidoc/core.adoc#project-id[these instructions]. -+ -Alternatively, if you have the https://cloud.google.com/sdk/[Google Cloud SDK] installed and initialized, and are logged in with https://developers.google.com/identity/protocols/application-default-credentials[application default credentials], Spring will auto-discover those parameters for you. - -2. Set your project ID using the `spring.cloud.gcp.project-id` property in link:src/main/resources/application.properties[application.properties] or use the `gcloud config set project [PROJECT_ID]` Cloud SDK command. - -3. Set the topic and subscription name in the link:src/main/resources/application.properties[application.properties] file. -+ -If you're relying on the binder automatically creating the topic and subscription for you, they need to have the same name so that the messages are properly routed. -+ -Alternatively, you can manually create the topic and subscription from the https://console.cloud.google.com/cloudpubsub[Google Cloud Console]. - -4. Run `$ mvn clean install` from the root directory of the project. - -5. Run `$ mvn clean spring-boot:run` in the root of the code sample to get the app running. - -6. Browse to `localhost:8080` or use the `Web Preview` feature in Cloud Shell to preview the app on port 8080, -type in a message and a user name and press the `Post it!` button. - -7. Verify in your app's logs that a similar message was posted: -+ -`New message received from [USERNAME] via polling: [MESSAGE] at [TIME_MESSAGE_SENT]` diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/pom.xml deleted file mode 100644 index ccac66367b..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/pom.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - spring-cloud-gcp-samples - com.google.cloud - 3.5.0-SNAPSHOT - - 4.0.0 - - spring-cloud-gcp-pubsub-stream-polling-sample - Spring Cloud GCP Code Sample - Pub/Sub Binder for Spring Cloud Stream Polling - - - - - - com.google.cloud - spring-cloud-gcp-dependencies - ${project.version} - pom - import - - - - - - - com.google.cloud - spring-cloud-gcp-starter-pubsub - - - com.google.cloud - spring-cloud-gcp-pubsub-stream-binder - - - org.springframework.boot - spring-boot-starter-web - - - - - org.awaitility - awaitility - 4.2.0 - test - - - junit - junit - test - - - org.springframework.boot - spring-boot-starter-test - test - - - commons-io - commons-io - 2.11.0 - test - - - - - - - maven-deploy-plugin - - true - - - - - diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/PubSubBinderApplication.java b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/PubSubBinderApplication.java deleted file mode 100644 index 87283a9c54..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/PubSubBinderApplication.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2017-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.scheduling.annotation.EnableScheduling; - -/** - * Sample application for a binder. - * - * @since 1.2 - */ -@SpringBootApplication -@EnableScheduling -public class PubSubBinderApplication { - - public static void main(String[] args) { - SpringApplication.run(PubSubBinderApplication.class, args); - } -} diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/SinkExample.java b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/SinkExample.java deleted file mode 100644 index e795eb1d42..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/SinkExample.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2017-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example; - -import com.google.cloud.spring.pubsub.support.AcknowledgeablePubsubMessage; -import com.google.cloud.spring.pubsub.support.GcpPubSubHeaders; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.cloud.stream.binder.PollableMessageSource; -import org.springframework.core.ParameterizedTypeReference; -import org.springframework.messaging.Message; -import org.springframework.messaging.MessageHandler; -import org.springframework.scheduling.annotation.Scheduled; - -/** - * Example of a sink for the sample app. - * - * @since 1.2 - */ -public class SinkExample { - - private static final Log LOGGER = LogFactory.getLog(SinkExample.class); - - @Autowired PollableMessageSource destIn; - - PolledMessageHandler messageHandler = new PolledMessageHandler(); - - @Scheduled(fixedRate = 1000) - public void poller() { - - destIn.poll(this.messageHandler, ParameterizedTypeReference.forType(UserMessage.class)); - } - - static class PolledMessageHandler implements MessageHandler { - @Override - public void handleMessage(Message message) { - AcknowledgeablePubsubMessage ackableMessage = - (AcknowledgeablePubsubMessage) - message.getHeaders().get(GcpPubSubHeaders.ORIGINAL_MESSAGE); - ackableMessage.ack(); - - UserMessage userMessage = (UserMessage) message.getPayload(); - LOGGER.info( - "New message received from " - + userMessage.getUsername() - + " via polling: " - + userMessage.getBody() - + " at " - + userMessage.getCreatedAt()); - } - } -} diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/SourceExample.java b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/SourceExample.java deleted file mode 100644 index c922d0ead8..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/SourceExample.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2017-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example; - -import java.time.LocalDateTime; -import java.util.function.Consumer; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.context.annotation.Bean; -import org.springframework.messaging.support.GenericMessage; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * A sample source application that constructs a {@link UserMessage} object based on a HTTP request, - * and sends it to a PubSub topic. - * - * @since 1.2 - */ -@RestController -public class SourceExample { - - private static final Log LOGGER = LogFactory.getLog(SourceExample.class); - - @PostMapping("/newMessage") - public UserMessage sendMessage( - @RequestParam("messageBody") String messageBody, @RequestParam("username") String username) { - - UserMessage userMessage = new UserMessage(messageBody, username, LocalDateTime.now()); - this.source.output().send(new GenericMessage<>(userMessage)); - return userMessage; - } - - @Bean - public Consumer consumer() { - return str -> LOGGER.info("received " + str); - } -} diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/UserMessage.java b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/UserMessage.java deleted file mode 100644 index b77136af76..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/java/com/example/UserMessage.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2017-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example; - -import java.time.LocalDateTime; - -/** - * A user message for the sample app. - * - * @since 1.2 - */ -public class UserMessage { - - private String body; - - private String username; - - private LocalDateTime createdAt; - - public UserMessage() {} - - public UserMessage(String body, String username, LocalDateTime createdAt) { - this.body = body; - this.username = username; - this.createdAt = createdAt; - } - - public String getBody() { - return this.body; - } - - public String getUsername() { - return this.username; - } - - public LocalDateTime getCreatedAt() { - return this.createdAt; - } -} diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/resources/application.properties b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/resources/application.properties deleted file mode 100644 index 364dec203e..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/resources/application.properties +++ /dev/null @@ -1,8 +0,0 @@ -spring.cloud.stream.bindings.input.destination=[PUBSUB_TOPIC_NAME] -spring.cloud.stream.bindings.output.destination=[PUBSUB_TOPIC_NAME] - -# If group is specified, the Pub/Sub subscription name will be [PUBSUB_TOPIC_NAME].[PUBSUB_GROUP_NAME] -#spring.cloud.stream.bindings.input.group=[PUBSUB_GROUP_NAME] - -#spring.cloud.gcp.project-id=[YOUR_GCP_PROJECT_ID] -#spring.cloud.gcp.credentials.location=file:[LOCAL_PATH_TO_CREDENTIALS] diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/resources/static/index.html b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/resources/static/index.html deleted file mode 100644 index 9dd6b615e4..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/main/resources/static/index.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - Spring Cloud GCP Pub/Sub Stream Binder Code Sample - - - New message:
-
- Message body:
- Username:
- -
- - diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/test/java/com/example/SampleAppIntegrationTest.java b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/test/java/com/example/SampleAppIntegrationTest.java deleted file mode 100644 index f4081ff720..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/test/java/com/example/SampleAppIntegrationTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2017-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.util.UUID; -import java.util.concurrent.Callable; -import java.util.concurrent.TimeUnit; -import org.awaitility.Awaitility; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.EnabledIfSystemProperty; -import org.junit.jupiter.api.extension.ExtendWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.system.CapturedOutput; -import org.springframework.boot.test.system.OutputCaptureExtension; -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit.jupiter.SpringExtension; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; - -/** - * These tests verifies that the pubsub-polling-binder-sample works. - * - * @since 1.2 - */ -// Please use "-Dit.pubsub=true" to enable the tests -@EnabledIfSystemProperty(named = "it.pubsub", matches = "true") -@ExtendWith(OutputCaptureExtension.class) -@ExtendWith(SpringExtension.class) -@SpringBootTest( - webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, - properties = { - "spring.cloud.stream.bindings.input.destination=sub1", - "spring.cloud.stream.bindings.output.destination=sub1" - }) -@DirtiesContext -class SampleAppIntegrationTest { - - @Autowired private TestRestTemplate restTemplate; - - @Test - void testSample(CapturedOutput capturedOutput) throws Exception { - MultiValueMap map = new LinkedMultiValueMap<>(); - String message = "test message " + UUID.randomUUID(); - - map.add("messageBody", message); - map.add("username", "testUserName"); - - this.restTemplate.postForObject("/newMessage", map, String.class); - - Callable logCheck = - () -> - capturedOutput - .toString() - .contains("New message received from testUserName via polling: " + message); - Awaitility.await().atMost(60, TimeUnit.SECONDS).until(logCheck); - - assertThat(logCheck.call()).isTrue(); - } -} diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/test/resources/logback-test.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/test/resources/logback-test.xml deleted file mode 100644 index 5535de3c96..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/src/test/resources/logback-test.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/README.adoc b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/README.adoc deleted file mode 100644 index 347b1b61fa..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/README.adoc +++ /dev/null @@ -1,40 +0,0 @@ -= Spring Cloud GCP Stream for Pub/Sub Code Sample - -This code sample demonstrates how to use the Spring Cloud Stream binder for Google Cloud Pub/Sub in the legacy (annotation-based), Spring Cloud Stream style. For the modern (functional) style, check out link:../spring-cloud-gcp-pubsub-stream-functional-sample[this sample]. - -The sample app prompts a user for a message and their user name. -That data is added to a `UserMessage` object, together with the time of message creation, and is sent through Google Cloud Pub/Sub to a sink which simply logs the message. - -Additionally, you may specify the setting `throwError` through the app. -If set to true, this will trigger an exception in the message handler and demonstrate how messages will be forwarded to the error channel. - -If the topic for the sink and source does not exist, the binder will automatically create them in Google Cloud Pub/Sub based on the values in link:src/main/resources/application.properties[application.properties]. - -If the group is not specified, an anonymous subscription with the name `anonymous..` will be generated. - -== Running the code sample - -image:http://gstatic.com/cloudssh/images/open-btn.svg[link=https://ssh.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2FGoogleCloudPlatform%2Fspring-cloud-gcp&cloudshell_open_in_editor=spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/README.adoc] - -1. Configure your credentials and project ID by following link:../../docs/src/main/asciidoc/core.adoc#project-id[these instructions]. -+ -Alternatively, if you have the https://cloud.google.com/sdk/[Google Cloud SDK] installed and initialized, and are logged in with https://developers.google.com/identity/protocols/application-default-credentials[application default credentials], Spring will auto-discover those parameters for you. - -2. Set your project ID using the `spring.cloud.gcp.project-id` property in link:src/main/resources/application.properties[application.properties] or use the `gcloud config set project [PROJECT_ID]` Cloud SDK command. - -3. In the link:src/main/resources/application.properties[application.properties] file, a topic and group name is already preconfigured for you. -The topic will be created in your account if it does not already exist. -+ -Setting the topic name and group allows you to configure error handling for your Pub/Sub binder. -An error handler is configured in link:src/main/java/com/example/SinkExample.java[SinkExample.java]. - -4. Run `$ mvn clean install` from the root directory of the project. - -5. Run `$ mvn clean spring-boot:run` in the root of the code sample to get the app running. - -6. Browse to `localhost:8080` or use the `Web Preview` feature in Cloud Shell to preview the app on port 8080, -type in a message and a user name and press the `Post it!` button. - -7. Verify in your app's logs that a similar message was posted: -+ -`New message received from [USERNAME] at [TIME_MESSAGE_SENT]: [MESSAGE]` diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/pom.xml deleted file mode 100644 index e0dcd60481..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/pom.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - spring-cloud-gcp-samples - com.google.cloud - 3.5.0-SNAPSHOT - - 4.0.0 - - spring-cloud-gcp-pubsub-stream-sample - Spring Cloud GCP Code Sample - Pub/Sub Binder for Spring Cloud Stream - - - - - - com.google.cloud - spring-cloud-gcp-dependencies - ${project.version} - pom - import - - - - - - - com.google.cloud - spring-cloud-gcp-starter-pubsub - - - com.google.cloud - spring-cloud-gcp-pubsub-stream-binder - - - org.springframework.boot - spring-boot-starter-web - - - - - org.awaitility - awaitility - 4.2.0 - test - - - junit - junit - test - - - org.springframework.boot - spring-boot-starter-test - test - - - commons-io - commons-io - 2.11.0 - test - - - - - - - maven-deploy-plugin - - true - - - - - diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/java/com/example/PubSubBinderApplication.java b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/java/com/example/PubSubBinderApplication.java deleted file mode 100644 index 3d03fc9853..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/java/com/example/PubSubBinderApplication.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2017-2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** Sample application for a binder. */ -@SpringBootApplication -public class PubSubBinderApplication { - - public static void main(String[] args) { - SpringApplication.run(PubSubBinderApplication.class, args); - } -} diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/java/com/example/SinkExample.java b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/java/com/example/SinkExample.java deleted file mode 100644 index 57164ae262..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/java/com/example/SinkExample.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2017-2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.cloud.stream.annotation.EnableBinding; -import org.springframework.cloud.stream.annotation.StreamListener; -import org.springframework.cloud.stream.messaging.Sink; -import org.springframework.integration.annotation.ServiceActivator; -import org.springframework.messaging.Message; -import org.springframework.messaging.MessagingException; - -/** Example of a sink for the sample app. */ -@EnableBinding(Sink.class) -public class SinkExample { - - private static final Log LOGGER = LogFactory.getLog(SinkExample.class); - - @StreamListener(Sink.INPUT) - public void handleMessage(UserMessage userMessage) { - if (userMessage.isThrowError()) { - throw new RuntimeException("An error was triggered in the message handler!"); - } - - LOGGER.info( - "New message received from " - + userMessage.getUsername() - + ": " - + userMessage.getBody() - + " at " - + userMessage.getCreatedAt()); - } - - // Note that the error `inputChannel` is formatted as [Pub/Sub subscription name].errors - // or the equivalent of [Pub/Sub topic name].[group name].errors. If you change the topic name in - // `application.properties`, you will also have to change the `inputChannel` below. - @ServiceActivator(inputChannel = "my-topic.my-group.errors") - public void error(Message message) { - LOGGER.error("The message that was sent is now processed by the error handler."); - LOGGER.error("Failed message: " + message.getPayload().getFailedMessage()); - } -} diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/java/com/example/SourceExample.java b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/java/com/example/SourceExample.java deleted file mode 100644 index d20d8b4326..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/java/com/example/SourceExample.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2017-2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example; - -import java.time.LocalDateTime; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.cloud.stream.annotation.EnableBinding; -import org.springframework.cloud.stream.messaging.Source; -import org.springframework.messaging.support.GenericMessage; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** An example source for the sample app. */ -@EnableBinding(Source.class) -@RestController -public class SourceExample { - - @Autowired private Source source; - - @PostMapping("/newMessage") - public UserMessage sendMessage( - @RequestParam("messageBody") String messageBody, - @RequestParam("username") String username, - @RequestParam("throwError") boolean shouldThrowError) { - UserMessage userMessage = - new UserMessage(messageBody, username, LocalDateTime.now(), shouldThrowError); - this.source.output().send(new GenericMessage<>(userMessage)); - return userMessage; - } -} diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/java/com/example/UserMessage.java b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/java/com/example/UserMessage.java deleted file mode 100644 index 29d1eb657b..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/java/com/example/UserMessage.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2017-2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example; - -import java.time.LocalDateTime; - -/** A user message for the sample app. */ -public class UserMessage { - - private String body; - - private String username; - - private LocalDateTime createdAt; - - private boolean throwError; - - public UserMessage() {} - - public UserMessage(String body, String username, LocalDateTime createdAt, boolean throwError) { - this.body = body; - this.username = username; - this.createdAt = createdAt; - this.throwError = throwError; - } - - public String getBody() { - return this.body; - } - - public void setBody(String body) { - this.body = body; - } - - public String getUsername() { - return this.username; - } - - public void setUsername(String username) { - this.username = username; - } - - public LocalDateTime getCreatedAt() { - return this.createdAt; - } - - public void setCreatedAt(LocalDateTime createdAt) { - this.createdAt = createdAt; - } - - public boolean isThrowError() { - return throwError; - } - - public void setThrowError(boolean throwError) { - this.throwError = throwError; - } -} diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/resources/application.properties b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/resources/application.properties deleted file mode 100644 index e8bb5d9d7c..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/resources/application.properties +++ /dev/null @@ -1,13 +0,0 @@ -spring.cloud.stream.bindings.input.destination=my-topic -spring.cloud.stream.bindings.output.destination=my-topic - -# If group is specified, the Pub/Sub subscription name will be [PUBSUB_TOPIC_NAME].[PUBSUB_GROUP_NAME] -spring.cloud.stream.bindings.input.group=my-group - -# Alternatively, you can use a custom, pre-existing subscription. -#spring.cloud.stream.bindings.input.customSubscription=my-custom-subscription -#spring.cloud.stream.bindings.input.customSubscription=projects/my-project/subscriptions/my-other-custom-subscription - -#spring.cloud.gcp.project-id=[YOUR_GCP_PROJECT_ID] -#spring.cloud.gcp.credentials.location=file:[LOCAL_PATH_TO_CREDENTIALS] - diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/resources/static/index.html b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/resources/static/index.html deleted file mode 100644 index b76e4a6cbd..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/main/resources/static/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - Spring Cloud GCP Pub/Sub Stream Binder Code Sample - - - New message:
-
- Message body:
- Username:
- - Throw Error? (triggers the error handler) - -
- - -
- - diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/test/java/com/example/PubSubBinderSampleAppIntegrationTest.java b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/test/java/com/example/PubSubBinderSampleAppIntegrationTest.java deleted file mode 100644 index f273e455b6..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/test/java/com/example/PubSubBinderSampleAppIntegrationTest.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2017-2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.awaitility.Awaitility.await; - -import java.util.UUID; -import java.util.concurrent.TimeUnit; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.EnabledIfSystemProperty; -import org.junit.jupiter.api.extension.ExtendWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.system.CapturedOutput; -import org.springframework.boot.test.system.OutputCaptureExtension; -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit.jupiter.SpringExtension; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; - -/** - * These tests verifies that the pubsub-binder-sample works. - * - * @since 1.1 - */ -@EnabledIfSystemProperty(named = "it.pubsub", matches = "true") -@ExtendWith(SpringExtension.class) -@ExtendWith(OutputCaptureExtension.class) -@SpringBootTest( - webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, - properties = { - "spring.cloud.stream.bindings.input.destination=my-topic", - "spring.cloud.stream.bindings.output.destination=my-topic", - "spring.cloud.stream.bindings.input.group=my-group" - }) -@DirtiesContext -class PubSubBinderSampleAppIntegrationTest { - - @Autowired private TestRestTemplate restTemplate; - - @Test - void testSample_successfulMessage(CapturedOutput capturedOutput) throws Exception { - MultiValueMap map = new LinkedMultiValueMap<>(); - String message = "test message " + UUID.randomUUID(); - - map.add("messageBody", message); - map.add("username", "testUserName"); - map.add("throwError", false); - - this.restTemplate.postForObject("/newMessage", map, String.class); - - await() - .atMost(20, TimeUnit.SECONDS) - .untilAsserted( - () -> - assertThat(capturedOutput.toString()) - .contains("New message received from testUserName: " + message + " at ")); - } - - @Test - void testSample_error(CapturedOutput capturedOutput) throws Exception { - MultiValueMap map = new LinkedMultiValueMap<>(); - String message = "test message " + UUID.randomUUID(); - - map.add("messageBody", message); - map.add("username", "testUserName"); - map.add("throwError", true); - - this.restTemplate.postForObject("/newMessage", map, String.class); - - await() - .atMost(20, TimeUnit.SECONDS) - .untilAsserted( - () -> - assertThat(capturedOutput.toString()) - .contains("The message that was sent is now processed by the error handler.")); - } -} diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/test/resources/logback-test.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/test/resources/logback-test.xml deleted file mode 100644 index 5535de3c96..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/src/test/resources/logback-test.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - From 6c4a1e71e21ea17788103e82ba44f841bccde363 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sun, 11 Dec 2022 15:24:01 -0500 Subject: [PATCH 135/179] turn off `CanIgnoreReturnValue` in errorprone --- pom.xml | 6 +++++- .../java/com/google/cloud/spring/core/util/MapBuilder.java | 2 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 6bbb21907b..f09331f07a 100644 --- a/pom.xml +++ b/pom.xml @@ -521,7 +521,11 @@ true -XDcompilePolicy=simple - -Xplugin:ErrorProne -Xep:UnicodeInCode:OFF + + -Xplugin:ErrorProne \ + -Xep:UnicodeInCode:OFF \ + -Xep:CanIgnoreReturnValue:OFF + -parameters -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED diff --git a/spring-cloud-gcp-core/src/main/java/com/google/cloud/spring/core/util/MapBuilder.java b/spring-cloud-gcp-core/src/main/java/com/google/cloud/spring/core/util/MapBuilder.java index 1e89b61ba4..7ab27d2f07 100644 --- a/spring-cloud-gcp-core/src/main/java/com/google/cloud/spring/core/util/MapBuilder.java +++ b/spring-cloud-gcp-core/src/main/java/com/google/cloud/spring/core/util/MapBuilder.java @@ -16,7 +16,6 @@ package com.google.cloud.spring.core.util; -import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.util.Collections; import java.util.HashMap; import java.util.Map; @@ -44,7 +43,6 @@ public final class MapBuilder { * @param value non-null value * @return itself for chaining */ - @CanIgnoreReturnValue public MapBuilder put(K key, V value) { Assert.notNull(key, "Map key cannot be null."); Assert.notNull(value, "Map value cannot be null."); From 3529b119e9768e7deaae34420a368610e8d9723a Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sun, 11 Dec 2022 15:42:17 -0500 Subject: [PATCH 136/179] implement new auto configuration style --- .../DatastoreTransactionManagerAutoConfiguration.java | 7 +++++-- .../SpannerTransactionManagerAutoConfiguration.java | 7 +++++-- .../autoconfigure/vision/CloudVisionAutoConfiguration.java | 4 ++-- .../src/main/java/com/example/Application.java | 4 ++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/DatastoreTransactionManagerAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/DatastoreTransactionManagerAutoConfiguration.java index d1fb68e7ee..83f990649a 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/DatastoreTransactionManagerAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/datastore/DatastoreTransactionManagerAutoConfiguration.java @@ -26,7 +26,6 @@ import org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration; import org.springframework.boot.autoconfigure.transaction.TransactionManagerCustomizers; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.transaction.PlatformTransactionManager; /** @@ -40,8 +39,12 @@ @AutoConfigureBefore(TransactionAutoConfiguration.class) public class DatastoreTransactionManagerAutoConfiguration { + private DatastoreTransactionManagerAutoConfiguration() { + + } + /** Configuration class. */ - @Configuration(proxyBeanMethods = false) + @AutoConfiguration static class DatastoreTransactionManagerConfiguration { private final DatastoreProvider datastore; diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/SpannerTransactionManagerAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/SpannerTransactionManagerAutoConfiguration.java index 53a74dcd1a..380fb419da 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/SpannerTransactionManagerAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/spanner/SpannerTransactionManagerAutoConfiguration.java @@ -28,7 +28,6 @@ import org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration; import org.springframework.boot.autoconfigure.transaction.TransactionManagerCustomizers; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.transaction.PlatformTransactionManager; /** @@ -42,8 +41,12 @@ @AutoConfigureBefore(TransactionAutoConfiguration.class) public class SpannerTransactionManagerAutoConfiguration { + private SpannerTransactionManagerAutoConfiguration() { + + } + /** Config settings. */ - @Configuration(proxyBeanMethods = false) + @AutoConfiguration static class DatabaseClientTransactionManagerConfiguration { private final Supplier databaseClientProvider; diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/vision/CloudVisionAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/vision/CloudVisionAutoConfiguration.java index c4f2f200b0..d280928533 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/vision/CloudVisionAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/vision/CloudVisionAutoConfiguration.java @@ -27,12 +27,12 @@ import java.io.IOException; import java.util.concurrent.Executor; import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; /** @@ -40,7 +40,7 @@ * * @since 1.1 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @EnableConfigurationProperties(CloudVisionProperties.class) @ConditionalOnClass(CloudVisionTemplate.class) @ConditionalOnProperty(value = "spring.cloud.gcp.vision.enabled", matchIfMissing = true) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/Application.java b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/Application.java index 174f1e79fb..4de0374b44 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/Application.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/Application.java @@ -31,10 +31,10 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; import org.springframework.boot.actuate.autoconfigure.tracing.zipkin.ZipkinAutoConfiguration; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.integration.annotation.ServiceActivator; import org.springframework.integration.channel.DirectChannel; import org.springframework.lang.NonNull; @@ -47,7 +47,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; /** Sample spring boot application. */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @SpringBootApplication(exclude = ZipkinAutoConfiguration.class) public class Application implements WebMvcConfigurer { private static final Logger LOGGER = LoggerFactory.getLogger(Application.class); From dfd5263bc8c8aa6674b05d13008e31c1f8d4e83e Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sun, 11 Dec 2022 15:42:42 -0500 Subject: [PATCH 137/179] order configuration files --- ...ot.autoconfigure.AutoConfiguration.imports | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-cloud-gcp-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index ce06be901f..99c6d6dffd 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/spring-cloud-gcp-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1,30 +1,30 @@ -com.google.cloud.spring.autoconfigure.pubsub.GcpPubSubEmulatorAutoConfiguration +com.google.cloud.spring.autoconfigure.bigquery.GcpBigQueryAutoConfiguration com.google.cloud.spring.autoconfigure.core.GcpContextAutoConfiguration -com.google.cloud.spring.autoconfigure.logging.StackdriverLoggingAutoConfiguration +com.google.cloud.spring.autoconfigure.datastore.DatastoreRepositoriesAutoConfiguration +com.google.cloud.spring.autoconfigure.datastore.GcpDatastoreAutoConfiguration +com.google.cloud.spring.autoconfigure.datastore.GcpDatastoreEmulatorAutoConfiguration +com.google.cloud.spring.autoconfigure.datastore.DatastoreTransactionManagerAutoConfiguration +com.google.cloud.spring.autoconfigure.datastore.health.DatastoreHealthIndicatorAutoConfiguration +com.google.cloud.spring.autoconfigure.firestore.FirestoreTransactionManagerAutoConfiguration +com.google.cloud.spring.autoconfigure.firestore.GcpFirestoreAutoConfiguration +com.google.cloud.spring.autoconfigure.firestore.GcpFirestoreEmulatorAutoConfiguration +com.google.cloud.spring.autoconfigure.firestore.FirestoreRepositoriesAutoConfiguration +com.google.cloud.spring.autoconfigure.kms.GcpKmsAutoConfiguration +com.google.cloud.spring.autoconfigure.metrics.GcpStackdriverMetricsAutoConfiguration com.google.cloud.spring.autoconfigure.pubsub.GcpPubSubAutoConfiguration +com.google.cloud.spring.autoconfigure.pubsub.GcpPubSubEmulatorAutoConfiguration com.google.cloud.spring.autoconfigure.pubsub.GcpPubSubReactiveAutoConfiguration +com.google.cloud.spring.autoconfigure.pubsub.health.PubSubHealthIndicatorAutoConfiguration +com.google.cloud.spring.autoconfigure.pubsub.health.PubSubSubscriptionHealthIndicatorAutoConfiguration +com.google.cloud.spring.autoconfigure.logging.StackdriverLoggingAutoConfiguration +com.google.cloud.spring.autoconfigure.security.FirebaseAuthenticationAutoConfiguration +com.google.cloud.spring.autoconfigure.security.IapAuthenticationAutoConfiguration com.google.cloud.spring.autoconfigure.spanner.GcpSpannerAutoConfiguration com.google.cloud.spring.autoconfigure.spanner.GcpSpannerEmulatorAutoConfiguration -com.google.cloud.spring.autoconfigure.spanner.health.SpannerHealthIndicatorAutoConfiguration +com.google.cloud.spring.autoconfigure.spanner.SpannerRepositoriesAutoConfiguration com.google.cloud.spring.autoconfigure.spanner.SpannerTransactionManagerAutoConfiguration -com.google.cloud.spring.autoconfigure.datastore.GcpDatastoreAutoConfiguration -com.google.cloud.spring.autoconfigure.firestore.GcpFirestoreAutoConfiguration -com.google.cloud.spring.autoconfigure.firestore.FirestoreTransactionManagerAutoConfiguration -com.google.cloud.spring.autoconfigure.firestore.GcpFirestoreEmulatorAutoConfiguration -com.google.cloud.spring.autoconfigure.datastore.health.DatastoreHealthIndicatorAutoConfiguration +com.google.cloud.spring.autoconfigure.spanner.health.SpannerHealthIndicatorAutoConfiguration com.google.cloud.spring.autoconfigure.storage.GcpStorageAutoConfiguration com.google.cloud.spring.autoconfigure.trace.StackdriverTraceAutoConfiguration com.google.cloud.spring.autoconfigure.trace.pubsub.TracePubSubAutoConfiguration -com.google.cloud.spring.autoconfigure.datastore.DatastoreRepositoriesAutoConfiguration -com.google.cloud.spring.autoconfigure.spanner.SpannerRepositoriesAutoConfiguration -com.google.cloud.spring.autoconfigure.security.IapAuthenticationAutoConfiguration -com.google.cloud.spring.autoconfigure.security.FirebaseAuthenticationAutoConfiguration com.google.cloud.spring.autoconfigure.vision.CloudVisionAutoConfiguration -com.google.cloud.spring.autoconfigure.datastore.GcpDatastoreEmulatorAutoConfiguration -com.google.cloud.spring.autoconfigure.bigquery.GcpBigQueryAutoConfiguration -com.google.cloud.spring.autoconfigure.datastore.DatastoreTransactionManagerAutoConfiguration -com.google.cloud.spring.autoconfigure.firestore.FirestoreRepositoriesAutoConfiguration -com.google.cloud.spring.autoconfigure.pubsub.health.PubSubSubscriptionHealthIndicatorAutoConfiguration -com.google.cloud.spring.autoconfigure.pubsub.health.PubSubHealthIndicatorAutoConfiguration -com.google.cloud.spring.autoconfigure.metrics.GcpStackdriverMetricsAutoConfiguration -com.google.cloud.spring.autoconfigure.kms.GcpKmsAutoConfiguration From e946ae6cee57a8c1c4229661f7b7d2b0cc105230 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sun, 11 Dec 2022 15:52:49 -0500 Subject: [PATCH 138/179] remove r2dbc-mysql starter and sample --- .../README.adoc | 50 ------------------ .../pom.xml | 47 ----------------- .../src/main/appengine/app.yaml | 5 -- .../main/java/com/example/SqlApplication.java | 49 ------------------ .../src/main/java/com/example/User.java | 50 ------------------ .../main/java/com/example/WebController.java | 41 --------------- .../src/main/resources/application.properties | 7 --- .../src/main/resources/cleanup.sql | 1 - .../src/main/resources/data.sql | 4 -- .../src/main/resources/schema.sql | 5 -- ...ySqlSampleApplicationIntegrationTests.java | 51 ------------------- .../.repo.metadata.json | 11 ---- .../pom.xml | 37 -------------- 13 files changed, 358 deletions(-) delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/README.adoc delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/pom.xml delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/appengine/app.yaml delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/java/com/example/SqlApplication.java delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/java/com/example/User.java delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/java/com/example/WebController.java delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/resources/application.properties delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/resources/cleanup.sql delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/resources/data.sql delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/resources/schema.sql delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/test/java/com/example/SqlR2dbcMySqlSampleApplicationIntegrationTests.java delete mode 100644 spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql-r2dbc/.repo.metadata.json delete mode 100644 spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql-r2dbc/pom.xml diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/README.adoc b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/README.adoc deleted file mode 100644 index e13ba7137b..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/README.adoc +++ /dev/null @@ -1,50 +0,0 @@ -= Spring Cloud GCP MySQL R2DBC Sample - -This code sample demonstrates how to connect to a MySQL Google Cloud SQL instance using the link:../../spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql-r2dbc[Spring Cloud GCP MySQL R2DBC Starter]. - -You will create an instance, a database within the instance, populate the database and then query it. - -== Setup - -image:http://gstatic.com/cloudssh/images/open-btn.svg[link=https://ssh.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2FGoogleCloudPlatform%2Fspring-cloud-gcp&cloudshell_open_in_editor=spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/README.adoc] - -1. Follow https://cloud.google.com/sql/docs/mysql/quickstart[these instructions] to set up a Google Cloud Project with billing enabled. - -2. Create a Google Cloud MySQL instance from the https://console.cloud.google.com/sql/instances[Google Cloud Console Cloud SQL page]. - -3. Still within the Google Cloud Console SQL page, create a new database in the instance from the "Databases" section. -If you decided to set a root password for your instance footnoteref:[note,Google Cloud SQL allows for creating MySQL instances without a password,while still remaining safe,as the connection is using Cloud SDK authentication and encrypted communication: see docs on https://cloud.google.com/sql/docs/mysql/sql-proxy[Cloud SQL proxy] and https://cloud.google.com/sql/docs/mysql/connect-external-app#java[the java socketFactory],which is used in spring-cloud-gcp to create the connection!], then don't forget to take note of your root password, as you will need it in the next step! - -4. Open the link:src/main/resources/application.properties[application.properties] file and replace the following: -- *[database-name]* with the name of the database you created in step 3. -- *[instance-connection-name]* with the instance name (in the format [GCP_PROJECT_ID]:[REGION]:[INSTANCE_NAME]) of the MySQL instance you created in step 1. -+ -If you would like to use a different user instead of the default (`root`), set the `spring.r2dbc.username` property appropriately. -+ -If you set a root password, add the `spring.r2dbc.password` property with the root password as the value. - -5. https://cloud.google.com/sdk/gcloud/reference/auth/application-default/login[If you are authenticated in the Cloud SDK], your credentials will be automatically found by the Spring Boot Starter for Google Cloud SQL. -+ -Alternatively, https://console.cloud.google.com/iam-admin/serviceaccounts[create a service account from the Google Cloud Console] and download its private key. -Then, uncomment the `spring.cloud.gcp.credentials.location` property in the link:src/main/resources/application.properties[application.properties] file and fill its value with the path to your service account private key on your local file system, prepended with `file:`. - -6. Run `$ mvn clean install` from the root directory of the project. - -== Running the application - -You can run the `SqlApplication` Spring Boot app by running the following command in the root directory of this sample app (spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-sample): - -`$ mvn spring-boot:run` - -The database will be populated based on the link:src/main/resources/schema.sql[schema.sql] and link:src/main/resources/data.sql[data.sql] files. - -When the application is up, navigate to http://localhost:8080/getTuples in your browser, or use the `Web Preview` -button in Cloud Shell to preview the app on port 8080. This will print the contents of the `users` table. - -== Deploy to App Engine Standard Environment - -If you have Cloud SDK installed, https://cloud.google.com/appengine/docs/standard/java11/testing-and-deploying-your-app[Maven App Engine Plug-in] can be used to deploy the application to App Engine Standard environment: - ----- -$ mvn clean package appengine:deploy -Dapp.deploy.projectId=$PROJECT_ID -Dapp.deploy.version=$VERSION ----- \ No newline at end of file diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/pom.xml deleted file mode 100644 index 3fcf6f6045..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - spring-cloud-gcp-samples - com.google.cloud - 3.5.0-SNAPSHOT - - 4.0.0 - - spring-cloud-gcp-sql-mysql-r2dbc-sample - Spring Cloud GCP Code Sample - R2DBC MySQL - - - - - - com.google.cloud - spring-cloud-gcp-dependencies - ${project.version} - pom - import - - - - - - - com.google.cloud - spring-cloud-gcp-starter-sql-mysql-r2dbc - - - org.springframework.boot - spring-boot-starter-webflux - - - - - org.springframework.boot - spring-boot-starter-test - test - - - - \ No newline at end of file diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/appengine/app.yaml b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/appengine/app.yaml deleted file mode 100644 index c6b97a33fd..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/appengine/app.yaml +++ /dev/null @@ -1,5 +0,0 @@ -runtime: java11 -instance_class: F1 - -env_variables: - JAVA_TOOL_OPTIONS: "-XX:MaxRAM=256m -XX:ActiveProcessorCount=2 -Xmx32m" \ No newline at end of file diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/java/com/example/SqlApplication.java b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/java/com/example/SqlApplication.java deleted file mode 100644 index c31ff1b21c..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/java/com/example/SqlApplication.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2021-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example; - -import io.r2dbc.spi.ConnectionFactory; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.core.io.ClassPathResource; -import org.springframework.r2dbc.connection.init.ConnectionFactoryInitializer; -import org.springframework.r2dbc.connection.init.ResourceDatabasePopulator; - -@SpringBootApplication -public class SqlApplication { - - public static void main(String[] args) { - SpringApplication.run(SqlApplication.class, args); - } - - /** - * Populates Cloud SQL database table with data from data.sql and deletes the table after the - * application finishes running. - */ - @Bean - ConnectionFactoryInitializer initializer(ConnectionFactory connectionFactory) { - ConnectionFactoryInitializer initializer = new ConnectionFactoryInitializer(); - initializer.setConnectionFactory(connectionFactory); - initializer.setDatabasePopulator( - new ResourceDatabasePopulator( - new ClassPathResource("schema.sql"), new ClassPathResource("data.sql"))); - initializer.setDatabaseCleaner( - new ResourceDatabasePopulator(new ClassPathResource("cleanup.sql"))); - return initializer; - } -} diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/java/com/example/User.java b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/java/com/example/User.java deleted file mode 100644 index a6c1e69c94..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/java/com/example/User.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2022-2023 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example; - -import org.springframework.data.relational.core.mapping.Table; - -@Table("users") -public class User { - - private String email; - private String firstName; - private String lastName; - - public User(String email, String firstName, String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - public String getEmail() { - return email; - } - - public String getFirstName() { - return firstName; - } - - public String getLastName() { - return lastName; - } - - @Override - public String toString() { - return "[" + email + ", " + firstName + ", " + lastName + "]"; - } -} diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/java/com/example/WebController.java b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/java/com/example/WebController.java deleted file mode 100644 index bc591cb1e1..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/java/com/example/WebController.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2021-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example; - -import org.springframework.data.r2dbc.core.R2dbcEntityTemplate; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; -import reactor.core.publisher.Flux; - -/** - * Web app controller class for sample application. Contains a function that runs a query and - * displays the results. - */ -@RestController -public class WebController { - - private final R2dbcEntityTemplate template; - - public WebController(R2dbcEntityTemplate template) { - this.template = template; - } - - @GetMapping("/getTuples") - public Flux getTuples() { - return template.select(User.class).all().map(user -> user.toString()); - } -} diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/resources/application.properties b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/resources/application.properties deleted file mode 100644 index 228247d649..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/resources/application.properties +++ /dev/null @@ -1,7 +0,0 @@ -spring.cloud.gcp.sql.database-name=[database-name] -# Must be formatted in the form: [gcp-project-id]:[region]:[instance-name] -spring.cloud.gcp.sql.instance-connection-name=[instance-connection-name] -# Leave empty for root, uncomment and fill out if you specified a user -# spring.r2dbc.username= -# Uncomment if root password is specified -# spring.r2dbc.password= diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/resources/cleanup.sql b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/resources/cleanup.sql deleted file mode 100644 index 365a210755..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/resources/cleanup.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE IF EXISTS users; \ No newline at end of file diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/resources/data.sql b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/resources/data.sql deleted file mode 100644 index ff9001a36f..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/resources/data.sql +++ /dev/null @@ -1,4 +0,0 @@ -INSERT INTO users VALUES - ('luisao@example.com', 'Anderson', 'Silva'), - ('jonas@example.com', 'Jonas', 'Goncalves'), - ('fejsa@example.com', 'Ljubomir', 'Fejsa'); diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/resources/schema.sql b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/resources/schema.sql deleted file mode 100644 index 1ac8ef2b4b..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/main/resources/schema.sql +++ /dev/null @@ -1,5 +0,0 @@ -CREATE TABLE users ( - email VARCHAR(255), - first_name VARCHAR(255), - last_name VARCHAR(255), - PRIMARY KEY (email)); diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/test/java/com/example/SqlR2dbcMySqlSampleApplicationIntegrationTests.java b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/test/java/com/example/SqlR2dbcMySqlSampleApplicationIntegrationTests.java deleted file mode 100644 index 0a291e6928..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/src/test/java/com/example/SqlR2dbcMySqlSampleApplicationIntegrationTests.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2021-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example; - -import static org.assertj.core.api.Assertions.assertThat; - -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.EnabledIfSystemProperty; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.core.ParameterizedTypeReference; -import org.springframework.http.HttpMethod; -import org.springframework.http.ResponseEntity; - -/** Simple integration test to verify the SQL sample application with MySQL. */ -@SpringBootTest( - webEnvironment = WebEnvironment.RANDOM_PORT, - classes = {SqlApplication.class}) -@EnabledIfSystemProperty(named = "it.cloudsql", matches = "true") -public class SqlR2dbcMySqlSampleApplicationIntegrationTests { - - @Autowired private TestRestTemplate testRestTemplate; - - @Test - void testSqlRowsAccess() { - ResponseEntity result = - this.testRestTemplate.exchange( - "/getTuples", HttpMethod.GET, null, new ParameterizedTypeReference() {}); - - assertThat(result.getBody()) - .isEqualTo( - "[fejsa@example.com, Ljubomir, Fejsa][jonas@example.com, Jonas," - + " Goncalves][luisao@example.com, Anderson, Silva]"); - } -} diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql-r2dbc/.repo.metadata.json b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql-r2dbc/.repo.metadata.json deleted file mode 100644 index 6d971eaed8..0000000000 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql-r2dbc/.repo.metadata.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "spring-cloud-gcp-starter-sql-mysql-r2dbc", - "name_pretty": "Spring Cloud GCP R2DBC Support for Cloud SQL - MySQL", - "client_documentation": "https://spring.io/projects/spring-cloud-gcp", - "api_description": "Provides support for MySQL databases in Google Cloud SQL using Spring R2DBC", - "release_level": "ga", - "language": "java", - "repo": "googlecloudplatform/spring-cloud-gcp", - "repo_short": "spring-cloud-gcp", - "distribution_name": "com.google.cloud:spring-cloud-gcp-starter-sql-mysql-r2dbc" -} diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql-r2dbc/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql-r2dbc/pom.xml deleted file mode 100644 index 831a810579..0000000000 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql-r2dbc/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - spring-cloud-gcp-starters - com.google.cloud - 3.5.0-SNAPSHOT - - 4.0.0 - - spring-cloud-gcp-starter-sql-mysql-r2dbc - Spring Cloud GCP Starter - R2DBC MySQL - https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/main/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql-r2dbc - - - - com.google.cloud - spring-cloud-gcp-starter - - - org.springframework.boot - spring-boot-starter-data-r2dbc - - - - - com.google.cloud.sql - cloud-sql-connector-r2dbc-mysql - - - dev.miku - r2dbc-mysql - - - - From 6e7a28d181c7782774c4bb332d3891fff28eb892 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sun, 11 Dec 2022 19:49:56 -0500 Subject: [PATCH 139/179] remove `ListenableFuture` in docs --- docs/src/main/asciidoc/bigquery.adoc | 10 ++--- docs/src/main/asciidoc/pubsub.adoc | 42 +++++++++++-------- .../asciidoc/spring-integration-pubsub.adoc | 16 +++---- docs/src/main/asciidoc/vision.adoc | 2 +- docs/src/main/md/bigquery.md | 10 ++--- docs/src/main/md/pubsub.md | 32 +++++++------- docs/src/main/md/spring-integration.md | 18 +++----- docs/src/main/md/vision.md | 8 ++-- .../README.adoc | 2 +- 9 files changed, 71 insertions(+), 69 deletions(-) diff --git a/docs/src/main/asciidoc/bigquery.adoc b/docs/src/main/asciidoc/bigquery.adoc index 353190f3b7..1dd5751864 100644 --- a/docs/src/main/asciidoc/bigquery.adoc +++ b/docs/src/main/asciidoc/bigquery.adoc @@ -84,7 +84,7 @@ Below is a code snippet of how to load a CSV data `InputStream` to a BigQuery ta BigQueryTemplate bigQueryTemplate; public void loadData(InputStream dataInputStream, String tableName) { - ListenableFuture bigQueryJobFuture = + CompletableFuture bigQueryJobFuture = bigQueryTemplate.writeDataToTable( tableName, dataFile.getInputStream(), @@ -111,7 +111,7 @@ BigQueryTemplate bigQueryTemplate; */ public void loadJsonStream(String tableName, InputStream jsonInputStream) throws ExecutionException, InterruptedException { - ListenableFuture writeApFuture = + CompletableFuture writeApFuture = bigQueryTemplate.writeJsonStream(tableName, jsonInputStream); WriteApiResponse apiRes = writeApFuture.get();//get the WriteApiResponse if (!apiRes.isSuccessful()){ @@ -139,7 +139,7 @@ BigQueryTemplate bigQueryTemplate; */ public void createTableAndloadJsonStream(String tableName, InputStream jsonInputStream, Schema tableSchema) throws ExecutionException, InterruptedException { - ListenableFuture writeApFuture = + CompletableFuture writeApFuture = bigQueryTemplate.writeJsonStream(tableName, jsonInputStream, tableSchema);//using the overloaded method which created the table when tableSchema is passed WriteApiResponse apiRes = writeApFuture.get();//get the WriteApiResponse if (!apiRes.isSuccessful()){ @@ -200,12 +200,12 @@ Alternatively, you may omit these headers and explicitly set the table name or f After the `BigQueryFileMessageHandler` processes a message to load data to your BigQuery table, it will respond with a `Job` on the reply channel. The https://googleapis.dev/java/google-cloud-clients/latest/index.html?com/google/cloud/bigquery/package-summary.html[Job object] provides metadata and information about the load file operation. -By default, the `BigQueryFileMessageHandler` is run in asynchronous mode, with `setSync(false)`, and it will reply with a `ListenableFuture` on the reply channel. +By default, the `BigQueryFileMessageHandler` is run in asynchronous mode, with `setSync(false)`, and it will reply with a `CompletableFuture` on the reply channel. The future is tied to the status of the data loading job and will complete when the job completes. If the handler is run in synchronous mode with `setSync(true)`, then the handler will block on the completion of the loading job and block until it is complete. -NOTE: If you decide to use Spring Integration Gateways and you wish to receive `ListenableFuture` as a reply object in the Gateway, you will have to call `.setAsyncExecutor(null)` on your `GatewayProxyFactoryBean`. +NOTE: If you decide to use Spring Integration Gateways and you wish to receive `CompletableFuture` as a reply object in the Gateway, you will have to call `.setAsyncExecutor(null)` on your `GatewayProxyFactoryBean`. This is needed to indicate that you wish to reply on the built-in async support rather than rely on async handling of the gateway. === Sample diff --git a/docs/src/main/asciidoc/pubsub.adoc b/docs/src/main/asciidoc/pubsub.adoc index 425d9346d9..1f66aba563 100644 --- a/docs/src/main/asciidoc/pubsub.adoc +++ b/docs/src/main/asciidoc/pubsub.adoc @@ -1,9 +1,10 @@ [#cloud-pubsub] == Cloud Pub/Sub +:project-root: ../../../.. Spring Cloud GCP provides an abstraction layer to publish to and subscribe from Google Cloud Pub/Sub topics and to create, list or delete Google Cloud Pub/Sub topics and subscriptions. -A Spring Boot starter is provided to auto-configure the various required Pub/Sub components. +A Spring Boot starter is provided to autoconfigure the various required Pub/Sub components. Maven coordinates, using <>: @@ -44,7 +45,7 @@ This section describes options for enabling the integration, specifying the GCP Google Cloud Pub/Sub API, if different from the ones in the <> | No | | `spring.cloud.gcp.pubsub.emulator-host` | The host and port of the local running emulator. -If provided, this will setup the client to connect against a running https://cloud.google.com/pubsub/docs/emulator[Google Cloud Pub/Sub Emulator]. | No | +If provided, this will set up the client to connect against a running https://cloud.google.com/pubsub/docs/emulator[Google Cloud Pub/Sub Emulator]. | No | | `spring.cloud.gcp.pubsub.credentials.encoded-key` | Base64-encoded contents of OAuth2 account private key for authenticating with the Google Cloud Pub/Sub API, if different from the ones in the <> | No | @@ -58,9 +59,9 @@ Pub/Sub credentials | No | https://www.googleapis.com/auth/pubsub This section describes configuration options to customize the behavior of the application's Pub/Sub publishers and subscribers. Subscriber settings can be either global or subscription-specific. -NOTE: A custom configuration (injected through a setter in `DefaultSubscriberFactory` or a custom bean) will take precedence over auto-configuration. +NOTE: A custom configuration (injected through a setter in `DefaultSubscriberFactory` or a custom bean) will take precedence over autoconfiguration. Hence, if one wishes to use per-subscription configuration for a Pub/Sub setting, there must not be a custom bean for that setting. -When using auto-configuration, if both global and per-subscription configurations are provided, then the per-subscription configuration will be used. +When using autoconfiguration, if both global and per-subscription configurations are provided, then the per-subscription configuration will be used. However, if a per-subscription configuration is not set then the global or default configuration will be used. |=== @@ -232,20 +233,22 @@ So, take care not to configure a subscription that has a business impact, or ins If you are using Spring Boot Actuator, you can take advantage of the Cloud Pub/Sub subscription health indicator called `pubsub-subscriber`. The subscription health indicator will verify whether Pub/Sub subscriptions are actively processing messages from the subscription's backlog. To enable it, you need to add the https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#production-ready[Spring Boot Actuator] to your project and the https://cloud.google.com/monitoring/docs/reference/libraries[GCP Monitoring]. -Also you need to set the following properties `spring.cloud.gcp.pubsub.health.lagThreshold`, `spring.cloud.gcp.pubsub.health.backlogThreshold`. +Also, you need to set the following properties `spring.cloud.gcp.pubsub.health.lagThreshold`, `spring.cloud.gcp.pubsub.health.backlogThreshold`. The `pubsub-subscriber` indicator will then roll up to the overall application status visible at http://localhost:8080/actuator/health (use the `management.endpoint.health.show-details` property to view per-indicator details). [source,xml] ---- - - org.springframework.boot - spring-boot-starter-actuator - - - com.google.cloud - google-cloud-monitoring - + + + org.springframework.boot + spring-boot-starter-actuator + + + com.google.cloud + google-cloud-monitoring + + ---- The health indicator validates a subscriber's health by checking the subscription's message backlog and the last processed message. @@ -255,7 +258,7 @@ If a message has been recently processed in a reasonable time threshold, then th If the backlog of messages for a subscription is big but the subscriber consumes messages then subscriber is still healthy. If there hasn't been any processing of recent messages but the backlog increases, then the subscriber is unhealthy. -NOTE: The health indicator will not behave entirely as expected if Dead Letter Queueing is enabled on the subscription being checked, num_undelivered_messages will drop down by itself after DLQ threshold is reached. +NOTE: The health indicator will not behave entirely as expected if Dead Letter Queueing is enabled on the subscription being checked, num_undelivered_messages will drop by itself after DLQ threshold is reached. |=== | Name | Description | Required | Default value @@ -373,7 +376,7 @@ Using these methods for acknowledging messages in batches is more efficient than . To acknowledge messages individually you can use the `ack()` or `nack()` method on each of them (to acknowledge or negatively acknowledge, correspondingly). -NOTE: All `ack()`, `nack()`, and `modifyAckDeadline()` methods on messages, as well as `PubSubSubscriberTemplate`, are implemented asynchronously, returning a `ListenableFuture` to enable asynchronous processing. +NOTE: All `ack()`, `nack()`, and `modifyAckDeadline()` methods on messages, as well as `PubSubSubscriberTemplate`, are implemented asynchronously, returning a `CompletableFuture` to enable asynchronous processing. ===== Dead Letter Topics @@ -399,7 +402,7 @@ public Subscription newSubscription() { } ---- -Dead letter topics are no different than any other topic, though some https://cloud.google.com/pubsub/docs/dead-letter-topics#granting_forwarding_permissions[additional permissions] are necessary to ensure the Cloud Pub/Sub service can successfully `ack` the original message and re-`publish` it on the dead letter topic. +Dead letter topics are no different from any other topic, though some https://cloud.google.com/pubsub/docs/dead-letter-topics#granting_forwarding_permissions[additional permissions] are necessary to ensure the Cloud Pub/Sub service can successfully `ack` the original message and re-`publish` on the dead letter topic. ==== JSON support @@ -427,7 +430,7 @@ You can serialize objects to JSON on publish automatically: include::{project-root}/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubTemplateDocumentationIntegrationTests.java[tag=json_publish] ---- -And that's how you convert messages to objects on pull: +And that's how you convert messages to object on pull: [source,java,indent=0] ---- include::{project-root}/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/pubsub/it/PubSubTemplateDocumentationIntegrationTests.java[tag=json_pull] @@ -483,7 +486,7 @@ It allows for the creation, deletion and listing of topics and subscriptions. NOTE: Generally when referring to topics and subscriptions, you can either use the short canonical name within the current project, or the fully-qualified name referring to a topic or subscription in a different project using the `projects/[project_name]/(topics|subscriptions)/` format. -The Spring Boot starter for GCP Pub/Sub auto-configures a `PubSubAdmin` object using the `GcpProjectIdProvider` and the `CredentialsProvider` auto-configured by the Spring Boot GCP Core starter. +The Spring Boot starter for GCP Pub/Sub autoconfigures a `PubSubAdmin` object using the `GcpProjectIdProvider` and the `CredentialsProvider` autoconfigured by the Spring Boot GCP Core starter. ==== Creating a topic @@ -547,6 +550,9 @@ public Subscription createSubscription(String subscriptionName, String topicName public Subscription createSubscription(String subscriptionName, String topicName, Integer ackDeadline) +public Subscription createSubscription( + String subscriptionName, String topicName, String pushEndpoint) + public Subscription createSubscription(String subscriptionName, String topicName, Integer ackDeadline, String pushEndpoint) public Subscription createSubscription(Subscriber.Builder builder) diff --git a/docs/src/main/asciidoc/spring-integration-pubsub.adoc b/docs/src/main/asciidoc/spring-integration-pubsub.adoc index bbf61816ff..a389f251f9 100644 --- a/docs/src/main/asciidoc/spring-integration-pubsub.adoc +++ b/docs/src/main/asciidoc/spring-integration-pubsub.adoc @@ -1,7 +1,8 @@ === Channel Adapters for Cloud Pub/Sub +:project-root: ../../../.. The channel adapters for Google Cloud Pub/Sub connect your Spring https://docs.spring.io/spring-integration/reference/html/channel.html[`MessageChannels`] to Google Cloud Pub/Sub topics and subscriptions. -This enables messaging between different processes, applications or micro-services backed up by Google Cloud Pub/Sub. +This enables messaging between different processes, applications or microservices backed up by Google Cloud Pub/Sub. The Spring Integration Channel Adapters for Google Cloud Pub/Sub are included in the `spring-cloud-gcp-pubsub` module and can be autoconfigured by using the `spring-cloud-gcp-starter-pubsub` module in combination with a Spring Integration dependency. @@ -9,14 +10,16 @@ Maven coordinates, using < + + com.google.cloud spring-cloud-gcp-starter-pubsub - - + + org.springframework.integration spring-integration-core - + + ---- Gradle coordinates: @@ -169,7 +172,7 @@ public void pubsubErrorHandler(Message message) { } ---- -If you would prefer to manually ack or nack the message, you can do it by retrieving the header of the exception payload: +If you preferred to manually ack or nack the message, you can do it by retrieving the header of the exception payload: [source,java] ---- @@ -271,7 +274,6 @@ If none is provided, the adapter waits indefinitely for a response. It is possible to set user-defined callbacks for the `publish()` call in `PubSubMessageHandler` through the `setSuccessCallback()` and `setFailureCallback()` methods (either one or both may be set). These give access to the Pub/Sub publish message ID in case of success, or the root cause exception in case of error. Both callbacks include the original message as the second argument. -The old `setPublishCallback()` method that only gave access to message ID or root cause exception is deprecated and will be removed in a future release. [source,java,indent=0] ---- diff --git a/docs/src/main/asciidoc/vision.adoc b/docs/src/main/asciidoc/vision.adoc index e8abdef8f3..ac9cb60d27 100644 --- a/docs/src/main/asciidoc/vision.adoc +++ b/docs/src/main/asciidoc/vision.adoc @@ -194,7 +194,7 @@ The method allows you to specify the location of the document and the output loc It returns a `CompletableFuture` containing `DocumentOcrResultSet` which contains the OCR content of the document. NOTE: Running OCR on a document is an operation that can take between several minutes to several hours depending on how large the document is. -It is recommended to register callbacks to the returned ListenableFuture or ignore it and process the JSON output files at a later point in time using `readOcrOutputFile` or `readOcrOutputFileSet`. +It is recommended to register callbacks to the returned CompletableFuture or ignore it and process the JSON output files at a later point in time using `readOcrOutputFile` or `readOcrOutputFileSet`. ==== Running OCR Example diff --git a/docs/src/main/md/bigquery.md b/docs/src/main/md/bigquery.md index e6932635fd..9cda1c4261 100644 --- a/docs/src/main/md/bigquery.md +++ b/docs/src/main/md/bigquery.md @@ -92,7 +92,7 @@ BigQuery table. BigQueryTemplate bigQueryTemplate; public void loadData(InputStream dataInputStream, String tableName) { - ListenableFuture bigQueryJobFuture = + CompletableFuture bigQueryJobFuture = bigQueryTemplate.writeDataToTable( tableName, dataFile.getInputStream(), @@ -118,7 +118,7 @@ BigQueryTemplate bigQueryTemplate; */ public void loadJsonStream(String tableName, InputStream jsonInputStream) throws ExecutionException, InterruptedException { - ListenableFuture writeApFuture = + CompletableFuture writeApFuture = bigQueryTemplate.writeJsonStream(tableName, jsonInputStream); WriteApiResponse apiRes = writeApFuture.get();//get the WriteApiResponse if (!apiRes.isSuccessful()){ @@ -144,7 +144,7 @@ BigQueryTemplate bigQueryTemplate; */ public void createTableAndloadJsonStream(String tableName, InputStream jsonInputStream, Schema tableSchema) throws ExecutionException, InterruptedException { - ListenableFuture writeApFuture = + CompletableFuture writeApFuture = bigQueryTemplate.writeJsonStream(tableName, jsonInputStream, tableSchema);//using the overloaded method which created the table when tableSchema is passed WriteApiResponse apiRes = writeApFuture.get();//get the WriteApiResponse if (!apiRes.isSuccessful()){ @@ -218,7 +218,7 @@ provides metadata and information about the load file operation. By default, the `BigQueryFileMessageHandler` is run in asynchronous mode, with `setSync(false)`, and it will reply with a -`ListenableFuture` on the reply channel. The future is tied to the +`CompletableFuture` on the reply channel. The future is tied to the status of the data loading job and will complete when the job completes. If the handler is run in synchronous mode with `setSync(true)`, then the @@ -228,7 +228,7 @@ it is complete.
If you decide to use Spring Integration Gateways and you wish to receive -`ListenableFuture` as a reply object in the Gateway, you will have +`CompletableFuture` as a reply object in the Gateway, you will have to call `.setAsyncExecutor(null)` on your `GatewayProxyFactoryBean`. This is needed to indicate that you wish to reply on the built-in async support rather than rely on async handling of the gateway. diff --git a/docs/src/main/md/pubsub.md b/docs/src/main/md/pubsub.md index 942e591c2f..69cb185a8e 100644 --- a/docs/src/main/md/pubsub.md +++ b/docs/src/main/md/pubsub.md @@ -4,7 +4,7 @@ Spring Cloud GCP provides an abstraction layer to publish to and subscribe from Google Cloud Pub/Sub topics and to create, list or delete Google Cloud Pub/Sub topics and subscriptions. -A Spring Boot starter is provided to auto-configure the various required +A Spring Boot starter is provided to autoconfigure the various required Pub/Sub components. Maven coordinates, using [Spring Cloud GCP @@ -57,9 +57,9 @@ settings can be either global or subscription-specific. A custom configuration (injected through a setter in `DefaultSubscriberFactory` or a custom bean) will take precedence over -auto-configuration. Hence, if one wishes to use per-subscription +autoconfiguration. Hence, if one wishes to use per-subscription configuration for a Pub/Sub setting, there must not be a custom bean for -that setting. When using auto-configuration, if both global and +that setting. When using autoconfiguration, if both global and per-subscription configurations are provided, then the per-subscription configuration will be used. However, if a per-subscription configuration is not set then the global or default configuration will be used. @@ -235,7 +235,7 @@ backlog. To enable it, you need to add the [Spring Boot Actuator](https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#production-ready) to your project and the [GCP Monitoring](https://cloud.google.com/monitoring/docs/reference/libraries). -Also you need to set the following properties +Also, you need to set the following properties `spring.cloud.gcp.pubsub.health.lagThreshold`, `spring.cloud.gcp.pubsub.health.backlogThreshold`. @@ -271,7 +271,7 @@ but the backlog increases, then the subscriber is unhealthy. The health indicator will not behave entirely as expected if Dead Letter Queueing is enabled on the subscription being checked, -num\_undelivered\_messages will drop down by itself after DLQ threshold +num\_undelivered\_messages will drop by itself after DLQ threshold is reached.
@@ -457,7 +457,7 @@ There are two ways to acknowledge messages. All `ack()`, `nack()`, and `modifyAckDeadline()` methods on messages, as well as `PubSubSubscriberTemplate`, are implemented asynchronously, -returning a `ListenableFuture` to enable asynchronous processing. +returning a `CompletableFuture` to enable asynchronous processing. @@ -487,11 +487,11 @@ public Subscription newSubscription() { } ``` -Dead letter topics are no different than any other topic, though some +Dead letter topics are no different from any other topic, though some [additional permissions](https://cloud.google.com/pubsub/docs/dead-letter-topics#granting_forwarding_permissions) are necessary to ensure the Cloud Pub/Sub service can successfully `ack` -the original message and re-`publish` it on the dead letter topic. +the original message and re-`publish` on the dead letter topic. #### JSON support @@ -554,7 +554,7 @@ user.setPassword("password"); pubSubTemplate.publish(topicName, user); ``` -And that’s how you convert messages to objects on pull: +And that’s how you convert messages to object on pull: ``` java int maxMessages = 1; @@ -637,9 +637,9 @@ project using the -The Spring Boot starter for GCP Pub/Sub auto-configures a `PubSubAdmin` +The Spring Boot starter for GCP Pub/Sub autoconfigures a `PubSubAdmin` object using the `GcpProjectIdProvider` and the `CredentialsProvider` -auto-configured by the Spring Boot GCP Core starter. +autoconfigured by the Spring Boot GCP Core starter. #### Creating a topic @@ -686,7 +686,7 @@ in a project: ``` java List topics = - pubSubAdmin.listTopics().stream().map(Topic::getName).collect(Collectors.toList()); + pubSubAdmin.listTopics().stream().map(Topic::getName).toList(); ``` #### Creating a subscription @@ -699,6 +699,8 @@ public Subscription createSubscription(String subscriptionName, String topicName public Subscription createSubscription(String subscriptionName, String topicName, Integer ackDeadline) +public Subscription createSubscription(String subscriptionName, String topicName, String pushEndpoint) + public Subscription createSubscription(String subscriptionName, String topicName, Integer ackDeadline, String pushEndpoint) public Subscription createSubscription(Subscriber.Builder builder) @@ -745,9 +747,9 @@ Here is an example of how to list every subscription name in a project: ``` java List subscriptions = - pubSubAdmin.listSubscriptions().stream() - .map(Subscription::getName) - .collect(Collectors.toList()); + pubSubAdmin.listSubscriptions().stream() + .map(Subscription::getName) + .toList(); ``` ### Sample diff --git a/docs/src/main/md/spring-integration.md b/docs/src/main/md/spring-integration.md index 3593cc773b..29759c2116 100644 --- a/docs/src/main/md/spring-integration.md +++ b/docs/src/main/md/spring-integration.md @@ -9,7 +9,7 @@ Cloud Platform services. The channel adapters for Google Cloud Pub/Sub connect your Spring [`MessageChannels`](https://docs.spring.io/spring-integration/reference/html/channel.html) to Google Cloud Pub/Sub topics and subscriptions. This enables messaging -between different processes, applications or micro-services backed up by +between different processes, applications or microservices backed up by Google Cloud Pub/Sub. The Spring Integration Channel Adapters for Google Cloud Pub/Sub are @@ -206,7 +206,7 @@ public void pubsubErrorHandler(Message message) { } ``` -If you would prefer to manually ack or nack the message, you can do it +If you preferred to manually ack or nack the message, you can do it by retrieving the header of the exception payload: ``` java @@ -334,19 +334,11 @@ It is possible to set user-defined callbacks for the `publish()` call in `setFailureCallback()` methods (either one or both may be set). These give access to the Pub/Sub publish message ID in case of success, or the root cause exception in case of error. Both callbacks include the -original message as the second argument. The old `setPublishCallback()` -method that only gave access to message ID or root cause exception is -deprecated and will be removed in a future release. +original message as the second argument. ``` java -adapter.setPublishCallback( - new ListenableFutureCallback() { - @Override - public void onFailure(Throwable ex) {} - - @Override - public void onSuccess(String result) {} - }); +adapter.setSuccessCallback((ackId, message) -> {}); +adapter.setFailureCallback((cause, message) -> {}); ``` To override the default topic you can use the `GcpPubSubHeaders.TOPIC` diff --git a/docs/src/main/md/vision.md b/docs/src/main/md/vision.md index cc0cc15db0..76469571de 100644 --- a/docs/src/main/md/vision.md +++ b/docs/src/main/md/vision.md @@ -251,20 +251,20 @@ the document. The `DocumentOcrTemplate` provides the following method for running OCR on a document saved in Google Cloud Storage: -`ListenableFuture +`CompletableFuture runOcrForDocument(GoogleStorageLocation document, GoogleStorageLocation outputFilePathPrefix)` The method allows you to specify the location of the document and the output location for where all the JSON output files will be saved in -Google Cloud Storage. It returns a `ListenableFuture` containing +Google Cloud Storage. It returns a `CompletableFuture` containing `DocumentOcrResultSet` which contains the OCR content of the document.
Running OCR on a document is an operation that can take between several minutes to several hours depending on how large the document is. It is -recommended to register callbacks to the returned ListenableFuture or +recommended to register callbacks to the returned CompletableFuture or ignore it and process the JSON output files at a later point in time using `readOcrOutputFile` or `readOcrOutputFileSet`. @@ -285,7 +285,7 @@ document. GoogleStorageLocation outputLocationPrefix = GoogleStorageLocation.forFolder( "your-bucket", "output_folder/test.pdf/"); - ListenableFuture result = + CompletableFuture result = this.documentOcrTemplate.runOcrForDocument( document, outputLocationPrefix); diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-vision-ocr-demo/README.adoc b/spring-cloud-gcp-samples/spring-cloud-gcp-vision-ocr-demo/README.adoc index a8e55b1d0a..08001e5c66 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-vision-ocr-demo/README.adoc +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-vision-ocr-demo/README.adoc @@ -32,7 +32,7 @@ public ModelAndView submitDocument(@RequestParam("documentUrl") String documentU GoogleStorageLocation outputLocation = GoogleStorageLocation.forFolder( outputBlobId.getBucket(), "ocr_results/" + documentLocation.getBlobName()); - ListenableFuture result = + CompletableFuture result = documentOcrTemplate.runOcrForDocument(documentLocation, outputLocation); ocrStatusReporter.registerFuture(documentLocation.uriString(), result); From 6e41589013cf710fab02a8307ce4bbf52bb98889 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sun, 11 Dec 2022 20:19:55 -0500 Subject: [PATCH 140/179] remove `ListenableFuture` in comments --- .../bigquery/core/BigQueryOperations.java | 2 +- .../bigquery/core/BigQueryTemplate.java | 2 +- .../PubSubSubscriberOperations.java | 14 ++--- .../subscriber/PubSubSubscriberTemplate.java | 26 +++++----- .../support/AcknowledgeablePubsubMessage.java | 2 +- .../BasicAcknowledgeablePubsubMessage.java | 4 +- .../PubSubSubscriberTemplateTests.java | 52 +++++++++---------- .../example/BigQuerySampleConfiguration.java | 2 +- 8 files changed, 52 insertions(+), 52 deletions(-) diff --git a/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryOperations.java b/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryOperations.java index 8f2e059227..5b1c1d7af9 100644 --- a/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryOperations.java +++ b/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryOperations.java @@ -53,7 +53,7 @@ CompletableFuture writeDataToTable( * Field.of("County", StandardSQLTypeName.STRING) * ); * - * ListenableFuture bigQueryJobFuture = + * CompletableFuture bigQueryJobFuture = * bigQueryTemplate.writeDataToTable( * TABLE_NAME, dataFile.getInputStream(), FormatOptions.csv(), schema); * } diff --git a/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryTemplate.java b/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryTemplate.java index 57dbe7563d..fe685ba460 100644 --- a/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryTemplate.java +++ b/spring-cloud-gcp-bigquery/src/main/java/com/google/cloud/spring/bigquery/core/BigQueryTemplate.java @@ -386,7 +386,7 @@ public int getJsonWriterBatchSize() { } private CompletableFuture createJobFuture(Job pendingJob) { - // Prepare the polling task for the ListenableFuture result returned to end-user + // Prepare the polling task for the CompletableFuture result returned to end-user CompletableFuture result = new CompletableFuture<>(); ScheduledFuture scheduledFuture = taskScheduler.scheduleAtFixedRate( diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberOperations.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberOperations.java index 9872896d11..b0200b2ff0 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberOperations.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberOperations.java @@ -97,7 +97,7 @@ List pullAndAck( * @param returnImmediately returns immediately even if subscription doesn't contain enough * messages to satisfy {@code maxMessages}. Setting this parameter to {@code true} is not * recommended as it may result in long delays in message delivery. - * @return the ListenableFuture for the asynchronous execution, returning the list of received + * @return the CompletableFuture for the asynchronous execution, returning the list of received * acknowledgeable messages * @since 1.2.3 */ @@ -131,7 +131,7 @@ List pull( * @param returnImmediately returns immediately even if subscription doesn't contain enough * messages to satisfy {@code maxMessages}. Setting this parameter to {@code true} is not * recommended as it may result in long delays in message delivery. - * @return the ListenableFuture for the asynchronous execution, returning the list of received + * @return the CompletableFuture for the asynchronous execution, returning the list of received * acknowledgeable messages * @since 1.2.3 */ @@ -172,7 +172,7 @@ List> pullAndConvert( * recommended as it may result in long delays in message delivery. * @param payloadType the type to which the payload of the Pub/Sub messages should be converted * @param the type of the payload - * @return the ListenableFuture for the asynchronous execution, returning the list of received + * @return the CompletableFuture for the asynchronous execution, returning the list of received * acknowledgeable messages * @since 1.2.3 */ @@ -195,7 +195,7 @@ CompletableFuture>> pullAndCon * @param subscription short subscription name, e.g., "subscriptionName", or the * fully-qualified subscription name in the {@code * projects/[project_name]/subscriptions/[subscription_name]} format - * @return the ListenableFuture for the asynchronous execution, returning a received message, or + * @return the CompletableFuture for the asynchronous execution, returning a received message, or * {@code null} if none exists in the subscription * @since 1.2.3 */ @@ -205,7 +205,7 @@ CompletableFuture>> pullAndCon * Acknowledge a batch of messages. The messages must have the same project id. * * @param acknowledgeablePubsubMessages messages to be acknowledged - * @return {@code ListenableFuture} the ListenableFuture for the asynchronous execution + * @return {@code CompletableFuture} the CompletableFuture for the asynchronous execution */ CompletableFuture ack( Collection acknowledgeablePubsubMessages); @@ -214,7 +214,7 @@ CompletableFuture ack( * Negatively acknowledge a batch of messages. The messages must have the same project id. * * @param acknowledgeablePubsubMessages messages to be negatively acknowledged - * @return {@code ListenableFuture} the ListenableFuture for the asynchronous execution + * @return {@code CompletableFuture} the CompletableFuture for the asynchronous execution */ CompletableFuture nack( Collection acknowledgeablePubsubMessages); @@ -225,7 +225,7 @@ CompletableFuture nack( * @param acknowledgeablePubsubMessages messages to be modified * @param ackDeadlineSeconds the new ack deadline in seconds. A deadline of 0 effectively nacks * the messages. - * @return {@code ListenableFuture} the ListenableFuture for the asynchronous execution + * @return {@code CompletableFuture} the CompletableFuture for the asynchronous execution * @since 1.1 */ CompletableFuture modifyAckDeadline( diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplate.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplate.java index adc224be61..29b3e40566 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplate.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplate.java @@ -199,7 +199,7 @@ private List pull(PullRequest pullRequest) { * Pulls messages asynchronously, on demand, using the pull request in argument. * * @param pullRequest pull request containing the subscription name - * @return the ListenableFuture for the asynchronous execution, returning the list of {@link + * @return the CompletableFuture for the asynchronous execution, returning the list of {@link * AcknowledgeablePubsubMessage} containing the ack ID, subscription and acknowledger */ private CompletableFuture> pullAsync(PullRequest pullRequest) { @@ -495,7 +495,7 @@ private CompletableFuture doBatchedAsyncOperation( == 1, "The project id of all messages must match."); - CompletableFuture settableListenableFuture = new CompletableFuture<>(); + CompletableFuture completableFuture = new CompletableFuture<>(); int numExpectedFutures = groupedMessages.size(); AtomicInteger numCompletedFutures = new AtomicInteger(); @@ -518,16 +518,16 @@ public void onSuccess(Empty empty) { private void processResult(Throwable throwable) { if (throwable != null) { - settableListenableFuture.completeExceptionally(throwable); + completableFuture.completeExceptionally(throwable); } else if (numCompletedFutures.incrementAndGet() == numExpectedFutures) { - settableListenableFuture.complete(null); + completableFuture.complete(null); } } }, this.ackExecutor); }); - return settableListenableFuture; + return completableFuture; } private SubscriberStub getSubscriberStub(String subscription) { @@ -627,30 +627,30 @@ private static class PushedAcknowledgeablePubsubMessage @Override public CompletableFuture ack() { - CompletableFuture settableListenableFuture = new CompletableFuture<>(); + CompletableFuture completableFuture = new CompletableFuture<>(); try { this.ackReplyConsumer.ack(); - settableListenableFuture.complete(null); + completableFuture.complete(null); } catch (Exception e) { - settableListenableFuture.completeExceptionally(e); + completableFuture.completeExceptionally(e); } - return settableListenableFuture; + return completableFuture; } @Override public CompletableFuture nack() { - CompletableFuture settableListenableFuture = new CompletableFuture<>(); + CompletableFuture completableFuture = new CompletableFuture<>(); try { this.ackReplyConsumer.nack(); - settableListenableFuture.complete(null); + completableFuture.complete(null); } catch (Exception e) { - settableListenableFuture.completeExceptionally(e); + completableFuture.completeExceptionally(e); } - return settableListenableFuture; + return completableFuture; } @Override diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/AcknowledgeablePubsubMessage.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/AcknowledgeablePubsubMessage.java index 9a93730477..4e72ce416b 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/AcknowledgeablePubsubMessage.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/AcknowledgeablePubsubMessage.java @@ -39,7 +39,7 @@ public interface AcknowledgeablePubsubMessage extends BasicAcknowledgeablePubsub * * @param ackDeadlineSeconds the new ack deadline in seconds. A deadline of 0 effectively nacks * the message. - * @return {@code ListenableFuture} + * @return {@code CompletableFuture} * @since 1.1 */ CompletableFuture modifyAckDeadline(int ackDeadlineSeconds); diff --git a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/BasicAcknowledgeablePubsubMessage.java b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/BasicAcknowledgeablePubsubMessage.java index ce732f60c3..393afabaaf 100644 --- a/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/BasicAcknowledgeablePubsubMessage.java +++ b/spring-cloud-gcp-pubsub/src/main/java/com/google/cloud/spring/pubsub/support/BasicAcknowledgeablePubsubMessage.java @@ -44,14 +44,14 @@ public interface BasicAcknowledgeablePubsubMessage { /** * Acknowledge (ack) the message asynchronously. * - * @return {@code ListenableFuture}} + * @return {@code CompletableFuture}} */ CompletableFuture ack(); /** * Negatatively achnowledge (nack) the message asynchronously. * - * @return {@code ListenableFuture}} + * @return {@code CompletableFuture}} */ CompletableFuture nack(); } diff --git a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplateTests.java b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplateTests.java index 1f96330b67..1f741fffa7 100644 --- a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplateTests.java +++ b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/core/subscriber/PubSubSubscriberTemplateTests.java @@ -206,20 +206,20 @@ void testSubscribe_AndManualAck() verify(this.subscriber).startAsync(); verify(this.consumer).accept(this.message.capture()); - TestListenableFutureCallback testListenableFutureCallback = new TestListenableFutureCallback(); + TestCompletableFutureCallback completableFutureCallback = new TestCompletableFutureCallback(); CompletableFuture completableFuture = this.message.getValue().ack(); assertThat(completableFuture).isNotNull(); - completableFuture.whenComplete(testListenableFutureCallback); + completableFuture.whenComplete(completableFutureCallback); completableFuture.get(10L, TimeUnit.SECONDS); assertThat(completableFuture.isDone()).isTrue(); verify(this.ackReplyConsumer).ack(); - assertThat(testListenableFutureCallback.getThrowable()).isNull(); + assertThat(completableFutureCallback.getThrowable()).isNull(); } @Test @@ -230,20 +230,20 @@ void testSubscribe_AndManualNack() verify(this.subscriber).startAsync(); verify(this.consumer).accept(this.message.capture()); - TestListenableFutureCallback testListenableFutureCallback = new TestListenableFutureCallback(); + TestCompletableFutureCallback completableFutureCallback = new TestCompletableFutureCallback(); CompletableFuture completableFuture = this.message.getValue().nack(); assertThat(completableFuture).isNotNull(); - completableFuture.whenComplete(testListenableFutureCallback); + completableFuture.whenComplete(completableFutureCallback); completableFuture.get(10L, TimeUnit.SECONDS); assertThat(completableFuture.isDone()).isTrue(); verify(this.ackReplyConsumer).nack(); - assertThat(testListenableFutureCallback.getThrowable()).isNull(); + assertThat(completableFutureCallback.getThrowable()).isNull(); } @Test @@ -262,20 +262,20 @@ void testSubscribeAndConvert_AndManualAck() assertThat(this.convertedMessage.getValue().getProjectSubscriptionName().getSubscription()) .isEqualTo("sub1"); - TestListenableFutureCallback testListenableFutureCallback = new TestListenableFutureCallback(); + TestCompletableFutureCallback completableFutureCallback = new TestCompletableFutureCallback(); CompletableFuture completableFuture = this.convertedMessage.getValue().ack(); assertThat(completableFuture).isNotNull(); - completableFuture.whenComplete(testListenableFutureCallback); + completableFuture.whenComplete(completableFutureCallback); completableFuture.get(10L, TimeUnit.SECONDS); assertThat(completableFuture.isDone()).isTrue(); verify(this.ackReplyConsumer).ack(); - assertThat(testListenableFutureCallback.getThrowable()).isNull(); + assertThat(completableFutureCallback.getThrowable()).isNull(); } @Test @@ -294,20 +294,20 @@ void testSubscribeAndConvert_AndManualNack() assertThat(this.convertedMessage.getValue().getProjectSubscriptionName().getSubscription()) .isEqualTo("sub1"); - TestListenableFutureCallback testListenableFutureCallback = new TestListenableFutureCallback(); + TestCompletableFutureCallback completableFutureCallback = new TestCompletableFutureCallback(); CompletableFuture completableFuture = this.convertedMessage.getValue().nack(); assertThat(completableFuture).isNotNull(); - completableFuture.whenComplete(testListenableFutureCallback); + completableFuture.whenComplete(completableFutureCallback); completableFuture.get(10L, TimeUnit.SECONDS); assertThat(completableFuture.isDone()).isTrue(); verify(this.ackReplyConsumer).nack(); - assertThat(testListenableFutureCallback.getThrowable()).isNull(); + assertThat(completableFutureCallback.getThrowable()).isNull(); } @Test @@ -338,18 +338,18 @@ void testPull_AndManualAck() AcknowledgeablePubsubMessage acknowledgeablePubsubMessage = result.get(0); assertThat(acknowledgeablePubsubMessage.getAckId()).isNotNull(); - TestListenableFutureCallback testListenableFutureCallback = new TestListenableFutureCallback(); + TestCompletableFutureCallback completableFutureCallback = new TestCompletableFutureCallback(); CompletableFuture completableFuture = this.pubSubSubscriberTemplate.ack(result); assertThat(completableFuture).isNotNull(); - completableFuture.whenComplete(testListenableFutureCallback); + completableFuture.whenComplete(completableFutureCallback); completableFuture.get(10L, TimeUnit.SECONDS); assertThat(completableFuture.isDone()).isTrue(); - assertThat(testListenableFutureCallback.getThrowable()).isNull(); + assertThat(completableFutureCallback.getThrowable()).isNull(); } @Test @@ -365,18 +365,18 @@ void testPull_AndManualNack() AcknowledgeablePubsubMessage acknowledgeablePubsubMessage = result.get(0); assertThat(acknowledgeablePubsubMessage.getAckId()).isNotNull(); - TestListenableFutureCallback testListenableFutureCallback = new TestListenableFutureCallback(); + TestCompletableFutureCallback completableFutureCallback = new TestCompletableFutureCallback(); CompletableFuture completableFuture = this.pubSubSubscriberTemplate.nack(result); assertThat(completableFuture).isNotNull(); - completableFuture.whenComplete(testListenableFutureCallback); + completableFuture.whenComplete(completableFutureCallback); completableFuture.get(10L, TimeUnit.SECONDS); assertThat(completableFuture.isDone()).isTrue(); - assertThat(testListenableFutureCallback.getThrowable()).isNull(); + assertThat(completableFutureCallback.getThrowable()).isNull(); } @Test @@ -394,16 +394,16 @@ void testPull_AndManualMultiSubscriptionAck() assertThat(combinedMessages).hasSize(2); - TestListenableFutureCallback testListenableFutureCallback = new TestListenableFutureCallback(); + TestCompletableFutureCallback completableFutureCallback = new TestCompletableFutureCallback(); CompletableFuture completableFuture = this.pubSubSubscriberTemplate.ack(combinedMessages); assertThat(completableFuture).isNotNull(); - completableFuture.whenComplete(testListenableFutureCallback); + completableFuture.whenComplete(completableFutureCallback); completableFuture.get(10L, TimeUnit.SECONDS); assertThat(completableFuture.isDone()).isTrue(); - assertThat(testListenableFutureCallback.getThrowable()).isNull(); + assertThat(completableFutureCallback.getThrowable()).isNull(); verify(this.ackCallable, times(2)).futureCall(any(AcknowledgeRequest.class)); verify(this.ackApiFuture, times(2)).addListener(any(), same(mockExecutor)); } @@ -427,19 +427,19 @@ void testPullAsync_AndManualAck() AcknowledgeablePubsubMessage acknowledgeablePubsubMessage = result.get(0); assertThat(acknowledgeablePubsubMessage.getAckId()).isNotNull(); - TestListenableFutureCallback ackTestListenableFutureCallback = - new TestListenableFutureCallback(); + TestCompletableFutureCallback completableFutureCallback = + new TestCompletableFutureCallback(); CompletableFuture completableFuture = this.pubSubSubscriberTemplate.ack(result); assertThat(completableFuture).isNotNull(); - completableFuture.whenComplete(ackTestListenableFutureCallback); + completableFuture.whenComplete(completableFutureCallback); completableFuture.get(10L, TimeUnit.SECONDS); assertThat(completableFuture.isDone()).isTrue(); - assertThat(ackTestListenableFutureCallback.getThrowable()).isNull(); + assertThat(completableFutureCallback.getThrowable()).isNull(); } @Test @@ -586,7 +586,7 @@ void testPullNextAsync_NoMessages() verify(this.pubSubSubscriberTemplate, never()).ack(any()); } - private static class TestListenableFutureCallback implements BiConsumer { + private static class TestCompletableFutureCallback implements BiConsumer { private Throwable throwable; diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/java/com/example/BigQuerySampleConfiguration.java b/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/java/com/example/BigQuerySampleConfiguration.java index ac0b532c1d..e2a5e94269 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/java/com/example/BigQuerySampleConfiguration.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/src/main/java/com/example/BigQuerySampleConfiguration.java @@ -61,7 +61,7 @@ public GatewayProxyFactoryBean gatewayProxyFactoryBean() { GatewayProxyFactoryBean factoryBean = new GatewayProxyFactoryBean(BigQueryFileGateway.class); factoryBean.setDefaultRequestChannel(bigQueryWriteDataChannel()); factoryBean.setDefaultReplyChannel(bigQueryJobReplyChannel()); - // Ensures that BigQueryFileGateway does not return double-wrapped ListenableFutures + // Ensures that BigQueryFileGateway does not return double-wrapped CompletableFutures factoryBean.setAsyncExecutor(null); return factoryBean; } From 6ca1b636cb2f02bd88155d73097782597fe85260 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sun, 11 Dec 2022 20:20:51 -0500 Subject: [PATCH 141/179] remove legacy pubsub stream examples --- .../README.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/README.adoc b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/README.adoc index a490ebbbff..7453017846 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/README.adoc +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/README.adoc @@ -1,6 +1,6 @@ = Spring Cloud GCP Stream Binder for Pub/Sub Functional Code Sample -This code sample demonstrates how to use the Spring Cloud Stream binder for Google Cloud Pub/Sub. For the legacy annotation-based style, see link:../spring-cloud-gcp-pubsub-stream-sample[this sample]. +This code sample demonstrates how to use the Spring Cloud Stream binder for Google Cloud Pub/Sub. The sample consists of two applications, a source (`spring-cloud-gcp-pubsub-stream-functional-sample-source`) and a sink (`spring-cloud-gcp-pubsub-stream-functional-sample-sink`). The source collects a user name and a message through a web form, adds the data along with the time of message creation to a `UserMessage` object, and sends it through Google Cloud Pub/Sub. The sink application simply logs the message. From 61b9dd61cc1d5b72a98f0ce0f9b952e260c6a03d Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sun, 11 Dec 2022 20:35:50 -0500 Subject: [PATCH 142/179] remove r2dbc-mysql in docs --- docs/src/main/asciidoc/sql.adoc | 66 +++++--------------------------- docs/src/main/md/sql.md | 67 +++++++-------------------------- 2 files changed, 22 insertions(+), 111 deletions(-) diff --git a/docs/src/main/asciidoc/sql.adoc b/docs/src/main/asciidoc/sql.adoc index 489962d323..9010e79d3d 100644 --- a/docs/src/main/asciidoc/sql.adoc +++ b/docs/src/main/asciidoc/sql.adoc @@ -2,7 +2,7 @@ == Cloud SQL Spring Cloud GCP adds integrations with -https://docs.spring.io/spring/docs/current/spring-framework-reference/html/jdbc.html[Spring JDBC] and https://docs.spring.io/spring-data/r2dbc/docs/current/reference/html/#r2dbc.core[Spring R2DBC] so you can run your MySQL or PostgreSQL databases in https://cloud.google.com/sql[Google Cloud SQL] using Spring JDBC and other libraries that depend on it like Spring Data JPA or Spring Data R2DBC. +https://docs.spring.io/spring/docs/current/spring-framework-reference/html/jdbc.html[Spring JDBC] and https://docs.spring.io/spring-data/r2dbc/docs/current/reference/html/#r2dbc.core[Spring R2DBC] so you can run your MySQL or PostgreSQL databases in https://cloud.google.com/sql[Google Cloud SQL] using Spring JDBC and other libraries that depend on it like Spring Data JPA or Spring Data R2DBC (only R2DBC PostgreSQL is supported). The Cloud SQL support is provided by Spring Cloud GCP in the form of two Spring Boot starters, one for MySQL and another one for PostgreSQL. The role of the starters is to read configuration from properties and assume default settings so that user experience connecting to MySQL and PostgreSQL is as simple as possible. @@ -53,7 +53,7 @@ To do that, go to the https://console.cloud.google.com/apis/library[API library ==== Spring Boot Starter for Google Cloud SQL -The Spring Boot Starters for Google Cloud SQL provide an auto-configured https://docs.oracle.com/javase/7/docs/api/javax/sql/DataSource.html[`DataSource`] object. +The Spring Boot Starters for Google Cloud SQL provide an autoconfigured https://docs.oracle.com/javase/7/docs/api/javax/sql/DataSource.html[`DataSource`] object. Coupled with Spring JDBC, it provides a https://docs.spring.io/spring/docs/current/spring-framework-reference/html/jdbc.html#jdbc-JdbcTemplate[`JdbcTemplate`] object bean that allows for operations such as querying and modifying a database. @@ -65,7 +65,7 @@ public List> listUsers() { ---- You can rely on -https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-sql.html#boot-features-connect-to-production-database[Spring Boot data source auto-configuration] to configure a `DataSource` bean. +https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-sql.html#boot-features-connect-to-production-database[Spring Boot data source autoconfiguration] to configure a `DataSource` bean. In other words, properties like the SQL username, `spring.datasource.username`, and password, `spring.datasource.password` can be used. There is also some configuration specific to Google Cloud SQL (see "Cloud SQL Configuration Properties" section below). @@ -76,7 +76,7 @@ There is also some configuration specific to Google Cloud SQL (see "Cloud SQL Co | `spring.datasource.driver-class-name` | JDBC driver to use. | No | MySQL: `com.mysql.cj.jdbc.Driver`; PostgreSQL: `org.postgresql.Driver` |=== -NOTE: If you provide your own `spring.datasource.url`, it will be ignored, unless you disable Cloud SQL auto configuration with `spring.cloud.gcp.sql.enabled=false` or `spring.cloud.gcp.sql.jdbc.enabled=false`. +NOTE: If you provide your own `spring.datasource.url`, it will be ignored, unless you disable Cloud SQL autoconfiguration with `spring.cloud.gcp.sql.enabled=false` or `spring.cloud.gcp.sql.jdbc.enabled=false`. ===== `DataSource` creation flow @@ -94,59 +94,12 @@ You can connect to your database with as little as a database and instance names Maven and Gradle coordinates, using <>: -To use MySQL: - -[source,xml] ----- - - com.google.cloud - spring-cloud-gcp-starter-sql-mysql-r2dbc - - ----- - -[source,subs="normal"] ----- -dependencies { - implementation("com.google.cloud:spring-cloud-gcp-starter-sql-mysql-r2dbc") -} ----- - -To use PostgreSQL with Spring Boot 2.6: - -[source,xml] ----- - - com.google.cloud - spring-cloud-gcp-starter-sql-postgres-r2dbc - ----- - -[source,subs="normal"] ----- -dependencies { - implementation("com.google.cloud:spring-cloud-gcp-starter-sql-postgres-r2dbc") -} ----- - -To use PostgreSQL with Spring Boot 2.7 (the latest version of the Postgres R2DBC driver changed its Maven coordinates): +To use PostgreSQL: ``` xml - com.google.cloud - spring-cloud-gcp-starter-sql-postgres-r2dbc - - - io.r2dbc - r2dbc-postgresql - - - - - - org.postgresql - r2dbc-postgresql - 0.9.1.RELEASE + com.google.cloud + spring-cloud-gcp-starter-sql-postgres-r2dbc ``` @@ -178,11 +131,11 @@ There is also some configuration specific to Google Cloud SQL (see "Cloud SQL Co |=== | Property name | Description | Required | Default value -| `spring.r2dbc.username` | Database username | No | MySQL: `root`; PostgreSQL: `postgres` +| `spring.r2dbc.username` | Database username | No | `postgres` | `spring.r2dbc.password` | Database password | No | `null` |=== -NOTE: If you provide your own `spring.r2dbc.url`, it will be ignored, unless you disable Cloud SQL auto-configuration for R2DBC with `spring.cloud.gcp.sql.enabled=false` or `spring.cloud.gcp.sql.r2dbc.enabled=false` . +NOTE: If you provide your own `spring.r2dbc.url`, it will be ignored, unless you disable Cloud SQL autoconfiguration for R2DBC with `spring.cloud.gcp.sql.enabled=false` or `spring.cloud.gcp.sql.r2dbc.enabled=false` . ===== `ConnectionFactory` creation flow @@ -276,5 +229,4 @@ Available sample applications and codelabs: - https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/main/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-sample[Spring Cloud GCP PostgreSQL] - https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/main/spring-cloud-gcp-samples/spring-cloud-gcp-data-jpa-sample[Spring Data JPA with Spring Cloud GCP SQL] - Codelab: https://codelabs.developers.google.com/codelabs/cloud-spring-petclinic-cloudsql/index.html[Spring Pet Clinic using Cloud SQL] -- https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/main/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample[R2DBC: Spring Cloud GCP MySQL] - https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/main/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-r2dbc-sample[R2DBC: Spring Cloud GCP PostgreSQL] \ No newline at end of file diff --git a/docs/src/main/md/sql.md b/docs/src/main/md/sql.md index 0a5c973cf1..215d0b3d61 100644 --- a/docs/src/main/md/sql.md +++ b/docs/src/main/md/sql.md @@ -6,7 +6,7 @@ and [Spring R2DBC](https://docs.spring.io/spring-data/r2dbc/docs/current/reference/html/#r2dbc.core) so you can run your MySQL or PostgreSQL databases in [Google Cloud SQL](https://cloud.google.com/sql) using Spring JDBC and other libraries -that depend on it like Spring Data JPA or Spring Data R2DBC. +that depend on it like Spring Data JPA or Spring Data R2DBC (only R2DBC PostgreSQL is supported). The Cloud SQL support is provided by Spring Cloud GCP in the form of two Spring Boot starters, one for MySQL and another one for PostgreSQL. The @@ -57,7 +57,7 @@ Console, search for "Cloud SQL API" and enable the option that is called #### Spring Boot Starter for Google Cloud SQL -The Spring Boot Starters for Google Cloud SQL provide an auto-configured +The Spring Boot Starters for Google Cloud SQL provide an autoconfigured [`DataSource`](https://docs.oracle.com/javase/7/docs/api/javax/sql/DataSource.html) object. Coupled with Spring JDBC, it provides a [`JdbcTemplate`](https://docs.spring.io/spring/docs/current/spring-framework-reference/html/jdbc.html#jdbc-JdbcTemplate) @@ -71,7 +71,7 @@ public List> listUsers() { ``` You can rely on [Spring Boot data source -auto-configuration](https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-sql.html#boot-features-connect-to-production-database) +autoconfiguration](https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-sql.html#boot-features-connect-to-production-database) to configure a `DataSource` bean. In other words, properties like the SQL username, `spring.datasource.username`, and password, `spring.datasource.password` can be used. There is also some @@ -88,7 +88,7 @@ Properties" section below).
If you provide your own `spring.datasource.url`, it will be ignored, -unless you disable Cloud SQL auto configuration with +unless you disable Cloud SQL autoconfiguration with `spring.cloud.gcp.sql.enabled=false` or `spring.cloud.gcp.sql.jdbc.enabled=false`. @@ -121,50 +121,12 @@ database with as little as a database and instance names. Maven and Gradle coordinates, using [Spring Cloud GCP BOM](getting-started.xml#bill-of-materials): -To use MySQL: - -``` xml - - com.google.cloud - spring-cloud-gcp-starter-sql-mysql-r2dbc - -``` - - dependencies { - implementation("com.google.cloud:spring-cloud-gcp-starter-sql-mysql-r2dbc") - } - -To use PostgreSQL with Spring Boot 2.6: - -``` xml - - com.google.cloud - spring-cloud-gcp-starter-sql-postgres-r2dbc - -``` - - dependencies { - implementation("com.google.cloud:spring-cloud-gcp-starter-sql-postgres-r2dbc") - } - -To use PostgreSQL with Spring Boot 2.7 (the latest version of the Postgres R2DBC driver changed its Maven coordinates): +To use PostgreSQL: ``` xml - com.google.cloud - spring-cloud-gcp-starter-sql-postgres-r2dbc - - - io.r2dbc - r2dbc-postgresql - - - - - - org.postgresql - r2dbc-postgresql - 0.9.1.RELEASE + com.google.cloud + spring-cloud-gcp-starter-sql-postgres-r2dbc ``` @@ -205,16 +167,16 @@ Standard R2DBC properties like the SQL username, used. There is also some configuration specific to Google Cloud SQL (see "Cloud SQL Configuration Properties" section below). -| | | | | -| ----------------------- | ----------------- | -------- | ------------------------------------- | -| Property name | Description | Required | Default value | -| `spring.r2dbc.username` | Database username | No | MySQL: `root`; PostgreSQL: `postgres` | -| `spring.r2dbc.password` | Database password | No | `null` | +| | | | | +| ----------------------- | ----------------- | -------- | ------------------------------------ | +| Property name | Description | Required | Default value | +| `spring.r2dbc.username` | Database username | No | `postgres` | +| `spring.r2dbc.password` | Database password | No | `null` |
If you provide your own `spring.r2dbc.url`, it will be ignored, unless -you disable Cloud SQL auto-configuration for R2DBC with +you disable Cloud SQL autoconfiguration for R2DBC with `spring.cloud.gcp.sql.enabled=false` or `spring.cloud.gcp.sql.r2dbc.enabled=false` . @@ -342,8 +304,5 @@ Available sample applications and codelabs: - Codelab: [Spring Pet Clinic using Cloud SQL](https://codelabs.developers.google.com/codelabs/cloud-spring-petclinic-cloudsql/index.html) - - [R2DBC: Spring Cloud GCP - MySQL](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/main/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample) - - [R2DBC: Spring Cloud GCP PostgreSQL](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/main/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-r2dbc-sample) From 5a684ea69bfe3ea12ac0ff9f0b920a145535cb64 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sun, 11 Dec 2022 20:58:38 -0500 Subject: [PATCH 143/179] fix smell code --- .../autoconfigure/pubsub/GcpPubSubAutoConfiguration.java | 6 ++---- .../spanner/core/mapping/SpannerPersistentEntityImpl.java | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubAutoConfiguration.java index 4274c947b8..1971a5c113 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubAutoConfiguration.java @@ -60,7 +60,6 @@ import java.util.Optional; import java.util.concurrent.Executor; import java.util.function.Consumer; -import java.util.stream.Collectors; import javax.annotation.PostConstruct; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -119,7 +118,7 @@ public class GcpPubSubAutoConfiguration { private ExecutorProvider globalExecutorProvider; - private ObjectProvider selectiveSchedulerThreadNameProvider; + private final ObjectProvider selectiveSchedulerThreadNameProvider; public GcpPubSubAutoConfiguration( GcpPubSubProperties gcpPubSubProperties, @@ -368,8 +367,7 @@ public PublisherFactory defaultPublisherFactory( factory.setEnableMessageOrdering(gcpPubSubProperties.getPublisher().getEnableMessageOrdering()); factory.setEndpoint(gcpPubSubProperties.getPublisher().getEndpoint()); - List customizers = customizersProvider.orderedStream() - .collect(Collectors.toList()); + List customizers = customizersProvider.orderedStream().toList(); Collections.reverse(customizers); // highest priority customizer needs to be last factory.setCustomizers(customizers); diff --git a/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentEntityImpl.java b/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentEntityImpl.java index 347c5df183..df20f72ea3 100644 --- a/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentEntityImpl.java +++ b/spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/SpannerPersistentEntityImpl.java @@ -450,8 +450,7 @@ public void setProperty(PersistentProperty property, @Nullable Object value) SpannerPersistentProperty[] primaryKeyProperties = owner.getPrimaryKeyProperties(); Iterator partsIterator; - if (value instanceof Key) { - Key keyValue = (Key) value; + if (value instanceof Key keyValue) { if (keyValue.size() != primaryKeyProperties.length) { throw new SpannerDataException( "The number of key parts is not equal to the number of primary key properties"); From b0e112513ed8896b2da297a0733630ada3b38bbe Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sun, 11 Dec 2022 21:09:41 -0500 Subject: [PATCH 144/179] restore change --- .../autoconfigure/pubsub/GcpPubSubAutoConfiguration.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubAutoConfiguration.java index 1971a5c113..4274c947b8 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubAutoConfiguration.java @@ -60,6 +60,7 @@ import java.util.Optional; import java.util.concurrent.Executor; import java.util.function.Consumer; +import java.util.stream.Collectors; import javax.annotation.PostConstruct; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -118,7 +119,7 @@ public class GcpPubSubAutoConfiguration { private ExecutorProvider globalExecutorProvider; - private final ObjectProvider selectiveSchedulerThreadNameProvider; + private ObjectProvider selectiveSchedulerThreadNameProvider; public GcpPubSubAutoConfiguration( GcpPubSubProperties gcpPubSubProperties, @@ -367,7 +368,8 @@ public PublisherFactory defaultPublisherFactory( factory.setEnableMessageOrdering(gcpPubSubProperties.getPublisher().getEnableMessageOrdering()); factory.setEndpoint(gcpPubSubProperties.getPublisher().getEndpoint()); - List customizers = customizersProvider.orderedStream().toList(); + List customizers = customizersProvider.orderedStream() + .collect(Collectors.toList()); Collections.reverse(customizers); // highest priority customizer needs to be last factory.setCustomizers(customizers); From 568c9aa0f927be20ba17aa82d268c0b068d9aeaa Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Sun, 11 Dec 2022 21:16:43 -0500 Subject: [PATCH 145/179] restore dir in docs --- docs/src/main/asciidoc/pubsub.adoc | 1 - docs/src/main/asciidoc/spring-integration-pubsub.adoc | 1 - 2 files changed, 2 deletions(-) diff --git a/docs/src/main/asciidoc/pubsub.adoc b/docs/src/main/asciidoc/pubsub.adoc index 1f66aba563..69251b0d5c 100644 --- a/docs/src/main/asciidoc/pubsub.adoc +++ b/docs/src/main/asciidoc/pubsub.adoc @@ -1,6 +1,5 @@ [#cloud-pubsub] == Cloud Pub/Sub -:project-root: ../../../.. Spring Cloud GCP provides an abstraction layer to publish to and subscribe from Google Cloud Pub/Sub topics and to create, list or delete Google Cloud Pub/Sub topics and subscriptions. diff --git a/docs/src/main/asciidoc/spring-integration-pubsub.adoc b/docs/src/main/asciidoc/spring-integration-pubsub.adoc index a389f251f9..bcbae01ae4 100644 --- a/docs/src/main/asciidoc/spring-integration-pubsub.adoc +++ b/docs/src/main/asciidoc/spring-integration-pubsub.adoc @@ -1,5 +1,4 @@ === Channel Adapters for Cloud Pub/Sub -:project-root: ../../../.. The channel adapters for Google Cloud Pub/Sub connect your Spring https://docs.spring.io/spring-integration/reference/html/channel.html[`MessageChannels`] to Google Cloud Pub/Sub topics and subscriptions. This enables messaging between different processes, applications or microservices backed up by Google Cloud Pub/Sub. From 6e81ab40c399cde13293fa1144a017d1c7be68a1 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 12 Dec 2022 10:40:53 -0500 Subject: [PATCH 146/179] remove unused import --- .../cloud/spring/data/datastore/core/DatastoreTemplateTests.java | 1 - 1 file changed, 1 deletion(-) diff --git a/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/DatastoreTemplateTests.java b/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/DatastoreTemplateTests.java index 52c6064ac0..25f717d56b 100644 --- a/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/DatastoreTemplateTests.java +++ b/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/DatastoreTemplateTests.java @@ -95,7 +95,6 @@ import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Slice; import org.springframework.data.domain.Sort; -import org.springframework.data.util.ClassTypeInformation; import org.springframework.data.util.TypeInformation; /** Tests for the Datastore Template. */ From 5b41272f0a5ac8d84cd9c2e1c22504316721e201 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 12 Dec 2022 11:04:44 -0500 Subject: [PATCH 147/179] upgrade kotlin version to 1.7.21 --- .../spring-cloud-gcp-kotlin-app-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/pom.xml index f8ae4fc121..c16a6dbc04 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/pom.xml @@ -14,7 +14,7 @@ Spring Cloud GCP Code Sample - Kotlin App Sample - 1.7.20 + 1.7.21 From 87ee6d4737b46dd0ab78fcf976116933604130ad Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 12 Dec 2022 11:53:44 -0500 Subject: [PATCH 148/179] fix stream docs --- docs/src/main/asciidoc/spring-stream.adoc | 104 +++------------- docs/src/main/md/spring-stream.md | 117 +++--------------- .../README.adoc | 4 +- 3 files changed, 36 insertions(+), 189 deletions(-) diff --git a/docs/src/main/asciidoc/spring-stream.adoc b/docs/src/main/asciidoc/spring-stream.adoc index c3d50153db..cf3f9b2b75 100644 --- a/docs/src/main/asciidoc/spring-stream.adoc +++ b/docs/src/main/asciidoc/spring-stream.adoc @@ -33,11 +33,13 @@ NOTE: Partitioning is currently not supported by this binder. === Configuration You can configure the Spring Cloud Stream Binder for Google Cloud Pub/Sub to automatically generate the underlying resources, like the Google Cloud Pub/Sub topics and subscriptions for producers and consumers. -For that, you can use the `spring.cloud.stream.gcp.pubsub.bindings...auto-create-resources` property, which is turned ON by default. +For that, you can use the `spring.cloud.stream.gcp.pubsub.bindings...auto-create-resources` property, which is turned ON by default. + +NOTE: For more info about consumer/producer naming convention, please refer to https://docs.spring.io/spring-cloud-stream/docs/current/reference/html/spring-cloud-stream.html#_functional_binding_names[Functional binding names]. Starting with version 1.1, these and other binder properties can be configured globally for all the bindings, e.g. `spring.cloud.stream.gcp.pubsub.default.consumer.auto-create-resources`. -If you are using Pub/Sub auto-configuration from the Spring Cloud GCP Pub/Sub Starter, you should refer to the <> section for other Pub/Sub parameters. +If you are using Pub/Sub autoconfiguration from the Spring Cloud GCP Pub/Sub Starter, you should refer to the <> section for other Pub/Sub parameters. NOTE: To use this binder with a https://cloud.google.com/pubsub/docs/emulator[running emulator], configure its host and port via `spring.cloud.gcp.pubsub.emulator-host`. @@ -54,8 +56,8 @@ For example, for the following configuration, a topic called `myEvents` would be .application.properties [source] ---- -spring.cloud.stream.bindings.events.destination=myEvents -spring.cloud.stream.gcp.pubsub.bindings.events.producer.auto-create-resources=true +spring.cloud.stream.bindings.{PRODUCER_NAME}.destination=myEvents +spring.cloud.stream.gcp.pubsub.bindings.{PRODUCER_NAME}.producer.auto-create-resources=true ---- ==== Consumer Destination Configuration @@ -86,8 +88,8 @@ For example, with this configuration: .application.properties [source] ---- -spring.cloud.stream.bindings.events.destination=myEvents -spring.cloud.stream.gcp.pubsub.bindings.events.consumer.auto-create-resources=false +spring.cloud.stream.bindings.{CONSUMER_NAME}.destination=myEvents +spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME}.consumer.auto-create-resources=false ---- Only an anonymous subscription named `anonymous.myEvents.a6d83782-c5a3-4861-ac38-e6e2af15a7be` is created and later cleaned up. @@ -96,11 +98,11 @@ In another example, with the following configuration: .application.properties [source] ---- -spring.cloud.stream.bindings.events.destination=myEvents -spring.cloud.stream.gcp.pubsub.bindings.events.consumer.auto-create-resources=true +spring.cloud.stream.bindings.{CONSUMER_NAME}.destination=myEvents +spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME}.consumer.auto-create-resources=true # specify consumer group, and avoid anonymous consumer group generation -spring.cloud.stream.bindings.events.group=consumerGroup1 +spring.cloud.stream.bindings.{CONSUMER_NAME}.group=consumerGroup1 ---- These resources will be created: @@ -113,9 +115,9 @@ For example, for a consumer to allow only two headers, provide a comma separated .application.properties ---- -spring.cloud.stream.gcp.pubsub.bindings.-in-0.consumer.allowedHeaders=allowed1, allowed2 +spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME}.consumer.allowedHeaders=allowed1, allowed2 ---- -Where should be replaced by the method which is consuming/reading messages from Cloud Pub/Sub and allowed1, allowed2 is the comma separated list of headers that the user wants to keep. +Where `CONSUMER_NAME` should be replaced by the method which is consuming/reading messages from Cloud Pub/Sub and allowed1, allowed2 is the comma separated list of headers that the user wants to keep. @@ -123,9 +125,9 @@ A similar style is applicable for producers as well. For example: .application.properties ---- -spring.cloud.stream.gcp.pubsub.bindings.-out-0.producer.allowedHeaders=allowed3,allowed4 +spring.cloud.stream.gcp.pubsub.bindings.{PRODUCER_NAME}.producer.allowedHeaders=allowed3,allowed4 ---- -Where should be replaced by the method which is producing/sending messages to Cloud Pub/Sub and allowed3, allowed4 is the comma separated list of headers that user wants to map. All other headers will be removed before the message is sent to Cloud Pub/Sub. +Where `PRODUCER_NAME` should be replaced by the method which is producing/sending messages to Cloud Pub/Sub and allowed3, allowed4 is the comma separated list of headers that user wants to map. All other headers will be removed before the message is sent to Cloud Pub/Sub. @@ -174,84 +176,8 @@ Supplier> generateUserMessages() { A processor application works similarly to a source application, except it is triggered by presence of a `Function` bean. - -=== Binding with Annotations - -NOTE: As of version 3.0, annotation binding is considered legacy. - -To set up a sink application in this style, you would associate a class with a binding interface, such as the built-in `Sink` interface. - -``` -@EnableBinding(Sink.class) -public class SinkExample { - - @StreamListener(Sink.INPUT) - public void handleMessage(UserMessage userMessage) { - // process message - } -} -``` - -To set up a source application, you would similarly associate a class with a built-in `Source` interface, and inject an instance of it provided by Spring Cloud Stream. - -``` -@EnableBinding(Source.class) -public class SourceExample { - - @Autowired - private Source source; - - public void sendMessage() { - this.source.output().send(new GenericMessage<>(/* your object here */)); - } -} -``` - - -=== Streaming vs. Polled Input - -Many Spring Cloud Stream applications will use the built-in `Sink` binding, which triggers the _streaming_ input binder creation. -Messages can then be consumed with an input handler marked by `@StreamListener(Sink.INPUT)` annotation, at whatever rate Pub/Sub sends them. - -For more control over the rate of message arrival, a polled input binder can be set up by defining a custom binding interface with an `@Input`-annotated method returning `PollableMessageSource`. - -[source,java] ----- -public interface PollableSink { - - @Input("input") - PollableMessageSource input(); -} ----- - -The `PollableMessageSource` can then be injected and queried, as needed. - -[source,java] ----- -@EnableBinding(PollableSink.class) -public class SinkExample { - - @Autowired - PollableMessageSource destIn; - - @Bean - public ApplicationRunner singlePollRunner() { - return args -> { - // This will poll only once. - // Add a loop or a scheduler to get more messages. - destIn.poll(message -> System.out.println("Message retrieved: " + message)); - }; - } -} ----- - -By default, the polling will only get 1 message at a time. -Use the `spring.cloud.stream.gcp.pubsub.default.consumer.maxFetchSize` property to fetch additional messages per network roundtrip. - === Sample Sample applications are available: -* For https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/main/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample[streaming input, annotation-based]. * For https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/main/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample[streaming input, functional style]. -* For https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/main/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample[polled input]. diff --git a/docs/src/main/md/spring-stream.md b/docs/src/main/md/spring-stream.md index c4653da47d..87e4c6ecd5 100644 --- a/docs/src/main/md/spring-stream.md +++ b/docs/src/main/md/spring-stream.md @@ -41,14 +41,20 @@ You can configure the Spring Cloud Stream Binder for Google Cloud Pub/Sub to automatically generate the underlying resources, like the Google Cloud Pub/Sub topics and subscriptions for producers and consumers. For that, you can use the -`spring.cloud.stream.gcp.pubsub.bindings...auto-create-resources` +`spring.cloud.stream.gcp.pubsub.bindings...auto-create-resources` property, which is turned ON by default. +
+ +For more info about consumer/producer naming convention, please refer to [Functional binding names](https://docs.spring.io/spring-cloud-stream/docs/current/reference/html/spring-cloud-stream.html#_functional_binding_names). + +
+ Starting with version 1.1, these and other binder properties can be configured globally for all the bindings, e.g. `spring.cloud.stream.gcp.pubsub.default.consumer.auto-create-resources`. -If you are using Pub/Sub auto-configuration from the Spring Cloud GCP +If you are using Pub/Sub autoconfiguration from the Spring Cloud GCP Pub/Sub Starter, you should refer to the [configuration](#pubsub-configuration) section for other Pub/Sub parameters. @@ -79,8 +85,8 @@ would be created. **application.properties.** - spring.cloud.stream.bindings.events.destination=myEvents - spring.cloud.stream.gcp.pubsub.bindings.events.producer.auto-create-resources=true + spring.cloud.stream.bindings.{PRODUCER_NAME}.destination=myEvents + spring.cloud.stream.gcp.pubsub.bindings.{PRODUCER_NAME}.producer.auto-create-resources=true #### Consumer Destination Configuration @@ -119,8 +125,8 @@ For example, with this configuration: **application.properties.** - spring.cloud.stream.bindings.events.destination=myEvents - spring.cloud.stream.gcp.pubsub.bindings.events.consumer.auto-create-resources=false + spring.cloud.stream.bindings.{CONSUMER_NAME}.destination=myEvents + spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME}.consumer.auto-create-resources=false Only an anonymous subscription named `anonymous.myEvents.a6d83782-c5a3-4861-ac38-e6e2af15a7be` is created and @@ -130,11 +136,11 @@ In another example, with the following configuration: **application.properties.** - spring.cloud.stream.bindings.events.destination=myEvents - spring.cloud.stream.gcp.pubsub.bindings.events.consumer.auto-create-resources=true + spring.cloud.stream.bindings.{CONSUMER_NAME}.destination=myEvents + spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME}.consumer.auto-create-resources=true # specify consumer group, and avoid anonymous consumer group generation - spring.cloud.stream.bindings.events.group=consumerGroup1 + spring.cloud.stream.bindings.{CONSUMER_NAME}.group=consumerGroup1 These resources will be created: @@ -150,9 +156,9 @@ a comma separated list like this: **application.properties.** - spring.cloud.stream.gcp.pubsub.bindings.-in-0.consumer.allowedHeaders=allowed1, allowed2 + spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME}.consumer.allowedHeaders=allowed1, allowed2 -Where \ should be replaced by the method which is +Where `CONSUMER_NAME` should be replaced by the method which is consuming/reading messages from Cloud Pub/Sub and allowed1, allowed2 is the comma separated list of headers that the user wants to keep. @@ -160,9 +166,9 @@ A similar style is applicable for producers as well. For example: **application.properties.** - spring.cloud.stream.gcp.pubsub.bindings.-out-0.producer.allowedHeaders=allowed3,allowed4 + spring.cloud.stream.gcp.pubsub.bindings.{PRODUCER_NAME}.producer.allowedHeaders=allowed3,allowed4 -Where \ should be replaced by the method which is +Where `PRODUCER_NAME` should be replaced by the method which is producing/sending messages to Cloud Pub/Sub and allowed3, allowed4 is the comma separated list of headers that user wants to map. All other headers will be removed before the message is sent to Cloud Pub/Sub. @@ -215,94 +221,9 @@ stream, which will be used as is. A processor application works similarly to a source application, except it is triggered by presence of a `Function` bean. -### Binding with Annotations - -
- -As of version 3.0, annotation binding is considered legacy. - -
- -To set up a sink application in this style, you would associate a class -with a binding interface, such as the built-in `Sink` interface. - - @EnableBinding(Sink.class) - public class SinkExample { - - @StreamListener(Sink.INPUT) - public void handleMessage(UserMessage userMessage) { - // process message - } - } - -To set up a source application, you would similarly associate a class -with a built-in `Source` interface, and inject an instance of it -provided by Spring Cloud Stream. - - @EnableBinding(Source.class) - public class SourceExample { - - @Autowired - private Source source; - - public void sendMessage() { - this.source.output().send(new GenericMessage<>(/* your object here */)); - } - } - -### Streaming vs. Polled Input - -Many Spring Cloud Stream applications will use the built-in `Sink` -binding, which triggers the *streaming* input binder creation. Messages -can then be consumed with an input handler marked by -`@StreamListener(Sink.INPUT)` annotation, at whatever rate Pub/Sub sends -them. - -For more control over the rate of message arrival, a polled input binder -can be set up by defining a custom binding interface with an -`@Input`-annotated method returning `PollableMessageSource`. - -``` java -public interface PollableSink { - - @Input("input") - PollableMessageSource input(); -} -``` - -The `PollableMessageSource` can then be injected and queried, as needed. - -``` java -@EnableBinding(PollableSink.class) -public class SinkExample { - - @Autowired - PollableMessageSource destIn; - - @Bean - public ApplicationRunner singlePollRunner() { - return args -> { - // This will poll only once. - // Add a loop or a scheduler to get more messages. - destIn.poll(message -> System.out.println("Message retrieved: " + message)); - }; - } -} -``` - -By default, the polling will only get 1 message at a time. Use the -`spring.cloud.stream.gcp.pubsub.default.consumer.maxFetchSize` property -to fetch additional messages per network roundtrip. - ### Sample Sample applications are available: - - For [streaming input, - annotation-based](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/main/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample). - - For [streaming input, functional style](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/main/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample). - - - For [polled - input](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/main/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample). diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-dead-letter-sample/README.adoc b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-dead-letter-sample/README.adoc index e54d975b7d..22d83e5666 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-dead-letter-sample/README.adoc +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-dead-letter-sample/README.adoc @@ -2,7 +2,7 @@ This code sample demonstrates how to use the Spring Cloud Stream binder for Google Cloud Pub/Sub with Dead Letter Topics. -The sample app prompts a user for a message and user name. +The sample app prompts a user for a message and username. That data is added to a `UserMessage` object, together with the time of message creation, and is sent through Google Cloud Pub/Sub to a sink that `nack()`s the message. Pub/Sub will attempt to redeliver the message up to maximum number of retries before routing it to the configured dead letter topic.\ This sample app also listens to this dead letter topic, and logs any messages received. @@ -30,7 +30,7 @@ The topics will be created in your account if they do not already exist. (spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-dead-letter-sample) to get the app running. 7. Browse to `localhost:8080` or use the `Web Preview` button in Cloud Shell to preview the app on port 8080, -and type in a message, a user name, and press the `Post it!` button. +and type in a message, a username, and press the `Post it!` button. 8. Verify in your app's logs that a similar message was posted: + From 47464dc37b2f12b5c8b320ad109b57a9894368ff Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 12 Dec 2022 16:17:59 -0500 Subject: [PATCH 149/179] refactor test code --- ...PubSubExtendedBindingsPropertiesTests.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/properties/PubSubExtendedBindingsPropertiesTests.java b/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/properties/PubSubExtendedBindingsPropertiesTests.java index 601e4876f0..0fb08ecaf4 100644 --- a/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/properties/PubSubExtendedBindingsPropertiesTests.java +++ b/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/properties/PubSubExtendedBindingsPropertiesTests.java @@ -17,12 +17,14 @@ package com.google.cloud.spring.stream.binder.pubsub.properties; import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import com.google.cloud.spring.pubsub.integration.AckMode; import java.util.Collections; import java.util.HashMap; import java.util.Map; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.springframework.cloud.stream.binder.Binder; @@ -46,11 +48,17 @@ */ class PubSubExtendedBindingsPropertiesTests { - @Test - void testExtendedDefaultProducerProperties() { + private Binder binder; + + @BeforeEach + void init() { DefaultBinderFactory binderFactory = createMockExtendedBinderFactory(); - Binder binder = binderFactory.getBinder(null, + binder = binderFactory.getBinder(null, MessageChannel.class); + } + + @Test + void testExtendedDefaultProducerProperties() { PubSubProducerProperties producerProperties = (PubSubProducerProperties) ((ExtendedPropertiesBinder) binder) .getExtendedProducerProperties("default-output"); assertThat(producerProperties.isAutoCreateResources()).isTrue(); @@ -60,9 +68,6 @@ void testExtendedDefaultProducerProperties() { @Test void testExtendedDefaultConsumerProperties() { - DefaultBinderFactory binderFactory = createMockExtendedBinderFactory(); - Binder binder = binderFactory.getBinder(null, - MessageChannel.class); PubSubConsumerProperties consumerProperties = (PubSubConsumerProperties) ((ExtendedPropertiesBinder) binder) .getExtendedConsumerProperties("default-input"); assertThat(consumerProperties.isAutoCreateResources()).isTrue(); @@ -93,7 +98,7 @@ public static class MockExtendedBinderConfiguration { @SuppressWarnings("rawtypes") @Bean public Binder extendedPropertiesBinder() { - Binder mock = Mockito.mock(Binder.class, + Binder mock = mock(Binder.class, Mockito.withSettings().defaultAnswer(Mockito.RETURNS_MOCKS) .extraInterfaces(ExtendedPropertiesBinder.class)); ConfigurableEnvironment environment = new StandardEnvironment(); From 403e5f6d89018e295141b151b438ec61a61c928d Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 12 Dec 2022 16:20:27 -0500 Subject: [PATCH 150/179] refactor test code --- .../PubSubExtendedBindingsPropertiesTests.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/properties/PubSubExtendedBindingsPropertiesTests.java b/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/properties/PubSubExtendedBindingsPropertiesTests.java index 0fb08ecaf4..2d15569ea0 100644 --- a/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/properties/PubSubExtendedBindingsPropertiesTests.java +++ b/spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/properties/PubSubExtendedBindingsPropertiesTests.java @@ -24,7 +24,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; -import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.springframework.cloud.stream.binder.Binder; @@ -48,10 +48,10 @@ */ class PubSubExtendedBindingsPropertiesTests { - private Binder binder; + private static Binder binder; - @BeforeEach - void init() { + @BeforeAll + static void init() { DefaultBinderFactory binderFactory = createMockExtendedBinderFactory(); binder = binderFactory.getBinder(null, MessageChannel.class); @@ -78,7 +78,7 @@ void testExtendedDefaultConsumerProperties() { assertThat(consumerProperties.getDeadLetterPolicy()).isNull(); } - private DefaultBinderFactory createMockExtendedBinderFactory() { + private static DefaultBinderFactory createMockExtendedBinderFactory() { BinderTypeRegistry binderTypeRegistry = createMockExtendedBinderTypeRegistry(); return new DefaultBinderFactory( Collections.singletonMap("mock", @@ -86,7 +86,7 @@ private DefaultBinderFactory createMockExtendedBinderFactory() { binderTypeRegistry, null); } - private DefaultBinderTypeRegistry createMockExtendedBinderTypeRegistry() { + private static DefaultBinderTypeRegistry createMockExtendedBinderTypeRegistry() { return new DefaultBinderTypeRegistry( Collections.singletonMap("mock", new BinderType("mock", new Class[]{ MockExtendedBinderConfiguration.class }))); From c6346ef61b9b70dbb93d8cb7bcffd91f6facf68c Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 13 Dec 2022 20:30:32 -0500 Subject: [PATCH 151/179] remove graalvm in github workflow --- .github/workflows/integrationTests.yaml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/.github/workflows/integrationTests.yaml b/.github/workflows/integrationTests.yaml index 199da9b201..a110e488a6 100644 --- a/.github/workflows/integrationTests.yaml +++ b/.github/workflows/integrationTests.yaml @@ -52,24 +52,8 @@ jobs: - uses: actions/checkout@v2 - name: Setup Java 17 uses: actions/setup-java@v1 - if: matrix.it != 'native' with: java-version: 17 - - name: Setup GraalVM - uses: DeLaGuardo/setup-graalvm@4.0 - if: matrix.it == 'native' # note that this is no longer in the matrix - with: - graalvm: '21.2.0' - java: 'java11' - arch: 'amd64' - - name: Install GraalVM Native Image - if: matrix.it == 'native' - run: gu install native-image - - uses: actions/cache@v2 - id: mvn-cache - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-unified-${{ steps.date.outputs.date }} - name: Setup gcloud uses: google-github-actions/setup-gcloud@v0 with: From 56de037878de3ab6fe4c207244cc2fc5a9451d39 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Wed, 14 Dec 2022 11:34:05 -0500 Subject: [PATCH 152/179] remove sleuth in docs and comments --- README.adoc | 1 - docs/src/main/asciidoc/first-page.adoc | 2 +- docs/src/main/asciidoc/index.adoc | 2 +- docs/src/main/asciidoc/logging.adoc | 10 ++-- docs/src/main/asciidoc/trace.adoc | 37 +++++------- docs/src/main/md/first-page.md | 2 +- docs/src/main/md/logging.md | 9 ++- docs/src/main/md/trace.md | 59 ++++++------------- .../StackdriverTraceAutoConfiguration.java | 2 +- ...ckdriverLoggingAutoConfigurationTests.java | 2 +- ...tackdriverTraceAutoConfigurationTests.java | 2 +- .../TracePubSubAutoConfigurationTest.java | 2 +- .../logging/StackdriverTraceConstants.java | 6 +- spring-cloud-gcp-samples/README.adoc | 2 +- .../spring-cloud-gcp-trace-sample/README.adoc | 2 +- .../java/com/example/ExampleController.java | 1 - .../src/main/resources/application.properties | 3 - 17 files changed, 53 insertions(+), 91 deletions(-) diff --git a/README.adoc b/README.adoc index 4a99cf05f8..3d4346b013 100644 --- a/README.adoc +++ b/README.adoc @@ -36,7 +36,6 @@ Currently, this repository provides support for: ** link:spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql[Google Cloud SQL MySQL] ** link:spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-postgresql[Google Cloud SQL PostgreSQL] ** link:spring-cloud-gcp-starters/spring-cloud-gcp-starter-storage[Google Cloud Storage] -** link:spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace[Google Cloud Trace with Spring Cloud Sleuth] ** link:spring-cloud-gcp-starters/spring-cloud-gcp-starter-secretmanager[Google Secret Manager] ** link:spring-cloud-gcp-starters/spring-cloud-gcp-starter-security-firebase[Firebase Authentication] ** link:spring-cloud-gcp-starters/spring-cloud-gcp-starter-security-iap[Google Cloud IAP Authentication] diff --git a/docs/src/main/asciidoc/first-page.adoc b/docs/src/main/asciidoc/first-page.adoc index f2458873e0..81d4667cd8 100644 --- a/docs/src/main/asciidoc/first-page.adoc +++ b/docs/src/main/asciidoc/first-page.adoc @@ -17,7 +17,7 @@ Spring Framework on Google Cloud lets you leverage the power and simplicity of t - Map objects, relationships, and collections with Spring Data Cloud Spanner, Spring Data Cloud Datastore and Spring Data Reactive Repositories for Cloud Firestore - Write and read from Spring Resources backed up by Google Cloud Storage - Exchange messages with Spring Integration using Google Cloud Pub/Sub on the background -- Trace the execution of your app with Spring Cloud Sleuth and Google Cloud Trace +- Trace the execution of your app with Micrometer and Google Cloud Trace - Configure your app with Spring Cloud Config, backed up by the Google Runtime Configuration API - Consume and produce Google Cloud Storage data via Spring Integration GCS Channel Adapters - Use Spring Security via Google Cloud IAP diff --git a/docs/src/main/asciidoc/index.adoc b/docs/src/main/asciidoc/index.adoc index 394bed7d74..778b402613 100644 --- a/docs/src/main/asciidoc/index.adoc +++ b/docs/src/main/asciidoc/index.adoc @@ -17,7 +17,7 @@ Spring Framework on Google Cloud lets you leverage the power and simplicity of t - Map objects, relationships, and collections with Spring Data Cloud Spanner, Spring Data Cloud Datastore and Spring Data Reactive Repositories for Cloud Firestore - Write and read from Spring Resources backed up by Google Cloud Storage - Exchange messages with Spring Integration using Google Cloud Pub/Sub on the background -- Trace the execution of your app with Spring Cloud Sleuth and Google Cloud Trace +- Trace the execution of your app with Micrometer and Google Cloud Trace - Configure your app with Spring Cloud Config, backed up by the Google Runtime Configuration API - Consume and produce Google Cloud Storage data via Spring Integration GCS Channel Adapters - Use Spring Security via Google Cloud IAP diff --git a/docs/src/main/asciidoc/logging.adoc b/docs/src/main/asciidoc/logging.adoc index 2dfbaa253f..39a36ed50b 100644 --- a/docs/src/main/asciidoc/logging.adoc +++ b/docs/src/main/asciidoc/logging.adoc @@ -23,8 +23,8 @@ dependencies { https://cloud.google.com/logging/[Cloud Logging] is the managed logging service provided by Google Cloud. This module provides support for associating a web request trace ID with the corresponding log entries. -It does so by retrieving the `X-B3-TraceId` value from the https://logback.qos.ch/manual/mdc.html[Mapped Diagnostic Context (MDC)], which is set by Spring Cloud Sleuth. -If Spring Cloud Sleuth isn't used, the configured `TraceIdExtractor` extracts the desired header value and sets it as the log entry's trace ID. +It does so by retrieving the `X-B3-TraceId` value from the https://logback.qos.ch/manual/mdc.html[Mapped Diagnostic Context (MDC)], which is set by Micrometer. +If Micrometer isn't used, the configured `TraceIdExtractor` extracts the desired header value and sets it as the log entry's trace ID. This allows grouping of log messages by request, for example, in the https://console.cloud.google.com/logs/viewer[Google Cloud Console Logs viewer]. NOTE: Due to the way logging is set up, the Google Cloud project ID and credentials defined in `application.properties` are ignored. @@ -35,12 +35,12 @@ You can do this easily if you're using the https://cloud.google.com/sdk[Google C For use in Web MVC-based applications, `TraceIdLoggingWebMvcInterceptor` is provided that extracts the request trace ID from an HTTP request using a `TraceIdExtractor` and stores it in a thread-local, which can then be used in a logging appender to add the trace ID metadata to log messages. -WARNING: If Spring Framework on Google Cloud Trace is enabled, the logging module disables itself and delegates log correlation to Spring Cloud Sleuth. +WARNING: If Spring Framework on Google Cloud Trace is enabled, the logging module disables itself and delegates log correlation to Micrometer. `LoggingWebMvcConfigurer` configuration class is also provided to help register the `TraceIdLoggingWebMvcInterceptor` in Spring MVC applications. Applications hosted on the Google Cloud include trace IDs under the `x-cloud-trace-context` header, which will be included in log entries. -However, if Sleuth is used the trace ID will be picked up from the MDC. +However, if Micrometer is used the trace ID will be picked up from the MDC. === Logback Support @@ -141,7 +141,7 @@ If `projectId` is not set and cannot be determined, then it'll log `traceId` wit | `includeLevel` | `true` | Should the severity be included | `includeThreadName` | `true` | Should the thread name be included | `includeMDC` | `true` | Should all MDC properties be included. -The MDC properties `X-B3-TraceId`, `X-B3-SpanId` and `X-Span-Export` provided by Spring Sleuth will get excluded as they get handled separately +The MDC properties `X-B3-TraceId`, `X-B3-SpanId` and `X-Span-Export` provided by Micrometer will get excluded as they get handled separately | `includeLoggerName` | `true` | Should the name of the logger be included | `includeFormattedMessage` | `true` | Should the formatted log message be included. | `includeExceptionInMessage` | `true` | Should the stacktrace be appended to the formatted log message. diff --git a/docs/src/main/asciidoc/trace.adoc b/docs/src/main/asciidoc/trace.adoc index bbb13d4b1e..48b34e88a1 100644 --- a/docs/src/main/asciidoc/trace.adoc +++ b/docs/src/main/asciidoc/trace.adoc @@ -1,12 +1,12 @@ [#cloud-trace] == Cloud Trace -Google Cloud provides a managed distributed tracing service called https://cloud.google.com/trace/[Cloud Trace], and https://cloud.spring.io/spring-cloud-sleuth/[Spring Cloud Sleuth] can be used with it to easily instrument Spring Boot applications for observability. +Google Cloud provides a managed distributed tracing service called https://cloud.google.com/trace/[Cloud Trace], and https://micrometer.io/[Micrometer] can be used with it to easily instrument Spring Boot applications for observability. -Typically, Spring Cloud Sleuth captures trace information and forwards traces to services like Zipkin for storage and analysis. +Typically, Micrometer captures trace information and forwards traces to service like Zipkin for storage and analysis. However, on Google Cloud, instead of running and maintaining your own Zipkin instance and storage, you can use Cloud Trace to store traces, view trace details, generate latency distributions graphs, and generate performance regression reports. -This Spring Framework on Google Cloud starter can forward Spring Cloud Sleuth traces to Cloud Trace without an intermediary Zipkin server. +This Spring Framework on Google Cloud starter can forward Micrometer traces to Cloud Trace without an intermediary Zipkin server. Maven coordinates, using <>: @@ -37,7 +37,7 @@ If you are already using a Zipkin server capturing trace information from multip === Tracing -Spring Cloud Sleuth uses the https://github.com/openzipkin/brave[Brave tracer] to generate traces. +Micrometer uses the https://github.com/openzipkin/brave[Brave tracer] to generate traces. This integration enables Brave to use the https://github.com/openzipkin/zipkin-gcp/tree/main/propagation-stackdriver[`StackdriverTracePropagation`] propagation. A propagation is responsible for extracting trace context from an entity (e.g., an HTTP servlet request) and injecting trace context into an entity. @@ -46,7 +46,7 @@ A canonical example of the propagation usage is a web server that receives an HT In the case of `StackdriverTracePropagation`, first it looks for trace context in the https://github.com/openzipkin/b3-propagation[X-B3 headers] (`X-B3-TraceId`, `X-B3-SpanId`). If those are not found, `StackdriverTracePropagation` will fall back on `x-cloud-trace-context` key (e.g., an HTTP request header). -If you need different propagation behavior (e.g. relying primarily on `x-cloud-trace-context` in a mixed Spring / non-Spring application environment), Spring Cloud Sleuth allows such customization through the https://docs.spring.io/spring-cloud-sleuth/docs/current/reference/html/howto.html#how-to-change-context-propagation[`CUSTOM` propagation type]. +If you need different propagation behavior (e.g. relying primarily on `x-cloud-trace-context` in a mixed Spring / non-Spring application environment), Micrometer allows such customization through the https://micrometer.io/docs/contextPropagation[`CUSTOM` propagation type]. [TIP] ==== @@ -62,19 +62,19 @@ The value of the `x-cloud-trace-context` key can be formatted in three different Since Cloud Trace doesn't support span joins, a new span ID is always generated, regardless of the one specified in `x-cloud-trace-context`. `TRACE_TRUE` can either be `0` if the entity should be untraced, or `1` if it should be traced. -This field forces the decision of whether or not to trace the request; if omitted then the decision is deferred to the sampler. +This field forces the decision of whether to trace the request; if omitted then the decision is deferred to the sampler. ==== === Spring Boot Starter for Cloud Trace -Spring Boot Starter for Cloud Trace uses Spring Cloud Sleuth and auto-configures a https://github.com/openzipkin/zipkin-gcp/blob/main/sender-stackdriver/src/main/java/zipkin2/reporter/stackdriver/StackdriverSender.java[StackdriverSender] that sends the Sleuth’s trace information to Cloud Trace. +Spring Boot Starter for Cloud Trace uses Micrometer and autoconfigures a https://github.com/openzipkin/zipkin-gcp/blob/main/sender-stackdriver/src/main/java/zipkin2/reporter/stackdriver/StackdriverSender.java[StackdriverSender] that sends the Micrometer’s trace information to Cloud Trace. All configurations are optional: |=== | Name | Description | Required | Default value -| `spring.cloud.gcp.trace.enabled` | Auto-configure Spring Cloud Sleuth to send traces to Cloud Trace. | No | `true` +| `spring.cloud.gcp.trace.enabled` | Autoconfigure Micrometer to send traces to Cloud Trace. | No | `true` | `spring.cloud.gcp.trace.project-id` | Overrides the project ID from the <> | No | | `spring.cloud.gcp.trace.credentials.location` | Overrides the credentials location from the <> | No | | `spring.cloud.gcp.trace.credentials.encoded-key` | Overrides the credentials encoded key from the <> | No | @@ -91,21 +91,17 @@ All configurations are optional: | `spring.cloud.gcp.trace.pubsub.enabled` | (Experimental) Auto-configure Pub/Sub instrumentation for Trace. | No | `false` |=== -You can use core Spring Cloud Sleuth properties to control Sleuth’s sampling rate, etc. -Read https://cloud.spring.io/spring-cloud-sleuth/[Sleuth documentation] for more information on Sleuth configurations. +You can use core Micrometer properties to control Micrometer’s sampling rate, etc. +Read https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#actuator.micrometer-tracing[Spring Boot Tracing documentation] for more information on Micrometer configurations. For example, when you are testing to see the traces are going through, you can set the sampling rate to 100%. [source] ---- -spring.sleuth.sampler.probability=1 # Send 100% of the request traces to Cloud Trace. -spring.sleuth.web.skipPattern=(^cleanup.*|.+favicon.*) # Ignore some URL paths. -spring.sleuth.scheduled.enabled=false # disable executor 'async' traces +management.tracing.sampling.probability=1.0 # Send 100% of the request traces to Cloud Trace. ---- -WARNING: By default, Spring Cloud Sleuth auto-configuration instruments executor beans, which may cause recurring traces with the name `async` to appear in Cloud Trace if your application or one of its dependencies introduces scheduler beans into Spring application context. To avoid this noise, please disable automatic instrumentation of executors via `spring.sleuth.scheduled.enabled=false` in your application configuration. - -Spring Framework on Google Cloud Trace does override some Sleuth configurations: +Spring Framework on Google Cloud Trace does override some Micrometer configurations: - Always uses 128-bit Trace IDs. This is required by Cloud Trace. @@ -113,10 +109,8 @@ This is required by Cloud Trace. Span joins will share the span ID between the client and server Spans. Cloud Trace requires that every Span ID within a Trace to be unique, so Span joins are not supported. -=== Overriding the auto-configuration - -Spring Cloud Sleuth supports sending traces to multiple tracing systems as of version 2.1.0. -In order to get this to work, every tracing system needs to have a `Reporter` and `Sender`. +=== Overriding the autoconfiguration +You can send traces to multiple tracing systems. In order to get this to work, every tracing system needs to have a `Reporter` and `Sender`. If you want to override the provided beans you need to give them a specific name. To do this you can use respectively `StackdriverTraceAutoConfiguration.REPORTER_BEAN_NAME` and `StackdriverTraceAutoConfiguration.SENDER_BEAN_NAME`. @@ -170,9 +164,6 @@ It's set to `false` by default, but when set to `true`, trace spans will be crea ---- # Enable Pub/Sub tracing using this property spring.cloud.gcp.trace.pubsub.enabled=true - -# You should disable Spring Integration instrumentation by Sleuth as it's unnecessary when Pub/Sub tracing is enabled -spring.sleuth.integration.enabled=false ---- === Sample diff --git a/docs/src/main/md/first-page.md b/docs/src/main/md/first-page.md index c0079509de..253bde2259 100644 --- a/docs/src/main/md/first-page.md +++ b/docs/src/main/md/first-page.md @@ -24,7 +24,7 @@ Spring Framework to: - Exchange messages with Spring Integration using Google Cloud Pub/Sub on the background - - Trace the execution of your app with Spring Cloud Sleuth and Google + - Trace the execution of your app with Micrometer and Google Cloud Trace - Configure your app with Spring Cloud Config, backed up by the Google diff --git a/docs/src/main/md/logging.md b/docs/src/main/md/logging.md index 5413190184..0870261c59 100644 --- a/docs/src/main/md/logging.md +++ b/docs/src/main/md/logging.md @@ -22,8 +22,7 @@ logging service provided by Google Cloud. This module provides support for associating a web request trace ID with the corresponding log entries. It does so by retrieving the `X-B3-TraceId` value from the [Mapped Diagnostic Context -(MDC)](https://logback.qos.ch/manual/mdc.html), which is set by Spring -Cloud Sleuth. If Spring Cloud Sleuth isn’t used, the configured +(MDC)](https://logback.qos.ch/manual/mdc.html), which is set by Micrometer. If Spring Cloud Micrometer isn’t used, the configured `TraceIdExtractor` extracts the desired header value and sets it as the log entry’s trace ID. This allows grouping of log messages by request, for example, in the [Google Cloud Console Logs @@ -53,7 +52,7 @@ messages.
If Spring Framework on Google Cloud Trace is enabled, the logging module disables itself -and delegates log correlation to Spring Cloud Sleuth. +and delegates log correlation to Micrometer.
@@ -63,7 +62,7 @@ applications. Applications hosted on the Google Cloud include trace IDs under the `x-cloud-trace-context` header, which will be included in log -entries. However, if Sleuth is used the trace ID will be picked up from +entries. However, if Micrometer is used the trace ID will be picked up from the MDC. ### Logback Support @@ -212,7 +211,7 @@ configure the appender. The following properties are available:

includeMDC

true

-

Should all MDC properties be included. The MDC properties X-B3-TraceId, X-B3-SpanId and X-Span-Export provided by Spring Sleuth will get excluded as they get handled separately

+

Should all MDC properties be included. The MDC properties X-B3-TraceId, X-B3-SpanId and X-Span-Export provided by Micrometer will get excluded as they get handled separately

includeLoggerName

diff --git a/docs/src/main/md/trace.md b/docs/src/main/md/trace.md index 18ab267374..a3cf57bf41 100644 --- a/docs/src/main/md/trace.md +++ b/docs/src/main/md/trace.md @@ -1,18 +1,17 @@ ## Cloud Trace Google Cloud provides a managed distributed tracing service -called [Cloud Trace](https://cloud.google.com/trace/), and [Spring Cloud -Sleuth](https://cloud.spring.io/spring-cloud-sleuth/) can be used with +called [Cloud Trace](https://cloud.google.com/trace/), and [Micrometer](https://micrometer.io/) can be used with it to easily instrument Spring Boot applications for observability. -Typically, Spring Cloud Sleuth captures trace information and forwards -traces to services like Zipkin for storage and analysis. However, on +Typically, Micrometer captures trace information and forwards +traces to service like Zipkin for storage and analysis. However, on Google Cloud, instead of running and maintaining your own Zipkin instance and storage, you can use Cloud Trace to store traces, view trace details, generate latency distributions graphs, and generate performance regression reports. -This Spring Framework on Google Cloud starter can forward Spring Cloud Sleuth traces to +This Spring Framework on Google Cloud starter can forward Micrometer traces to Cloud Trace without an intermediary Zipkin server. Maven coordinates, @@ -47,7 +46,7 @@ those traces to Cloud Trace without modifying existing applications. ### Tracing -Spring Cloud Sleuth uses the [Brave +Micrometer uses the [Brave tracer](https://github.com/openzipkin/brave) to generate traces. This integration enables Brave to use the [`StackdriverTracePropagation`](https://github.com/openzipkin/zipkin-gcp/tree/main/propagation-stackdriver) @@ -72,12 +71,12 @@ in three different ways: `TRACE_ID` is a 32-character hexadecimal value that encodes a 128-bit number. -`SPAN_ID` is an unsigned long. Since Cloud Trace doesn’t support span +`SPAN_ID` is an unsigned long. Since Cloud Trace doesn't support span joins, a new span ID is always generated, regardless of the one specified in `x-cloud-trace-context`. `TRACE_TRUE` can either be `0` if the entity should be untraced, or `1` -if it should be traced. This field forces the decision of whether or not +if it should be traced. This field forces the decision of whether to trace the request; if omitted then the decision is deferred to the sampler. @@ -87,17 +86,17 @@ headers](https://github.com/openzipkin/b3-propagation). ### Spring Boot Starter for Cloud Trace -Spring Boot Starter for Cloud Trace uses Spring Cloud Sleuth and -auto-configures a +Spring Boot Starter for Cloud Trace uses Micrometer and +autoconfigures a [StackdriverSender](https://github.com/openzipkin/zipkin-gcp/blob/main/sender-stackdriver/src/main/java/zipkin2/reporter/stackdriver/StackdriverSender.java) -that sends the Sleuth’s trace information to Cloud Trace. +that sends the Micrometer’s trace information to Cloud Trace. All configurations are optional: | | | | | | --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------- | | Name | Description | Required | Default value | -| `spring.cloud.gcp.trace.enabled` | Auto-configure Spring Cloud Sleuth to send traces to Cloud Trace. | No | `true` | +| `spring.cloud.gcp.trace.enabled` | Auto-configure Micrometer to send traces to Cloud Trace. | No | `true` | | `spring.cloud.gcp.trace.project-id` | Overrides the project ID from the [Spring Framework on Google Cloud Module](#spring-framework-on-google-cloud-core) | No | | | `spring.cloud.gcp.trace.credentials.location` | Overrides the credentials location from the [Spring Framework on Google Cloud Module](#spring-framework-on-google-cloud-core) | No | | | `spring.cloud.gcp.trace.credentials.encoded-key` | Overrides the credentials encoded key from the [Spring Framework on Google Cloud Module](#spring-framework-on-google-cloud-core) | No | | @@ -113,31 +112,16 @@ All configurations are optional: | `spring.cloud.gcp.trace.server-response-timeout-ms` | Server response timeout in millis. | No | `5000` | | `spring.cloud.gcp.trace.pubsub.enabled` | (Experimental) Auto-configure Pub/Sub instrumentation for Trace. | No | `false` | -You can use core Spring Cloud Sleuth properties to control Sleuth’s -sampling rate, etc. Read [Sleuth -documentation](https://cloud.spring.io/spring-cloud-sleuth/) for more -information on Sleuth configurations. +You can use core Micrometer properties to control Micrometer’s +sampling rate, etc. Read [Spring Boot Tracing documentation](https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#actuator.micrometer-tracing) for more +information on Micrometer configurations. For example, when you are testing to see the traces are going through, you can set the sampling rate to 100%. - spring.sleuth.sampler.probability=1 # Send 100% of the request traces to Cloud Trace. - spring.sleuth.web.skipPattern=(^cleanup.*|.+favicon.*) # Ignore some URL paths. - spring.sleuth.scheduled.enabled=false # disable executor 'async' traces + management.tracing.sampling.probability=1.0 # Send 100% of the request traces to Cloud Trace. -
- -By default, Spring Cloud Sleuth auto-configuration instruments executor -beans, which may cause recurring traces with the name `async` to appear -in Cloud Trace if your application or one of its dependencies introduces -scheduler beans into Spring application context. To avoid this noise, -please disable automatic instrumentation of executors via -`spring.sleuth.scheduled.enabled=false` in your application -configuration. - -
- -Spring Framework on Google Cloud Trace does override some Sleuth configurations: +Spring Framework on Google Cloud Trace does override some Micrometer configurations: - Always uses 128-bit Trace IDs. This is required by Cloud Trace. @@ -145,13 +129,9 @@ Spring Framework on Google Cloud Trace does override some Sleuth configurations: the client and server Spans. Cloud Trace requires that every Span ID within a Trace to be unique, so Span joins are not supported. - - Uses `StackdriverHttpRequestParser` by default to populate - Stackdriver related fields. - -### Overriding the auto-configuration +### Overriding the autoconfiguration -Spring Cloud Sleuth supports sending traces to multiple tracing systems -as of version 2.1.0. In order to get this to work, every tracing system +You can send traces to multiple tracing systems. In order to get this to work, every tracing system needs to have a `Reporter` and `Sender`. If you want to override the provided beans you need to give them a specific name. To do this you can use respectively @@ -217,9 +197,6 @@ Spring Integration channel adapters, and the Spring Cloud Stream Binder. # Enable Pub/Sub tracing using this property spring.cloud.gcp.trace.pubsub.enabled=true - - # You should disable Spring Integration instrumentation by Sleuth as it's unnecessary when Pub/Sub tracing is enabled - spring.sleuth.integration.enabled=false ### Sample diff --git a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java index 75ed8e3ade..18ad5f892f 100644 --- a/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java +++ b/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java @@ -133,7 +133,7 @@ public SpanHandler stackdriverSpanHandler( @Bean @ConditionalOnMissingBean - ReporterMetrics sleuthReporterMetrics() { + ReporterMetrics reporterMetrics() { return ReporterMetrics.NOOP_METRICS; } diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/logging/StackdriverLoggingAutoConfigurationTests.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/logging/StackdriverLoggingAutoConfigurationTests.java index 999771507c..f23921b224 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/logging/StackdriverLoggingAutoConfigurationTests.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/logging/StackdriverLoggingAutoConfigurationTests.java @@ -91,7 +91,7 @@ void testRegularConfiguration() { } @Test - void testWithSleuth() { + void testWithStackdriverTraceAutoConfiguration() { this.contextRunner .withConfiguration(AutoConfigurations.of(StackdriverTraceAutoConfiguration.class)) .withPropertyValues("spring.cloud.gcp.project-id=pop-1") diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfigurationTests.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfigurationTests.java index 52fe8ec8f2..f18b93949a 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfigurationTests.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfigurationTests.java @@ -82,7 +82,7 @@ void init() { RefreshAutoConfiguration.class)) .withUserConfiguration(MockConfiguration.class) .withPropertyValues( - "spring.cloud.gcp.project-id=proj", "spring.sleuth.sampler.probability=1.0"); + "spring.cloud.gcp.project-id=proj"); } @Test diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java index 6580191ce6..a09079cb77 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TracePubSubAutoConfigurationTest.java @@ -70,7 +70,7 @@ void init() { // Prevent health-check from triggering a real call to Trace. .withBean(REPORTER_BEAN_NAME, Reporter.class, () -> mock(Reporter.class)) .withPropertyValues( - "spring.cloud.gcp.project-id=proj", "spring.sleuth.sampler.probability=1.0"); + "spring.cloud.gcp.project-id=proj"); } @Test diff --git a/spring-cloud-gcp-logging/src/main/java/com/google/cloud/spring/logging/StackdriverTraceConstants.java b/spring-cloud-gcp-logging/src/main/java/com/google/cloud/spring/logging/StackdriverTraceConstants.java index 8b3545fabb..d9c8e35ace 100644 --- a/spring-cloud-gcp-logging/src/main/java/com/google/cloud/spring/logging/StackdriverTraceConstants.java +++ b/spring-cloud-gcp-logging/src/main/java/com/google/cloud/spring/logging/StackdriverTraceConstants.java @@ -36,13 +36,13 @@ public interface StackdriverTraceConstants { /** The JSON field name for the trace-id. */ String TRACE_ID_ATTRIBUTE = "logging.googleapis.com/trace"; - /** The name of the MDC parameter Spring Sleuth is storing the trace id at. */ + /** The name of the MDC parameter Micrometer is storing the trace id at. */ String MDC_FIELD_TRACE_ID = "traceId"; - /** The name of the MDC parameter Spring Sleuth is storing the span id at. */ + /** The name of the MDC parameter Micrometer is storing the span id at. */ String MDC_FIELD_SPAN_ID = "spanId"; - /** The name of the MDC parameter Spring Sleuth is storing the span export information at. */ + /** The name of the MDC parameter Micrometer is storing the span export information at. */ String MDC_FIELD_SPAN_EXPORT = "X-Span-Export"; /** diff --git a/spring-cloud-gcp-samples/README.adoc b/spring-cloud-gcp-samples/README.adoc index 6793da65ae..0218e6279c 100644 --- a/spring-cloud-gcp-samples/README.adoc +++ b/spring-cloud-gcp-samples/README.adoc @@ -43,7 +43,7 @@ Populates database with values and reads them. Uses the https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/io/Resource.html[Spring Resource] abstraction to read and write files to https://cloud.google.com/storage/[Google Cloud Storage]. - link:spring-cloud-gcp-trace-sample[Spring Cloud GCP Trace Sample]: -Uses https://cloud.spring.io/spring-cloud-sleuth/[Spring Cloud Sleuth] to automatically generate trace IDs for requests to your application and store data about those requests in https://cloud.google.com/trace/[Google Stackdriver Trace]. +Uses https://micrometer.io/[Micrometer] to automatically generate trace IDs for requests to your application and store data about those requests in https://cloud.google.com/trace/[Google Stackdriver Trace]. - link:spring-cloud-gcp-vision-api-sample[Spring Cloud GCP Vision API Sample]: Provides an example of how to use Spring Cloud GCP to improve the general usability of Google Cloud diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/README.adoc b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/README.adoc index 38c36949c3..ff67dfd983 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/README.adoc +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/README.adoc @@ -4,7 +4,7 @@ This sample application demonstrates using the link:../../spring-cloud-gcp-start You can read about the Spring Boot Starter for Stackdriver Trace in more detail at the link:../../docs/src/main/asciidoc/trace.adoc[Spring Cloud GCP Reference Document Stackdriver Trace section]. -Similar content is also available in the https://codelabs.developers.google.com/codelabs/cloud-spring-cloud-gcp-trace/index.html[Distributed tracing with Spring Cloud Sleuth] codelab. +Similar content is also available in the https://codelabs.developers.google.com/codelabs/cloud-spring-cloud-gcp-trace/index.html[Distributed tracing with Micrometer] codelab. == Setup & Configuration diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/ExampleController.java b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/ExampleController.java index 4ede3e355f..4b40bfab1f 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/ExampleController.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/java/com/example/ExampleController.java @@ -26,7 +26,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -/** Sample REST Controller to demonstrate Spring Cloud Sleuth and Stackdriver Trace. */ @RestController public class ExampleController { diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/resources/application.properties b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/resources/application.properties index 6d08028307..6ff7321eb9 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/resources/application.properties +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/src/main/resources/application.properties @@ -1,9 +1,6 @@ # To send 100% of traces to Stackdriver Trace management.tracing.sampling.probability=1.0 -# To ignore some frequently used URL patterns that are not useful in trace -#spring.sleuth.web.skipPattern=(^cleanup.*|.+favicon.*) - # Enable Pub/Sub tracing using this property spring.cloud.gcp.trace.pubsub.enabled=true From df932492b0d110e7e387cf5d618d422ad98a3bea Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Wed, 14 Dec 2022 17:19:38 -0500 Subject: [PATCH 153/179] change errorprone java baseline to 17 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index b3123532e7..8ab6da78fd 100644 --- a/pom.xml +++ b/pom.xml @@ -503,9 +503,9 @@ - errorprone_java_9_and_up + errorprone_java_17_and_up - [9,] + [17,] From 8482a7ff32b22653d7b51bb3ae0dcd01d03f88f2 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Wed, 14 Dec 2022 17:44:09 -0500 Subject: [PATCH 154/179] polish code --- .../data/datastore/core/convert/TwoStepsConversions.java | 3 ++- .../core/convert/EntityPropertyValueProviderTests.java | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/TwoStepsConversions.java b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/TwoStepsConversions.java index 024d22c772..144f1c5ff6 100644 --- a/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/TwoStepsConversions.java +++ b/spring-cloud-gcp-data-datastore/src/main/java/com/google/cloud/spring/data/datastore/core/convert/TwoStepsConversions.java @@ -221,7 +221,8 @@ private T convertOnReadSingle(Object val, TypeInformation targetTypeInfor && typeTargets.getSecondStepTarget() == null) { // only first step was applied on write result = this.conversionService.convert(val, targetType); - } else if (typeTargets.getFirstStepTarget() != null) { + } else if (typeTargets.getFirstStepTarget() != null + && typeTargets.getSecondStepTarget() != null) { // both steps were applied Object secondStepVal = this.internalConversionService.convert(val, typeTargets.getFirstStepTarget()); diff --git a/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/convert/EntityPropertyValueProviderTests.java b/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/convert/EntityPropertyValueProviderTests.java index 0ffa69fa51..19c91d5cc8 100644 --- a/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/convert/EntityPropertyValueProviderTests.java +++ b/spring-cloud-gcp-data-datastore/src/test/java/com/google/cloud/spring/data/datastore/core/convert/EntityPropertyValueProviderTests.java @@ -127,9 +127,6 @@ void testException() { assertThatThrownBy(() -> provider.getPropertyValue(testDpe)) .isInstanceOf(DatastoreDataException.class) - // .hasMessage("Unable to read property boolField; nested exception is " - // + "com.google.cloud.spring.data.datastore.core.mapping.DatastoreDataException: " - // + "Unable to convert class java.lang.Long to class java.lang.Boolean") .hasMessageContaining("Unable to read property boolField") .hasStackTraceContaining("Unable to convert class java.lang.Long to class java.lang.Boolean"); } From d4abf85635b58afef301abf59082f1f7af6ac74b Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 15 Dec 2022 11:33:21 -0500 Subject: [PATCH 155/179] change version to 4.0 --- CHANGELOG.md | 2 +- README.adoc | 3 +- docs/pom.xml | 2 +- generated/pom.xml | 2 +- pom.xml | 2 +- spring-cloud-gcp-autoconfigure/pom.xml | 2 +- spring-cloud-gcp-bigquery/pom.xml | 2 +- spring-cloud-gcp-cloudfoundry/pom.xml | 2 +- spring-cloud-gcp-core/pom.xml | 2 +- spring-cloud-gcp-data-datastore/pom.xml | 3 +- spring-cloud-gcp-data-firestore/pom.xml | 2 +- spring-cloud-gcp-data-spanner/pom.xml | 3 +- spring-cloud-gcp-dependencies/pom.xml | 2 +- spring-cloud-gcp-kms/pom.xml | 2 +- spring-cloud-gcp-logging/pom.xml | 2 +- spring-cloud-gcp-pubsub-stream-binder/pom.xml | 2 +- spring-cloud-gcp-pubsub/pom.xml | 2 +- spring-cloud-gcp-samples/pom.xml | 2 +- .../spring-cloud-gcp-bigquery-sample/pom.xml | 2 +- .../spring-cloud-gcp-config-sample/pom.xml | 3 +- .../pom.xml | 2 +- .../pom.xml | 3 +- .../pom.xml | 2 +- .../spring-cloud-gcp-data-jpa-sample/pom.xml | 2 +- .../pom.xml | 3 +- .../pom.xml | 4 +- .../pom.xml | 4 +- .../spring-cloud-gcp-firestore-sample/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 4 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../spring-cloud-gcp-kms-sample/pom.xml | 2 +- .../spring-cloud-gcp-kotlin-samples/pom.xml | 4 +- .../pom.xml | 2 +- .../spring-cloud-gcp-logging-sample/pom.xml | 3 +- .../spring-cloud-gcp-metrics-sample/pom.xml | 3 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../spring-cloud-gcp-pubsub-sample/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 78 ------------------- .../pom.xml | 78 ------------------- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 47 ----------- .../spring-cloud-gcp-sql-mysql-sample/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../spring-cloud-gcp-trace-sample/pom.xml | 2 +- .../pom.xml | 2 +- .../spring-cloud-gcp-vision-ocr-demo/pom.xml | 2 +- spring-cloud-gcp-secretmanager/pom.xml | 2 +- spring-cloud-gcp-security-firebase/pom.xml | 2 +- spring-cloud-gcp-security-iap/pom.xml | 2 +- spring-cloud-gcp-starters/pom.xml | 2 +- .../spring-cloud-gcp-starter-bigquery/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../spring-cloud-gcp-starter-config/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../spring-cloud-gcp-starter-kms/pom.xml | 2 +- .../spring-cloud-gcp-starter-logging/pom.xml | 2 +- .../spring-cloud-gcp-starter-metrics/pom.xml | 2 +- .../spring-cloud-gcp-starter-pubsub/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 37 --------- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../spring-cloud-gcp-starter-storage/pom.xml | 2 +- .../spring-cloud-gcp-starter-trace/pom.xml | 2 +- .../spring-cloud-gcp-starter-vision/pom.xml | 2 +- .../spring-cloud-gcp-starter/pom.xml | 2 +- spring-cloud-gcp-storage/pom.xml | 2 +- spring-cloud-gcp-vision/pom.xml | 2 +- 94 files changed, 92 insertions(+), 344 deletions(-) delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/pom.xml delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/pom.xml delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/pom.xml delete mode 100644 spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql-r2dbc/pom.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index d7801f8868..a0217c9a1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ refer to the [commit history](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/commits/main) on GitHub. -## 3.5.0-SNAPSHOT +## 4.0.0 ## 3.4.0 diff --git a/README.adoc b/README.adoc index 3d4346b013..de572a06c9 100644 --- a/README.adoc +++ b/README.adoc @@ -54,6 +54,7 @@ This project has dependency and transitive dependencies on Spring Projects. The |2.0.x |https://github.com/spring-cloud/spring-cloud-release/wiki/Spring-Cloud-2020.0-Release-Notes[2020.0.x] (3.0/Illford) |2.4.x, 2.5.x|5.3.x| No |3.x | https://github.com/spring-cloud/spring-cloud-release/wiki/Spring-Cloud-2021.0-Release-Notes[2021.0.x] (3.1/Jubilee) |2.6.x, 2.7.x | 5.3.x| Yes +|4.x | https://github.com/spring-cloud/spring-cloud-release/wiki/Spring-Cloud-2022.0-Release-Notes[2022.0.x] (4.0/Kilburn) |https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Release-Notes[3.x]| https://github.com/spring-projects/spring-framework/wiki/What%27s-New-in-Spring-Framework-6.x[6.x]| Yes |=== == Spring Initializr @@ -76,7 +77,7 @@ This will allow you to not specify versions for any of the Maven dependencies an com.google.cloud spring-cloud-gcp-dependencies - 3.4.0 + 4.0.0 pom import diff --git a/docs/pom.xml b/docs/pom.xml index 792e66bc7a..4b0e31cfb4 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -13,7 +13,7 @@ Spring Framework on Google Cloud Documentation com.google.cloud spring-cloud-gcp-docs - 3.5.0-SNAPSHOT + 4.0.0 pom diff --git a/generated/pom.xml b/generated/pom.xml index b2c279c031..bbd733ba8b 100644 --- a/generated/pom.xml +++ b/generated/pom.xml @@ -5,7 +5,7 @@ spring-cloud-gcp com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/pom.xml b/pom.xml index 8ab6da78fd..ab857e430e 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.google.cloud spring-cloud-gcp - 3.5.0-SNAPSHOT + 4.0.0 Spring Framework on Google Cloud Spring Framework on Google Cloud diff --git a/spring-cloud-gcp-autoconfigure/pom.xml b/spring-cloud-gcp-autoconfigure/pom.xml index ab81de4bf9..230dadf765 100644 --- a/spring-cloud-gcp-autoconfigure/pom.xml +++ b/spring-cloud-gcp-autoconfigure/pom.xml @@ -5,7 +5,7 @@ spring-cloud-gcp com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-bigquery/pom.xml b/spring-cloud-gcp-bigquery/pom.xml index ed215ca4a6..faed0e399e 100644 --- a/spring-cloud-gcp-bigquery/pom.xml +++ b/spring-cloud-gcp-bigquery/pom.xml @@ -7,7 +7,7 @@ spring-cloud-gcp com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 spring-cloud-gcp-bigquery diff --git a/spring-cloud-gcp-cloudfoundry/pom.xml b/spring-cloud-gcp-cloudfoundry/pom.xml index dd8f12cd6c..3911aa1b10 100644 --- a/spring-cloud-gcp-cloudfoundry/pom.xml +++ b/spring-cloud-gcp-cloudfoundry/pom.xml @@ -7,7 +7,7 @@ spring-cloud-gcp com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 spring-cloud-gcp-cloudfoundry diff --git a/spring-cloud-gcp-core/pom.xml b/spring-cloud-gcp-core/pom.xml index 839a1952a2..a2a34ab001 100644 --- a/spring-cloud-gcp-core/pom.xml +++ b/spring-cloud-gcp-core/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 spring-cloud-gcp-core diff --git a/spring-cloud-gcp-data-datastore/pom.xml b/spring-cloud-gcp-data-datastore/pom.xml index 552fbbfc89..bac21637f6 100644 --- a/spring-cloud-gcp-data-datastore/pom.xml +++ b/spring-cloud-gcp-data-datastore/pom.xml @@ -7,9 +7,8 @@ spring-cloud-gcp com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 - com.google.cloud spring-cloud-gcp-data-datastore Spring Framework on Google Cloud Module - Datastore Spring Framework on Google Cloud Datastore Module diff --git a/spring-cloud-gcp-data-firestore/pom.xml b/spring-cloud-gcp-data-firestore/pom.xml index 28ec958a04..f928d1aa2e 100644 --- a/spring-cloud-gcp-data-firestore/pom.xml +++ b/spring-cloud-gcp-data-firestore/pom.xml @@ -7,7 +7,7 @@ spring-cloud-gcp com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 spring-cloud-gcp-data-firestore diff --git a/spring-cloud-gcp-data-spanner/pom.xml b/spring-cloud-gcp-data-spanner/pom.xml index a699ec4f39..0b0ebb68bc 100644 --- a/spring-cloud-gcp-data-spanner/pom.xml +++ b/spring-cloud-gcp-data-spanner/pom.xml @@ -7,9 +7,8 @@ spring-cloud-gcp com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 - com.google.cloud spring-cloud-gcp-data-spanner Spring Framework on Google Cloud Module - Cloud Spanner Spring Framework on Google Cloud Cloud Spanner Module diff --git a/spring-cloud-gcp-dependencies/pom.xml b/spring-cloud-gcp-dependencies/pom.xml index 3a7f8d83fb..65a2f3fb3f 100644 --- a/spring-cloud-gcp-dependencies/pom.xml +++ b/spring-cloud-gcp-dependencies/pom.xml @@ -11,7 +11,7 @@ com.google.cloud spring-cloud-gcp-dependencies - 3.5.0-SNAPSHOT + 4.0.0 Spring Framework on Google Cloud Dependencies Spring Framework on Google Cloud Dependencies diff --git a/spring-cloud-gcp-kms/pom.xml b/spring-cloud-gcp-kms/pom.xml index 8b2d079f37..867eb72cb6 100644 --- a/spring-cloud-gcp-kms/pom.xml +++ b/spring-cloud-gcp-kms/pom.xml @@ -4,7 +4,7 @@ com.google.cloud spring-cloud-gcp - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-logging/pom.xml b/spring-cloud-gcp-logging/pom.xml index 9d841e144d..018859745b 100644 --- a/spring-cloud-gcp-logging/pom.xml +++ b/spring-cloud-gcp-logging/pom.xml @@ -5,7 +5,7 @@ com.google.cloud spring-cloud-gcp - 3.5.0-SNAPSHOT + 4.0.0 diff --git a/spring-cloud-gcp-pubsub-stream-binder/pom.xml b/spring-cloud-gcp-pubsub-stream-binder/pom.xml index bf6445a79d..874653ca38 100644 --- a/spring-cloud-gcp-pubsub-stream-binder/pom.xml +++ b/spring-cloud-gcp-pubsub-stream-binder/pom.xml @@ -5,7 +5,7 @@ spring-cloud-gcp com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-pubsub/pom.xml b/spring-cloud-gcp-pubsub/pom.xml index dfc79c6a3a..93c06cad76 100644 --- a/spring-cloud-gcp-pubsub/pom.xml +++ b/spring-cloud-gcp-pubsub/pom.xml @@ -5,7 +5,7 @@ com.google.cloud spring-cloud-gcp - 3.5.0-SNAPSHOT + 4.0.0 spring-cloud-gcp-pubsub diff --git a/spring-cloud-gcp-samples/pom.xml b/spring-cloud-gcp-samples/pom.xml index 76a267417e..941d529843 100644 --- a/spring-cloud-gcp-samples/pom.xml +++ b/spring-cloud-gcp-samples/pom.xml @@ -13,7 +13,7 @@ Spring Framework on Google Cloud Code Samples spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 pom 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/pom.xml index 4171acc2cc..06b13dd5a3 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-config-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-config-sample/pom.xml index 4007956920..ea720c88b9 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-config-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-config-sample/pom.xml @@ -7,11 +7,10 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 - com.google.cloud spring-cloud-gcp-config-sample Spring Framework on Google Cloud Code Sample - Runtime Configuration diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml index ece955083b..e6352b1257 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-sample/pom.xml index 5605cfab9c..91f30d9922 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-sample/pom.xml @@ -6,11 +6,10 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 - com.google.cloud spring-cloud-gcp-data-datastore-sample Spring Framework on Google Cloud Code Sample - Datastore diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-firestore-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-data-firestore-sample/pom.xml index b8fbfa170b..f8647acbd1 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-firestore-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-firestore-sample/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-jpa-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-data-jpa-sample/pom.xml index b7d0e9d171..a59063fdce 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-jpa-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-jpa-sample/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-multi-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-data-multi-sample/pom.xml index 0ccf645da4..4bc1430634 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-multi-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-multi-sample/pom.xml @@ -6,11 +6,10 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 - com.google.cloud Spring Framework on Google Cloud Code Sample - Multi-Spring-Data-Module spring-cloud-gcp-data-multi-sample diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/pom.xml index 056d439c63..d274319842 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/pom.xml @@ -6,11 +6,9 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 - - com.google.cloud spring-cloud-gcp-data-spanner-repository-sample Spring Framework on Google Cloud Code Sample - Spanner Repository diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-template-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-template-sample/pom.xml index e2ecc77637..ffd4f61e02 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-template-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-template-sample/pom.xml @@ -6,11 +6,9 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 - - com.google.cloud spring-cloud-gcp-data-spanner-template-sample Spring Framework on Google Cloud Code Sample - Spanner Template diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-firestore-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-firestore-sample/pom.xml index be8cb206ee..d60608619b 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-firestore-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-firestore-sample/pom.xml @@ -7,7 +7,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-json-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-json-sample/pom.xml index 8698a712ed..0870d105c3 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-json-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-json-sample/pom.xml @@ -7,7 +7,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/pom.xml index 7fd7a8e0e5..93993c6063 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/pom.xml @@ -5,12 +5,10 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 spring-cloud-gcp-integration-pubsub-sample - com.google.cloud - 4.0.0 pom Spring Framework on Google Cloud Code Sample - Spring Integration Pub/Sub Channel Adapters diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-polling-receiver/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-polling-receiver/pom.xml index 780e758173..c2a9dd2cf6 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-polling-receiver/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-polling-receiver/pom.xml @@ -7,7 +7,7 @@ spring-cloud-gcp-integration-pubsub-sample com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-receiver/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-receiver/pom.xml index e50093fc59..f5f9b264a9 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-receiver/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-receiver/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp-integration-pubsub-sample com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-sender/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-sender/pom.xml index 66821a88df..b8932ca8a2 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-sender/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-sender/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp-integration-pubsub-sample com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-test/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-test/pom.xml index f13ce255d1..fbea132d32 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-test/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-test/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp-integration-pubsub-sample com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-storage-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-storage-sample/pom.xml index edad8e8241..6a246b3db2 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-storage-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-storage-sample/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-kms-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-kms-sample/pom.xml index e32aa8014f..06e874404f 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-kms-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-kms-sample/pom.xml @@ -7,7 +7,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/pom.xml index 2b7b5219e7..2c57de558f 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/pom.xml @@ -7,11 +7,11 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 spring-cloud-gcp-kotlin-samples - 3.5.0-SNAPSHOT + 4.0.0 Spring Framework on Google Cloud Code Samples - Kotlin diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/pom.xml index 550c7711f1..471e66a349 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp-kotlin-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-logging-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-logging-sample/pom.xml index 37c14c9dfe..a3250c9e28 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-logging-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-logging-sample/pom.xml @@ -3,7 +3,6 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.google.cloud spring-cloud-gcp-logging-sample Spring Framework on Google Cloud Code Sample - Logging @@ -11,7 +10,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-metrics-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-metrics-sample/pom.xml index 40fb0b6dd9..4e76ed469d 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-metrics-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-metrics-sample/pom.xml @@ -3,7 +3,6 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.google.cloud spring-cloud-gcp-metrics-sample Spring Framework on Google Cloud Code Sample - Metrics @@ -11,7 +10,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/pom.xml index fdd009d1e1..6c44da7049 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/pom.xml @@ -5,7 +5,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-client/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-client/pom.xml index 041d4c9086..1d804a65d5 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-client/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-client/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp-pubsub-bus-config-sample com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-server-github/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-server-github/pom.xml index a24f8deacc..b626d2a556 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-server-github/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-server-github/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp-pubsub-bus-config-sample com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-server-local/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-server-local/pom.xml index 855ba95c9b..e9194198f8 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-server-local/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-server-local/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp-pubsub-bus-config-sample com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-test/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-test/pom.xml index 93b02db62b..3106a4348e 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-test/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-test/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp-pubsub-bus-config-sample com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-reactive-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-reactive-sample/pom.xml index 00b97d2942..5163d576fe 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-reactive-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-reactive-sample/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/pom.xml index 8a5e0c6e38..b00c4d1d77 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/pom.xml @@ -7,7 +7,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-dead-letter-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-dead-letter-sample/pom.xml index e18f64ba26..6b205e25ec 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-dead-letter-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-dead-letter-sample/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/pom.xml index a521ae6a2a..17f616583d 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/pom.xml @@ -5,7 +5,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-sink/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-sink/pom.xml index 22c3c1d283..f655b94219 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-sink/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-sink/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp-pubsub-stream-functional-sample com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-source/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-source/pom.xml index 431710fbad..f1b03f881e 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-source/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-source/pom.xml @@ -5,7 +5,7 @@ spring-cloud-gcp-pubsub-stream-functional-sample com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-test/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-test/pom.xml index 4bc1053b1e..c1d8ab4eaf 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-test/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-test/pom.xml @@ -5,7 +5,7 @@ spring-cloud-gcp-pubsub-stream-functional-sample com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/pom.xml deleted file mode 100644 index d3aadb08cd..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-polling-sample/pom.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - spring-cloud-gcp-samples - com.google.cloud - 3.5.0-SNAPSHOT - - 4.0.0 - - spring-cloud-gcp-pubsub-stream-polling-sample - Spring Framework on Google Cloud Code Sample - Pub/Sub Binder for Spring Cloud Stream Polling - - - - - - com.google.cloud - spring-cloud-gcp-dependencies - ${project.version} - pom - import - - - - - - - com.google.cloud - spring-cloud-gcp-starter-pubsub - - - com.google.cloud - spring-cloud-gcp-pubsub-stream-binder - - - org.springframework.boot - spring-boot-starter-web - - - - - org.awaitility - awaitility - 4.2.0 - test - - - junit - junit - test - - - org.springframework.boot - spring-boot-starter-test - test - - - commons-io - commons-io - 2.11.0 - test - - - - - - - maven-deploy-plugin - - true - - - - - diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/pom.xml deleted file mode 100644 index 6de7ec5d91..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-sample/pom.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - spring-cloud-gcp-samples - com.google.cloud - 3.5.0-SNAPSHOT - - 4.0.0 - - spring-cloud-gcp-pubsub-stream-sample - Spring Framework on Google Cloud Code Sample - Pub/Sub Binder for Spring Cloud Stream - - - - - - com.google.cloud - spring-cloud-gcp-dependencies - ${project.version} - pom - import - - - - - - - com.google.cloud - spring-cloud-gcp-starter-pubsub - - - com.google.cloud - spring-cloud-gcp-pubsub-stream-binder - - - org.springframework.boot - spring-boot-starter-web - - - - - org.awaitility - awaitility - 4.2.0 - test - - - junit - junit - test - - - org.springframework.boot - spring-boot-starter-test - test - - - commons-io - commons-io - 2.11.0 - test - - - - - - - maven-deploy-plugin - - true - - - - - diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-secretmanager-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-secretmanager-sample/pom.xml index 83dc2d0ba5..59a9515d11 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-secretmanager-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-secretmanager-sample/pom.xml @@ -7,7 +7,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-security-firebase-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-security-firebase-sample/pom.xml index 610eecf342..8edc2e38f7 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-security-firebase-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-security-firebase-sample/pom.xml @@ -7,7 +7,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-security-iap-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-security-iap-sample/pom.xml index 4e952fa632..514ed19e5c 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-security-iap-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-security-iap-sample/pom.xml @@ -12,7 +12,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/pom.xml deleted file mode 100644 index e2d9b59644..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-r2dbc-sample/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - spring-cloud-gcp-samples - com.google.cloud - 3.5.0-SNAPSHOT - - 4.0.0 - - spring-cloud-gcp-sql-mysql-r2dbc-sample - Spring Framework on Google Cloud Code Sample - R2DBC MySQL - - - - - - com.google.cloud - spring-cloud-gcp-dependencies - ${project.version} - pom - import - - - - - - - com.google.cloud - spring-cloud-gcp-starter-sql-mysql-r2dbc - - - org.springframework.boot - spring-boot-starter-webflux - - - - - org.springframework.boot - spring-boot-starter-test - test - - - - \ No newline at end of file diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-sample/pom.xml index 12dd45ed44..3c5dead8b7 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-sample/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-r2dbc-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-r2dbc-sample/pom.xml index 4dcf874de6..b94e30667c 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-r2dbc-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-r2dbc-sample/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-sample/pom.xml index 4bb5c7f23c..dc1b477412 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-sample/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-storage-resource-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-storage-resource-sample/pom.xml index 76be555604..9afebb08ec 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-storage-resource-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-storage-resource-sample/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/pom.xml index ef977419cf..96651f3627 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/pom.xml @@ -10,7 +10,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-vision-api-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-vision-api-sample/pom.xml index 2528acbe49..a790e9d333 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-vision-api-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-vision-api-sample/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-vision-ocr-demo/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-vision-ocr-demo/pom.xml index b10b1e35a5..f7b7b0dfe4 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-vision-ocr-demo/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-vision-ocr-demo/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp-samples com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-secretmanager/pom.xml b/spring-cloud-gcp-secretmanager/pom.xml index 6b7cb2554a..b976c905c8 100644 --- a/spring-cloud-gcp-secretmanager/pom.xml +++ b/spring-cloud-gcp-secretmanager/pom.xml @@ -5,7 +5,7 @@ spring-cloud-gcp com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-security-firebase/pom.xml b/spring-cloud-gcp-security-firebase/pom.xml index 3678f47f22..0f7bed9dc4 100644 --- a/spring-cloud-gcp-security-firebase/pom.xml +++ b/spring-cloud-gcp-security-firebase/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 diff --git a/spring-cloud-gcp-security-iap/pom.xml b/spring-cloud-gcp-security-iap/pom.xml index d1e5f38372..9fbae99f57 100644 --- a/spring-cloud-gcp-security-iap/pom.xml +++ b/spring-cloud-gcp-security-iap/pom.xml @@ -6,7 +6,7 @@ com.google.cloud spring-cloud-gcp - 3.5.0-SNAPSHOT + 4.0.0 spring-cloud-gcp-security-iap diff --git a/spring-cloud-gcp-starters/pom.xml b/spring-cloud-gcp-starters/pom.xml index 43f30eb746..8d38116fd9 100644 --- a/spring-cloud-gcp-starters/pom.xml +++ b/spring-cloud-gcp-starters/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 pom Spring Framework on Google Cloud Starters diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-bigquery/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-bigquery/pom.xml index cba0a81378..a678889b84 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-bigquery/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-bigquery/pom.xml @@ -5,7 +5,7 @@ spring-cloud-gcp-starters com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-bus-pubsub/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-bus-pubsub/pom.xml index 7935af9981..1695551ff1 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-bus-pubsub/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-bus-pubsub/pom.xml @@ -6,7 +6,7 @@ com.google.cloud spring-cloud-gcp-starters - 3.5.0-SNAPSHOT + 4.0.0 spring-cloud-gcp-starter-bus-pubsub diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-cloudfoundry/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-cloudfoundry/pom.xml index 782440c776..482d5aaa52 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-cloudfoundry/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-cloudfoundry/pom.xml @@ -5,7 +5,7 @@ spring-cloud-gcp-starters com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-config/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-config/pom.xml index 22474131ba..ec445ef147 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-config/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-config/pom.xml @@ -4,7 +4,7 @@ com.google.cloud spring-cloud-gcp-starters - 3.5.0-SNAPSHOT + 4.0.0 spring-cloud-gcp-starter-config Spring Framework on Google Cloud Starter - Config diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-datastore/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-datastore/pom.xml index f473f819eb..aad8158e99 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-datastore/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-datastore/pom.xml @@ -5,7 +5,7 @@ com.google.cloud spring-cloud-gcp-starters - 3.5.0-SNAPSHOT + 4.0.0 spring-cloud-gcp-starter-data-datastore Spring Framework on Google Cloud Starter - Datastore diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-firestore/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-firestore/pom.xml index b993a06549..a30670aa28 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-firestore/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-firestore/pom.xml @@ -5,7 +5,7 @@ com.google.cloud spring-cloud-gcp-starters - 3.5.0-SNAPSHOT + 4.0.0 spring-cloud-gcp-starter-data-firestore Spring Framework on Google Cloud Starter - Firestore diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-spanner/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-spanner/pom.xml index 0666ea0c97..3404bef9f8 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-spanner/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-spanner/pom.xml @@ -5,7 +5,7 @@ com.google.cloud spring-cloud-gcp-starters - 3.5.0-SNAPSHOT + 4.0.0 spring-cloud-gcp-starter-data-spanner Spring Framework on Google Cloud Starter - Spanner diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-firestore/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-firestore/pom.xml index 74be9b091a..3aa16596c5 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-firestore/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-firestore/pom.xml @@ -6,7 +6,7 @@ com.google.cloud spring-cloud-gcp-starters - 3.5.0-SNAPSHOT + 4.0.0 spring-cloud-gcp-starter-firestore Spring Framework on Google Cloud Starter - Firestore diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-kms/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-kms/pom.xml index cbe6b4fe5d..7035ba1b39 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-kms/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-kms/pom.xml @@ -5,7 +5,7 @@ com.google.cloud spring-cloud-gcp-starters - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-logging/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-logging/pom.xml index 0fa726ab7f..092e0d8ec5 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-logging/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-logging/pom.xml @@ -5,7 +5,7 @@ spring-cloud-gcp-starters com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-metrics/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-metrics/pom.xml index 1ad23c0456..e758c6d3b6 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-metrics/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-metrics/pom.xml @@ -5,7 +5,7 @@ com.google.cloud spring-cloud-gcp-starters - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-pubsub/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-pubsub/pom.xml index 94e89fb795..3f45f43f85 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-pubsub/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-pubsub/pom.xml @@ -4,7 +4,7 @@ com.google.cloud spring-cloud-gcp-starters - 3.5.0-SNAPSHOT + 4.0.0 spring-cloud-gcp-starter-pubsub Spring Framework on Google Cloud Starter - Pub/Sub diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-secretmanager/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-secretmanager/pom.xml index 4bb08432c2..e176e5fcbc 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-secretmanager/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-secretmanager/pom.xml @@ -5,7 +5,7 @@ com.google.cloud spring-cloud-gcp-starters - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-security-firebase/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-security-firebase/pom.xml index 2ab6196352..e9e35b39a1 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-security-firebase/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-security-firebase/pom.xml @@ -5,7 +5,7 @@ spring-cloud-gcp-starters com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-security-iap/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-security-iap/pom.xml index 7a5d152ca2..79b4b3bd91 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-security-iap/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-security-iap/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp-starters com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql-r2dbc/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql-r2dbc/pom.xml deleted file mode 100644 index ef973a84d8..0000000000 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql-r2dbc/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - spring-cloud-gcp-starters - com.google.cloud - 3.5.0-SNAPSHOT - - 4.0.0 - - spring-cloud-gcp-starter-sql-mysql-r2dbc - Spring Framework on Google Cloud Starter - R2DBC MySQL - https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/main/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql-r2dbc - - - - com.google.cloud - spring-cloud-gcp-starter - - - org.springframework.boot - spring-boot-starter-data-r2dbc - - - - - com.google.cloud.sql - cloud-sql-connector-r2dbc-mysql - - - dev.miku - r2dbc-mysql - - - - diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql/pom.xml index 58db180a83..78c3041f17 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql/pom.xml @@ -5,7 +5,7 @@ spring-cloud-gcp-starters com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-postgres-r2dbc/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-postgres-r2dbc/pom.xml index d06dc2b13b..7f742b38bd 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-postgres-r2dbc/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-postgres-r2dbc/pom.xml @@ -5,7 +5,7 @@ spring-cloud-gcp-starters com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-postgresql/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-postgresql/pom.xml index 1512206dfd..2ad87da73b 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-postgresql/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-postgresql/pom.xml @@ -5,7 +5,7 @@ spring-cloud-gcp-starters com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-storage/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-storage/pom.xml index 2687f0516e..b0e446e076 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-storage/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-storage/pom.xml @@ -5,7 +5,7 @@ com.google.cloud spring-cloud-gcp-starters - 3.5.0-SNAPSHOT + 4.0.0 spring-cloud-gcp-starter-storage Spring Framework on Google Cloud Starter - Storage diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml index 08f5d45485..d9378b7052 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml @@ -5,7 +5,7 @@ spring-cloud-gcp-starters com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-vision/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-vision/pom.xml index 04468eab01..896db3fb20 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-vision/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-vision/pom.xml @@ -5,7 +5,7 @@ spring-cloud-gcp-starters com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter/pom.xml index 165f0c2dca..89a4ac15ba 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter/pom.xml @@ -4,7 +4,7 @@ com.google.cloud spring-cloud-gcp-starters - 3.5.0-SNAPSHOT + 4.0.0 spring-cloud-gcp-starter Spring Framework on Google Cloud Starter - Support diff --git a/spring-cloud-gcp-storage/pom.xml b/spring-cloud-gcp-storage/pom.xml index 21cced5bc2..0ac72f98a6 100644 --- a/spring-cloud-gcp-storage/pom.xml +++ b/spring-cloud-gcp-storage/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 spring-cloud-gcp-storage Spring Framework on Google Cloud Module - Storage diff --git a/spring-cloud-gcp-vision/pom.xml b/spring-cloud-gcp-vision/pom.xml index b4d0de9341..563589700b 100644 --- a/spring-cloud-gcp-vision/pom.xml +++ b/spring-cloud-gcp-vision/pom.xml @@ -6,7 +6,7 @@ spring-cloud-gcp com.google.cloud - 3.5.0-SNAPSHOT + 4.0.0 4.0.0 From 7fa2d53d08c30923e37d356fc5d444c174566772 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 15 Dec 2022 11:58:44 -0500 Subject: [PATCH 156/179] renew copyright --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ab857e430e..da7bbcc17f 100644 --- a/pom.xml +++ b/pom.xml @@ -748,7 +748,7 @@ Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0 - Copyright 2015-2020 the original author or authors. + Copyright 2015-2022 the original author or authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From f359098d41d157b9a3f8ba318f741d3113a63114 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 15 Dec 2022 11:59:08 -0500 Subject: [PATCH 157/179] remove parent in dependencies pom --- spring-cloud-gcp-dependencies/pom.xml | 38 ++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/spring-cloud-gcp-dependencies/pom.xml b/spring-cloud-gcp-dependencies/pom.xml index 65a2f3fb3f..f4636604fa 100644 --- a/spring-cloud-gcp-dependencies/pom.xml +++ b/spring-cloud-gcp-dependencies/pom.xml @@ -2,13 +2,6 @@ 4.0.0 - - org.springframework.cloud - spring-cloud-dependencies-parent - 4.0.0-RC3 - - - com.google.cloud spring-cloud-gcp-dependencies 4.0.0 @@ -380,4 +373,35 @@ + + + Apache License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0 + + Copyright 2015-2022 the original author or authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. + + See the License for the specific language governing permissions and + limitations under the License. + + + + + + + Google + http://cloud.google.com + + + From 010296fb07605dce3f0b76ee1d94524610b48803 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 19 Dec 2022 09:49:21 -0500 Subject: [PATCH 158/179] remove experimental dependencies --- pom.xml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/pom.xml b/pom.xml index da7bbcc17f..bc96a0d96e 100644 --- a/pom.xml +++ b/pom.xml @@ -42,7 +42,6 @@ 3.0.0 1.0.4 2.4.1 - 0.10.5 1.0.0 @@ -145,11 +144,6 @@ java-cfenv-test-support ${java-cfenv.version} - - org.springframework.experimental - spring-native-configuration - ${spring-native.version} - io.micrometer @@ -159,11 +153,6 @@ import - - org.springframework.experimental - spring-aot - ${spring-native.version} - From def6ec33dedb9055974ed4576c0d231a68d68615 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 19 Dec 2022 10:05:21 -0500 Subject: [PATCH 159/179] change spring cloud dependencies to 2022.0 --- pom.xml | 2 +- spring-cloud-gcp-pubsub-stream-binder/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index bc96a0d96e..5455c2e221 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,7 @@ - 2022.0.0-RC2 + 2022.0.0 3.0.0 1.0.4 2.4.1 diff --git a/spring-cloud-gcp-pubsub-stream-binder/pom.xml b/spring-cloud-gcp-pubsub-stream-binder/pom.xml index 874653ca38..a8c5819e37 100644 --- a/spring-cloud-gcp-pubsub-stream-binder/pom.xml +++ b/spring-cloud-gcp-pubsub-stream-binder/pom.xml @@ -29,7 +29,7 @@ org.springframework.cloud - spring-cloud-stream-binder-test + spring-cloud-stream-test-support test From 6753e61fa86d4a57aef173eb27c955a2819f4e5f Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 19 Dec 2022 10:28:27 -0500 Subject: [PATCH 160/179] upgrade spring-cloud-config dependency to 4.0.0 --- .../spring-cloud-gcp-pubsub-bus-config-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/pom.xml index 6c44da7049..bd85925449 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/pom.xml @@ -14,7 +14,7 @@ Spring Framework on Google Cloud Code Sample - Pub/Sub Bus Configuration Management - 4.0.0-RC2 + 4.0.0 From d0fbfea198980e702fe4413efc925a320a7a7b32 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 19 Dec 2022 10:29:07 -0500 Subject: [PATCH 161/179] remove spring milestone repo in production --- pom.xml | 12 ------------ spring-cloud-gcp-dependencies/pom.xml | 13 ------------- .../spring-cloud-gcp-data-jpa-sample/pom.xml | 8 -------- .../spring-cloud-gcp-security-iap-sample/pom.xml | 1 - 4 files changed, 34 deletions(-) diff --git a/pom.xml b/pom.xml index 5455c2e221..c58d3ac310 100644 --- a/pom.xml +++ b/pom.xml @@ -203,18 +203,6 @@ test - - - spring-milestone - https://repo.spring.io/milestone - - - - - spring-milestone - https://repo.spring.io/milestone - - diff --git a/spring-cloud-gcp-dependencies/pom.xml b/spring-cloud-gcp-dependencies/pom.xml index f4636604fa..e11c35c1ad 100644 --- a/spring-cloud-gcp-dependencies/pom.xml +++ b/spring-cloud-gcp-dependencies/pom.xml @@ -274,19 +274,6 @@ - - - spring-milestone - https://repo.spring.io/milestone - - - - - spring-milestone - https://repo.spring.io/milestone - - - - - org.awaitility diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-security-iap-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-security-iap-sample/pom.xml index 514ed19e5c..e6e785d74f 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-security-iap-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-security-iap-sample/pom.xml @@ -3,7 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.google.cloud spring-cloud-gcp-security-iap-sample Spring Framework on Google Cloud Code Sample - IAP Spring Cloud IAP Security Sample From 0b9c4045a01ca685f5cad5af5a99f9de8cb04bf2 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 19 Dec 2022 21:52:25 -0500 Subject: [PATCH 162/179] change datastore basic example to web-based app --- spring-cloud-gcp-samples/pom.xml | 13 --- .../README.adoc | 75 +++++++++---- .../pom.xml | 5 - .../main/java/com/example/BookController.java | 75 +++++++++++++ .../com/example/CustomPromptProvider.java | 33 ------ .../example/DatastoreBookshelfExample.java | 47 -------- ...storeBookshelfExampleIntegrationTests.java | 103 +++++++++++++----- 7 files changed, 202 insertions(+), 149 deletions(-) create mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/main/java/com/example/BookController.java delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/main/java/com/example/CustomPromptProvider.java diff --git a/spring-cloud-gcp-samples/pom.xml b/spring-cloud-gcp-samples/pom.xml index 34c7d06c59..2c03ae4372 100644 --- a/spring-cloud-gcp-samples/pom.xml +++ b/spring-cloud-gcp-samples/pom.xml @@ -108,19 +108,6 @@ - - - spring-milestone - https://repo.spring.io/milestone - - - - - spring-milestone - https://repo.spring.io/milestone - - - diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/README.adoc b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/README.adoc index 80c19061f9..4eb0258fcb 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/README.adoc +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/README.adoc @@ -21,35 +21,68 @@ Then, uncomment the `spring.cloud.gcp.datastore.credentials.location` property i + `$ mvn spring-boot:run` -. Use shell to create, find and remove books. -Available commands: +. Use the following commands to create 4 books + ---- -save-book <author> <year> -find-all-books -find-by-author <author> -find-by-year-greater-than <year> -find-by-author-year <author> <year> -remove-all-books +curl --location --request POST 'localhost:8080/saveBook' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "title": "The Moon Is a Harsh Mistress", + "author": "Robert A. Heinlein", + "year": 1966 +}' + +curl --location --request POST 'localhost:8080/saveBook' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "title": "Stranger in a Strange Land", + "author": "Robert A. Heinlein", + "year": 1961 +}' + +curl --location --request POST 'localhost:8080/saveBook' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "title": "The Crack in Space", + "author": "Philip K. Dick", + "year": 1966 +}' + +curl --location --request POST 'localhost:8080/saveBook' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "title": "Ubik", + "author": "Philip K. Dick", + "year": 1969 +}' ---- + +. Use the following command to query all books + -Example: -+ ---- -shell:>save-book "The Moon Is a Harsh Mistress" "Robert A. Heinlein" 1966 -shell:>save-book "Stranger in a Strange Land" "Robert A. Heinlein" 1961 -shell:>save-book "The Crack in Space" "Philip K. Dick" 1966 -shell:>save-book "Ubik" "Philip K. Dick" 1969 +curl --location --request GET 'localhost:8080/findAllBooks' +---- -shell:>find-by-year-greater-than 1967 -[Book{id=5734055144325120, title='Ubik', author='Philip K. Dick', year=1969}] +. Use the following command to find books by author ++ +---- +curl --location --request GET 'localhost:8080/findByAuthor?author=Robert A. Heinlein' +---- -shell:>find-by-author-year "Robert A. Heinlein" 1966 -[Book{id=5652161459388416, title='The Moon Is a Harsh Mistress', author='Robert A. Heinlein', year=1966}] +. Use the following command to query books newer than a given publication year ++ +---- +curl --location --request GET 'localhost:8080/findByYearGreaterThan?year=1960' ---- -. To clean up the database run the following command in the application shell: +. Use the following command to query books with a given author and publication year + -`shell:>remove-all-books` +---- +curl --location --request GET 'localhost:8080/findByAuthorYear?author=Robert A. Heinlein&year=1966' +---- -. Use `Ctrl+C` `Ctrl+C` to exit +. Use the following command to delete all books ++ +---- +curl --location --request DELETE 'localhost:8080/removeAllBooks' +---- diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml index 0be06d3968..f3d2e6ed93 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml @@ -35,11 +35,6 @@ <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-rest</artifactId> </dependency> - <dependency> - <groupId>org.springframework.shell</groupId> - <artifactId>spring-shell-starter</artifactId> - <version>3.0.0-M1</version> - </dependency> <!-- Test-related dependencies. --> <dependency> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/main/java/com/example/BookController.java b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/main/java/com/example/BookController.java new file mode 100644 index 0000000000..9a22e97628 --- /dev/null +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/main/java/com/example/BookController.java @@ -0,0 +1,75 @@ +/* + * Copyright 2017-2022 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class BookController { + private final BookRepository bookRepository; + + public BookController(BookRepository bookRepository) { + this.bookRepository = bookRepository; + } + + @PostMapping("/saveBook") + public String saveBook(@RequestBody Book book) { + Book savedBook = this.bookRepository.save(book); + return savedBook.toString(); + } + + @GetMapping("/findAllBooks") + public String findAllBooks() { + Iterable<Book> books = this.bookRepository.findAll(); + List<Book> bookList = new ArrayList<>(); + books.forEach(bookList::add); + return books.toString(); + } + + @GetMapping("/findByAuthor") + public String findByAuthor(@RequestParam("author") String author) { + List<Book> books = this.bookRepository.findByAuthor(author); + return books.toString(); + } + + @GetMapping("/findByYearGreaterThan") + public String findByYearGreaterThan(@RequestParam("year") Optional<Integer> year) { + List<Book> books = this.bookRepository.findByYearGreaterThan(year.orElse(0)); + return books.toString(); + } + + @GetMapping("/findByAuthorYear") + public String findByAuthorYear( + @RequestParam("author") String author, + @RequestParam("year") Optional<Integer> year) { + List<Book> books = this.bookRepository.findByAuthorAndYear(author, year.orElse(0)); + return books.toString(); + } + + @DeleteMapping("/removeAllBooks") + public void removeAllBooks() { + this.bookRepository.deleteAll(); + } +} diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/main/java/com/example/CustomPromptProvider.java b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/main/java/com/example/CustomPromptProvider.java deleted file mode 100644 index c225ab44e6..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/main/java/com/example/CustomPromptProvider.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2017-2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example; - -import org.jline.utils.AttributedString; -import org.jline.utils.AttributedStyle; -import org.springframework.shell.jline.PromptProvider; -import org.springframework.stereotype.Component; - -/** A prompt provider for the sample application web app. */ -@Component -public class CustomPromptProvider implements PromptProvider { - @Override - public AttributedString getPrompt() { - return new AttributedString( - "enter a command or type 'help' for info :> ", - AttributedStyle.DEFAULT.foreground(AttributedStyle.YELLOW)); - } -} diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/main/java/com/example/DatastoreBookshelfExample.java b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/main/java/com/example/DatastoreBookshelfExample.java index 8e2f2cd7e7..6a7090492a 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/main/java/com/example/DatastoreBookshelfExample.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/main/java/com/example/DatastoreBookshelfExample.java @@ -16,61 +16,14 @@ package com.example; -import java.util.ArrayList; -import java.util.List; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.shell.standard.ShellComponent; -import org.springframework.shell.standard.ShellMethod; /** This class contains the main method and performs common operations with books. */ -@ShellComponent @SpringBootApplication public class DatastoreBookshelfExample { - private final BookRepository bookRepository; - - public DatastoreBookshelfExample(BookRepository bookRepository) { - this.bookRepository = bookRepository; - } public static void main(String[] args) { SpringApplication.run(DatastoreBookshelfExample.class, args); } - - @ShellMethod("Saves a book to Cloud Datastore: save-book <title> <author> <year>") - public String saveBook(String title, String author, int year) { - Book savedBook = this.bookRepository.save(new Book(title, author, year)); - return savedBook.toString(); - } - - @ShellMethod("Loads all books") - public String findAllBooks() { - Iterable<Book> books = this.bookRepository.findAll(); - List<Book> bookList = new ArrayList<>(); - books.forEach(bookList::add); - return books.toString(); - } - - @ShellMethod("Loads books by author: find-by-author <author>") - public String findByAuthor(String author) { - List<Book> books = this.bookRepository.findByAuthor(author); - return books.toString(); - } - - @ShellMethod("Loads books released after a specified year: find-by-year-greater-than <year>") - public String findByYearGreaterThan(int year) { - List<Book> books = this.bookRepository.findByYearGreaterThan(year); - return books.toString(); - } - - @ShellMethod("Loads books by author and year: find-by-author-year <author> <year>") - public String findByAuthorYear(String author, int year) { - List<Book> books = this.bookRepository.findByAuthorAndYear(author, year); - return books.toString(); - } - - @ShellMethod("Removes all books") - public void removeAllBooks() { - this.bookRepository.deleteAll(); - } } diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/test/java/com/example/DatastoreBookshelfExampleIntegrationTests.java b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/test/java/com/example/DatastoreBookshelfExampleIntegrationTests.java index ba7b9e783b..8e26bce443 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/test/java/com/example/DatastoreBookshelfExampleIntegrationTests.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/test/java/com/example/DatastoreBookshelfExampleIntegrationTests.java @@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.junit.jupiter.api.extension.ExtendWith; @@ -31,7 +32,6 @@ import org.springframework.http.HttpEntity; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; -import org.springframework.shell.Shell; import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; @@ -41,55 +41,98 @@ @ExtendWith(SpringExtension.class) @SpringBootTest( classes = DatastoreBookshelfExample.class, - properties = "spring.shell.interactive.enabled=false", webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @EnabledIfSystemProperty(named = "it.datastore", matches = "true") class DatastoreBookshelfExampleIntegrationTests { - @Autowired private Shell shell; - @Autowired private DatastoreTemplate datastoreTemplate; - @Autowired private BookRepository bookRepository; - @Autowired private TestRestTemplate restTemplate; + @BeforeEach + void saveBooks() { + sendRequest( + "/saveBook", + "{\"title\":\"The Moon Is a Harsh Mistress\", \"author\":\"Robert A. Heinlein\", \"year\":1966}", + HttpMethod.POST); + sendRequest( + "/saveBook", + "{\"title\":\"Stranger in a Strange Land\", \"author\":\"Robert A. Heinlein\", \"year\":1961}", + HttpMethod.POST); + sendRequest( + "/saveBook", + "{\"title\":\"The Crack in Space\", \"author\":\"Philip K. Dick\", \"year\":1966}", + HttpMethod.POST); + sendRequest( + "/saveBook", + "{\"title\":\"Ubik\", \"author\":\"Philip K. Dick\", \"year\":1969}", + HttpMethod.POST); + } + @AfterEach void cleanUp() { this.datastoreTemplate.deleteAll(Book.class); } @Test - void testSerializedPage() { - Book book = new Book("Book1", "Author1", 2019); - book.id = 12345678L; - this.bookRepository.save(book); - Awaitility.await().atMost(15, TimeUnit.SECONDS).until(() -> this.bookRepository.count() == 1); - String responseBody = sendRequest("/allbooksserialized", null, HttpMethod.GET); - assertThat(responseBody) - .contains("content\":[{\"id\":12345678}],\"pageable\":") - .containsPattern("\"urlSafeCursor\":\".+\"");; + void findAllBooksTest() { + Awaitility.await().atMost(15, TimeUnit.SECONDS).untilAsserted(() -> { + String responseBody = sendRequest("/findAllBooks", null, HttpMethod.GET); + assertThat(responseBody) + .contains("title='The Moon Is a Harsh Mistress', author='Robert A. Heinlein', year=1966") + .contains("title='Stranger in a Strange Land', author='Robert A. Heinlein', year=1961") + .contains("title='The Crack in Space', author='Philip K. Dick', year=1966") + .contains("title='Ubik', author='Philip K. Dick', year=1969"); + }); } @Test - void testSaveBook() { - String book1 = (String) this.shell.evaluate(() -> "save-book book1 author1 1984"); - String book2 = (String) this.shell.evaluate(() -> "save-book book2 author2 2000"); - - String allBooks = (String) this.shell.evaluate(() -> "find-all-books"); - assertThat(allBooks).containsSequence(book1).containsSequence(book2); - - assertThat(this.shell.evaluate(() -> "find-by-author author1")).isEqualTo("[" + book1 + "]"); - - assertThat(this.shell.evaluate(() -> "find-by-author-year author2 2000")) - .isEqualTo("[" + book2 + "]"); + void findByAuthorTest() { + Awaitility.await().atMost(15, TimeUnit.SECONDS).untilAsserted(() -> { + String responseBody = sendRequest("/findByAuthor?author=Robert A. Heinlein", null, HttpMethod.GET); + assertThat(responseBody) + .contains("title='The Moon Is a Harsh Mistress', author='Robert A. Heinlein', year=1966") + .contains("title='Stranger in a Strange Land', author='Robert A. Heinlein', year=1961") + .doesNotContain("title='The Crack in Space', author='Philip K. Dick', year=1966") + .doesNotContain("title='Ubik', author='Philip K. Dick', year=1969"); + }); + } - assertThat(this.shell.evaluate(() -> "find-by-year-greater-than 1985")) - .isEqualTo("[" + book2 + "]"); + @Test + void findByYearGreaterThanTest() { + Awaitility.await().atMost(15, TimeUnit.SECONDS).untilAsserted(() -> { + String responseBody = sendRequest("/findByYearGreaterThan?year=1967", null, HttpMethod.GET); + assertThat(responseBody) + .doesNotContain("title='The Moon Is a Harsh Mistress', author='Robert A. Heinlein', year=1966") + .doesNotContain("title='Stranger in a Strange Land', author='Robert A. Heinlein', year=1961") + .doesNotContain("title='The Crack in Space', author='Philip K. Dick', year=1966") + .contains("title='Ubik', author='Philip K. Dick', year=1969"); + }); + } - this.shell.evaluate(() -> "remove-all-books"); + @Test + void findByAuthorYearTest() { + Awaitility.await().atMost(15, TimeUnit.SECONDS).untilAsserted(() -> { + String responseBody = sendRequest("/findByAuthorYear?author=Philip K. Dick&year=1966", null, HttpMethod.GET); + assertThat(responseBody) + .doesNotContain("title='The Moon Is a Harsh Mistress', author='Robert A. Heinlein', year=1966") + .doesNotContain("title='Stranger in a Strange Land', author='Robert A. Heinlein', year=1961") + .contains("title='The Crack in Space', author='Philip K. Dick', year=1966") + .doesNotContain("title='Ubik', author='Philip K. Dick', year=1969"); + }); + } - assertThat(this.shell.evaluate(() -> "find-all-books")).isEqualTo("[]"); + @Test + void removeAllBooksTest() { + sendRequest("/removeAllBooks", null, HttpMethod.DELETE); + Awaitility.await().atMost(15, TimeUnit.SECONDS).untilAsserted(() -> { + String responseBody = sendRequest("/findAllBooks", null, HttpMethod.GET); + assertThat(responseBody) + .doesNotContain("title='The Moon Is a Harsh Mistress', author='Robert A. Heinlein', year=1966") + .doesNotContain("title='Stranger in a Strange Land', author='Robert A. Heinlein', year=1961") + .doesNotContain("title='The Crack in Space', author='Philip K. Dick', year=1966") + .doesNotContain("title='Ubik', author='Philip K. Dick', year=1969"); + }); } private String sendRequest(String url, String json, HttpMethod method) { From 2bf839fb587bb3f3aa0e38ea22d84f941561dba9 Mon Sep 17 00:00:00 2001 From: Joe Wang <joewa@google.com> Date: Tue, 20 Dec 2022 11:10:16 -0500 Subject: [PATCH 163/179] remove spring native version num --- spring-cloud-gcp-samples/pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/spring-cloud-gcp-samples/pom.xml b/spring-cloud-gcp-samples/pom.xml index 2c03ae4372..8a55700d1c 100644 --- a/spring-cloud-gcp-samples/pom.xml +++ b/spring-cloud-gcp-samples/pom.xml @@ -21,7 +21,6 @@ <main.basedir>${basedir}/..</main.basedir> <!-- Dependency versions --> - <spring-native.version>0.12.1</spring-native.version> <google-cloud-graalvm-support.version>0.7.0</google-cloud-graalvm-support.version> <testcontainers.version>1.17.6</testcontainers.version> From 32ab83e410b3b69d39cd1d7aa7c783377d7e36da Mon Sep 17 00:00:00 2001 From: Joe Wang <joewa@google.com> Date: Tue, 3 Jan 2023 19:32:39 -0500 Subject: [PATCH 164/179] restore version-update tag --- docs/pom.xml | 2 +- generated/pom.xml | 2 +- pom.xml | 2 +- spring-cloud-gcp-autoconfigure/pom.xml | 2 +- spring-cloud-gcp-bigquery/pom.xml | 2 +- spring-cloud-gcp-cloudfoundry/pom.xml | 2 +- spring-cloud-gcp-core/pom.xml | 2 +- spring-cloud-gcp-data-datastore/pom.xml | 2 +- spring-cloud-gcp-data-firestore/pom.xml | 2 +- spring-cloud-gcp-data-spanner/pom.xml | 2 +- spring-cloud-gcp-dependencies/pom.xml | 2 +- spring-cloud-gcp-kms/pom.xml | 2 +- spring-cloud-gcp-logging/pom.xml | 2 +- spring-cloud-gcp-pubsub-stream-binder/pom.xml | 2 +- spring-cloud-gcp-pubsub/pom.xml | 2 +- spring-cloud-gcp-samples/pom.xml | 2 +- .../spring-cloud-gcp-bigquery-sample/pom.xml | 2 +- .../spring-cloud-gcp-config-sample/pom.xml | 2 +- .../spring-cloud-gcp-data-datastore-basic-sample/pom.xml | 2 +- .../spring-cloud-gcp-data-datastore-sample/pom.xml | 2 +- .../spring-cloud-gcp-data-firestore-sample/pom.xml | 2 +- .../spring-cloud-gcp-data-jpa-sample/pom.xml | 2 +- .../spring-cloud-gcp-data-multi-sample/pom.xml | 2 +- .../spring-cloud-gcp-data-spanner-repository-sample/pom.xml | 2 +- .../spring-cloud-gcp-data-spanner-template-sample/pom.xml | 2 +- .../spring-cloud-gcp-firestore-sample/pom.xml | 2 +- .../spring-cloud-gcp-integration-pubsub-json-sample/pom.xml | 2 +- .../spring-cloud-gcp-integration-pubsub-sample/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../spring-cloud-gcp-integration-pubsub-sample-sender/pom.xml | 2 +- .../spring-cloud-gcp-integration-pubsub-sample-test/pom.xml | 2 +- .../spring-cloud-gcp-integration-storage-sample/pom.xml | 2 +- spring-cloud-gcp-samples/spring-cloud-gcp-kms-sample/pom.xml | 2 +- .../spring-cloud-gcp-kotlin-samples/pom.xml | 4 ++-- .../spring-cloud-gcp-kotlin-app-sample/pom.xml | 2 +- .../spring-cloud-gcp-logging-sample/pom.xml | 2 +- .../spring-cloud-gcp-metrics-sample/pom.xml | 2 +- .../spring-cloud-gcp-pubsub-bus-config-sample/pom.xml | 2 +- .../spring-cloud-gcp-pubsub-bus-config-sample-client/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../spring-cloud-gcp-pubsub-bus-config-sample-test/pom.xml | 2 +- .../spring-cloud-gcp-pubsub-reactive-sample/pom.xml | 2 +- .../spring-cloud-gcp-pubsub-sample/pom.xml | 2 +- .../spring-cloud-gcp-pubsub-stream-dead-letter-sample/pom.xml | 2 +- .../spring-cloud-gcp-pubsub-stream-functional-sample/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../spring-cloud-gcp-secretmanager-sample/pom.xml | 2 +- .../spring-cloud-gcp-security-firebase-sample/pom.xml | 2 +- .../spring-cloud-gcp-security-iap-sample/pom.xml | 2 +- .../spring-cloud-gcp-sql-mysql-sample/pom.xml | 2 +- .../spring-cloud-gcp-sql-postgres-r2dbc-sample/pom.xml | 2 +- .../spring-cloud-gcp-sql-postgres-sample/pom.xml | 2 +- .../spring-cloud-gcp-storage-resource-sample/pom.xml | 2 +- .../spring-cloud-gcp-trace-sample/pom.xml | 2 +- .../spring-cloud-gcp-vision-api-sample/pom.xml | 2 +- .../spring-cloud-gcp-vision-ocr-demo/pom.xml | 2 +- spring-cloud-gcp-secretmanager/pom.xml | 2 +- spring-cloud-gcp-security-firebase/pom.xml | 2 +- spring-cloud-gcp-security-iap/pom.xml | 2 +- spring-cloud-gcp-starters/pom.xml | 2 +- .../spring-cloud-gcp-starter-bigquery/pom.xml | 2 +- .../spring-cloud-gcp-starter-bus-pubsub/pom.xml | 2 +- .../spring-cloud-gcp-starter-cloudfoundry/pom.xml | 2 +- .../spring-cloud-gcp-starter-config/pom.xml | 2 +- .../spring-cloud-gcp-starter-data-datastore/pom.xml | 2 +- .../spring-cloud-gcp-starter-data-firestore/pom.xml | 2 +- .../spring-cloud-gcp-starter-data-spanner/pom.xml | 2 +- .../spring-cloud-gcp-starter-firestore/pom.xml | 2 +- .../spring-cloud-gcp-starter-kms/pom.xml | 2 +- .../spring-cloud-gcp-starter-logging/pom.xml | 2 +- .../spring-cloud-gcp-starter-metrics/pom.xml | 2 +- .../spring-cloud-gcp-starter-pubsub/pom.xml | 2 +- .../spring-cloud-gcp-starter-secretmanager/pom.xml | 2 +- .../spring-cloud-gcp-starter-security-firebase/pom.xml | 2 +- .../spring-cloud-gcp-starter-security-iap/pom.xml | 2 +- .../spring-cloud-gcp-starter-sql-mysql/pom.xml | 2 +- .../spring-cloud-gcp-starter-sql-postgres-r2dbc/pom.xml | 2 +- .../spring-cloud-gcp-starter-sql-postgresql/pom.xml | 2 +- .../spring-cloud-gcp-starter-storage/pom.xml | 2 +- .../spring-cloud-gcp-starter-trace/pom.xml | 2 +- .../spring-cloud-gcp-starter-vision/pom.xml | 2 +- spring-cloud-gcp-starters/spring-cloud-gcp-starter/pom.xml | 2 +- spring-cloud-gcp-storage/pom.xml | 2 +- spring-cloud-gcp-vision/pom.xml | 2 +- 88 files changed, 89 insertions(+), 89 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index d7b3e2c41d..ad1333e39f 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -13,7 +13,7 @@ <name>Spring Framework on Google Cloud Documentation</name> <groupId>com.google.cloud</groupId> <artifactId>spring-cloud-gcp-docs</artifactId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> <packaging>pom</packaging> <properties> diff --git a/generated/pom.xml b/generated/pom.xml index 96cb323ec4..9817e97883 100644 --- a/generated/pom.xml +++ b/generated/pom.xml @@ -5,7 +5,7 @@ <parent> <artifactId>spring-cloud-gcp</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/pom.xml b/pom.xml index 97b2bdadaa..76dad7272e 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ <groupId>com.google.cloud</groupId> <artifactId>spring-cloud-gcp</artifactId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> <name>Spring Framework on Google Cloud</name> <description>Spring Framework on Google Cloud</description> diff --git a/spring-cloud-gcp-autoconfigure/pom.xml b/spring-cloud-gcp-autoconfigure/pom.xml index cde9d8938a..80b0cf6d51 100644 --- a/spring-cloud-gcp-autoconfigure/pom.xml +++ b/spring-cloud-gcp-autoconfigure/pom.xml @@ -5,7 +5,7 @@ <parent> <artifactId>spring-cloud-gcp</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-bigquery/pom.xml b/spring-cloud-gcp-bigquery/pom.xml index de414b093b..51eea2797c 100644 --- a/spring-cloud-gcp-bigquery/pom.xml +++ b/spring-cloud-gcp-bigquery/pom.xml @@ -7,7 +7,7 @@ <parent> <artifactId>spring-cloud-gcp</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <artifactId>spring-cloud-gcp-bigquery</artifactId> diff --git a/spring-cloud-gcp-cloudfoundry/pom.xml b/spring-cloud-gcp-cloudfoundry/pom.xml index cf4bb6f7c1..82aecb23f9 100644 --- a/spring-cloud-gcp-cloudfoundry/pom.xml +++ b/spring-cloud-gcp-cloudfoundry/pom.xml @@ -7,7 +7,7 @@ <parent> <artifactId>spring-cloud-gcp</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <artifactId>spring-cloud-gcp-cloudfoundry</artifactId> diff --git a/spring-cloud-gcp-core/pom.xml b/spring-cloud-gcp-core/pom.xml index 77dcee2ebf..30b64e8758 100644 --- a/spring-cloud-gcp-core/pom.xml +++ b/spring-cloud-gcp-core/pom.xml @@ -6,7 +6,7 @@ <parent> <artifactId>spring-cloud-gcp</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <artifactId>spring-cloud-gcp-core</artifactId> diff --git a/spring-cloud-gcp-data-datastore/pom.xml b/spring-cloud-gcp-data-datastore/pom.xml index 28f2441ba2..6fa3dafb67 100644 --- a/spring-cloud-gcp-data-datastore/pom.xml +++ b/spring-cloud-gcp-data-datastore/pom.xml @@ -7,7 +7,7 @@ <parent> <artifactId>spring-cloud-gcp</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <artifactId>spring-cloud-gcp-data-datastore</artifactId> <name>Spring Framework on Google Cloud Module - Datastore</name> diff --git a/spring-cloud-gcp-data-firestore/pom.xml b/spring-cloud-gcp-data-firestore/pom.xml index 65edda5074..179a1437c5 100644 --- a/spring-cloud-gcp-data-firestore/pom.xml +++ b/spring-cloud-gcp-data-firestore/pom.xml @@ -7,7 +7,7 @@ <parent> <artifactId>spring-cloud-gcp</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <artifactId>spring-cloud-gcp-data-firestore</artifactId> diff --git a/spring-cloud-gcp-data-spanner/pom.xml b/spring-cloud-gcp-data-spanner/pom.xml index a977a9e035..a02c377b45 100644 --- a/spring-cloud-gcp-data-spanner/pom.xml +++ b/spring-cloud-gcp-data-spanner/pom.xml @@ -7,7 +7,7 @@ <parent> <artifactId>spring-cloud-gcp</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <artifactId>spring-cloud-gcp-data-spanner</artifactId> <name>Spring Framework on Google Cloud Module - Cloud Spanner</name> diff --git a/spring-cloud-gcp-dependencies/pom.xml b/spring-cloud-gcp-dependencies/pom.xml index bb68c3799d..c0e5423a1c 100644 --- a/spring-cloud-gcp-dependencies/pom.xml +++ b/spring-cloud-gcp-dependencies/pom.xml @@ -4,7 +4,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>com.google.cloud</groupId> <artifactId>spring-cloud-gcp-dependencies</artifactId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> <name>Spring Framework on Google Cloud Dependencies</name> <description>Spring Framework on Google Cloud Dependencies</description> <packaging>pom</packaging> diff --git a/spring-cloud-gcp-kms/pom.xml b/spring-cloud-gcp-kms/pom.xml index d831270587..a1c04372dd 100644 --- a/spring-cloud-gcp-kms/pom.xml +++ b/spring-cloud-gcp-kms/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>com.google.cloud</groupId> <artifactId>spring-cloud-gcp</artifactId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-logging/pom.xml b/spring-cloud-gcp-logging/pom.xml index 99603796fc..7abb16f1c5 100644 --- a/spring-cloud-gcp-logging/pom.xml +++ b/spring-cloud-gcp-logging/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>com.google.cloud</groupId> <artifactId>spring-cloud-gcp</artifactId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <properties> diff --git a/spring-cloud-gcp-pubsub-stream-binder/pom.xml b/spring-cloud-gcp-pubsub-stream-binder/pom.xml index 99f2ebef03..52e649de90 100644 --- a/spring-cloud-gcp-pubsub-stream-binder/pom.xml +++ b/spring-cloud-gcp-pubsub-stream-binder/pom.xml @@ -5,7 +5,7 @@ <parent> <artifactId>spring-cloud-gcp</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-pubsub/pom.xml b/spring-cloud-gcp-pubsub/pom.xml index 6189062ef7..135cd49c5b 100644 --- a/spring-cloud-gcp-pubsub/pom.xml +++ b/spring-cloud-gcp-pubsub/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>com.google.cloud</groupId> <artifactId>spring-cloud-gcp</artifactId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <artifactId>spring-cloud-gcp-pubsub</artifactId> diff --git a/spring-cloud-gcp-samples/pom.xml b/spring-cloud-gcp-samples/pom.xml index 8a55700d1c..e58bc72b66 100644 --- a/spring-cloud-gcp-samples/pom.xml +++ b/spring-cloud-gcp-samples/pom.xml @@ -13,7 +13,7 @@ <name>Spring Framework on Google Cloud Code Samples</name> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> <packaging>pom</packaging> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/pom.xml index b3e4766bcd..5352f73fc3 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-bigquery-sample/pom.xml @@ -6,7 +6,7 @@ <parent> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-config-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-config-sample/pom.xml index e9a055b1ca..f265db2ef9 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-config-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-config-sample/pom.xml @@ -7,7 +7,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml index f3d2e6ed93..4c83f11566 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-sample/pom.xml index 74085734c7..ffea384f27 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-sample/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-firestore-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-data-firestore-sample/pom.xml index b546e479b1..9f9f507693 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-firestore-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-firestore-sample/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-jpa-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-data-jpa-sample/pom.xml index df35a0e8e9..4d77e598a2 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-jpa-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-jpa-sample/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-multi-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-data-multi-sample/pom.xml index 457712c025..7921852624 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-multi-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-multi-sample/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/pom.xml index dbcfe053a8..6024f3d2f8 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>spring-cloud-gcp-data-spanner-repository-sample</artifactId> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-template-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-template-sample/pom.xml index 2a8f4f2303..9b5d069de8 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-template-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-template-sample/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>spring-cloud-gcp-data-spanner-template-sample</artifactId> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-firestore-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-firestore-sample/pom.xml index 016627d612..356c986e53 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-firestore-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-firestore-sample/pom.xml @@ -7,7 +7,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-json-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-json-sample/pom.xml index 30db03569e..5229bcbdec 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-json-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-json-sample/pom.xml @@ -7,7 +7,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/pom.xml index ccadec5057..750e680b2d 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/pom.xml @@ -5,7 +5,7 @@ <parent> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <artifactId>spring-cloud-gcp-integration-pubsub-sample</artifactId> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-polling-receiver/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-polling-receiver/pom.xml index b252f878ec..88208c840d 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-polling-receiver/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-polling-receiver/pom.xml @@ -7,7 +7,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-integration-pubsub-sample</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-receiver/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-receiver/pom.xml index 5afb3627db..5af3231c16 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-receiver/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-receiver/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-integration-pubsub-sample</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-sender/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-sender/pom.xml index ac8a85d712..a0ad664374 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-sender/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-sender/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-integration-pubsub-sample</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-test/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-test/pom.xml index ba1543ba14..15fa083a2a 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-test/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-sample/spring-cloud-gcp-integration-pubsub-sample-test/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-integration-pubsub-sample</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-storage-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-storage-sample/pom.xml index 9d2e7569e5..f2734c1d88 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-integration-storage-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-integration-storage-sample/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-kms-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-kms-sample/pom.xml index 83b64c1715..51514fb0f5 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-kms-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-kms-sample/pom.xml @@ -7,7 +7,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/pom.xml index dfa7b7c61e..1c06b95044 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/pom.xml @@ -7,11 +7,11 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <artifactId>spring-cloud-gcp-kotlin-samples</artifactId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> <name>Spring Framework on Google Cloud Code Samples - Kotlin</name> <modelVersion>4.0.0</modelVersion> <packaging>pom</packaging> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/pom.xml index ef0d59c073..316b41c8d2 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-kotlin-samples/spring-cloud-gcp-kotlin-app-sample/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-kotlin-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-logging-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-logging-sample/pom.xml index 72dbee08b5..a0ec7568a9 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-logging-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-logging-sample/pom.xml @@ -10,7 +10,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <!-- The Spring Framework on Google Cloud BOM will manage spring-cloud-gcp version numbers for you. --> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-metrics-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-metrics-sample/pom.xml index 53f8ac9b9a..3283934b1b 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-metrics-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-metrics-sample/pom.xml @@ -10,7 +10,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <!-- The Spring Framework on Google Cloud BOM will manage spring-cloud-gcp version numbers for you. --> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/pom.xml index 0b5133e017..b075af19e7 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/pom.xml @@ -5,7 +5,7 @@ <parent> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> -<version>4.0.0-SNAPSHOT</version> +<version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-client/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-client/pom.xml index c958436287..f803f02155 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-client/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-client/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-pubsub-bus-config-sample</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-server-github/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-server-github/pom.xml index 892219ed3c..c83091f9b1 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-server-github/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-server-github/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-pubsub-bus-config-sample</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-server-local/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-server-local/pom.xml index 1fe5929618..bb8455b75a 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-server-local/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-server-local/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-pubsub-bus-config-sample</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-test/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-test/pom.xml index 263d2631d4..777b454a6c 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-test/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-bus-config-sample/spring-cloud-gcp-pubsub-bus-config-sample-test/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-pubsub-bus-config-sample</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-reactive-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-reactive-sample/pom.xml index 0c2a50fc05..151241dea7 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-reactive-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-reactive-sample/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/pom.xml index 20228da790..2d6dba28b3 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample/pom.xml @@ -7,7 +7,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-dead-letter-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-dead-letter-sample/pom.xml index a6a53d426e..62c6e5edcc 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-dead-letter-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-dead-letter-sample/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/pom.xml index 8025b4b7fe..497d7daaa2 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/pom.xml @@ -5,7 +5,7 @@ <parent> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-sink/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-sink/pom.xml index 15252c71fd..0731d71ea5 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-sink/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-sink/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-pubsub-stream-functional-sample</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-source/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-source/pom.xml index 58e9e77e2b..82a631bb8c 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-source/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-source/pom.xml @@ -5,7 +5,7 @@ <parent> <artifactId>spring-cloud-gcp-pubsub-stream-functional-sample</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-test/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-test/pom.xml index b3e08f147d..5d60946a7c 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-test/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-test/pom.xml @@ -5,7 +5,7 @@ <parent> <artifactId>spring-cloud-gcp-pubsub-stream-functional-sample</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-secretmanager-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-secretmanager-sample/pom.xml index 3ab62452ec..b39a05241d 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-secretmanager-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-secretmanager-sample/pom.xml @@ -7,7 +7,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-security-firebase-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-security-firebase-sample/pom.xml index 7b51335ddf..9cf4515079 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-security-firebase-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-security-firebase-sample/pom.xml @@ -7,7 +7,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <properties> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-security-iap-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-security-iap-sample/pom.xml index 621abaacf3..3e29cfedc4 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-security-iap-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-security-iap-sample/pom.xml @@ -11,7 +11,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <properties> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-sample/pom.xml index 6f26818cd2..065cba1c41 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-mysql-sample/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-r2dbc-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-r2dbc-sample/pom.xml index 537a49ce9c..4c2637c2c7 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-r2dbc-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-r2dbc-sample/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-sample/pom.xml index 783a390fbf..0e47c613d8 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-sql-postgres-sample/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-storage-resource-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-storage-resource-sample/pom.xml index 83deac710e..5738d428f3 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-storage-resource-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-storage-resource-sample/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/pom.xml index 4b4eef339b..73586aa760 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample/pom.xml @@ -10,7 +10,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <!-- The Spring Framework on Google Cloud BOM will manage spring-cloud-gcp version numbers for you. --> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-vision-api-sample/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-vision-api-sample/pom.xml index 57e7b9de8f..c1b6c68b96 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-vision-api-sample/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-vision-api-sample/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-vision-ocr-demo/pom.xml b/spring-cloud-gcp-samples/spring-cloud-gcp-vision-ocr-demo/pom.xml index f8b4235cec..e5bf8c4f76 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-vision-ocr-demo/pom.xml +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-vision-ocr-demo/pom.xml @@ -6,7 +6,7 @@ <!-- Your own application should inherit from spring-boot-starter-parent --> <artifactId>spring-cloud-gcp-samples</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-secretmanager/pom.xml b/spring-cloud-gcp-secretmanager/pom.xml index 61650b3164..75a2b9cc42 100644 --- a/spring-cloud-gcp-secretmanager/pom.xml +++ b/spring-cloud-gcp-secretmanager/pom.xml @@ -5,7 +5,7 @@ <parent> <artifactId>spring-cloud-gcp</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-security-firebase/pom.xml b/spring-cloud-gcp-security-firebase/pom.xml index a12d724d8f..76ea67aa76 100644 --- a/spring-cloud-gcp-security-firebase/pom.xml +++ b/spring-cloud-gcp-security-firebase/pom.xml @@ -6,7 +6,7 @@ <parent> <artifactId>spring-cloud-gcp</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> diff --git a/spring-cloud-gcp-security-iap/pom.xml b/spring-cloud-gcp-security-iap/pom.xml index d73c351fc5..0e6dd805fb 100644 --- a/spring-cloud-gcp-security-iap/pom.xml +++ b/spring-cloud-gcp-security-iap/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>com.google.cloud</groupId> <artifactId>spring-cloud-gcp</artifactId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <artifactId>spring-cloud-gcp-security-iap</artifactId> diff --git a/spring-cloud-gcp-starters/pom.xml b/spring-cloud-gcp-starters/pom.xml index d928b487de..656ae59df2 100644 --- a/spring-cloud-gcp-starters/pom.xml +++ b/spring-cloud-gcp-starters/pom.xml @@ -6,7 +6,7 @@ <parent> <artifactId>spring-cloud-gcp</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <packaging>pom</packaging> <name>Spring Framework on Google Cloud Starters</name> diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-bigquery/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-bigquery/pom.xml index 00c2307900..5a2e213679 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-bigquery/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-bigquery/pom.xml @@ -5,7 +5,7 @@ <parent> <artifactId>spring-cloud-gcp-starters</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-bus-pubsub/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-bus-pubsub/pom.xml index ee531563d5..b0086ebe60 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-bus-pubsub/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-bus-pubsub/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>com.google.cloud</groupId> <artifactId>spring-cloud-gcp-starters</artifactId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <artifactId>spring-cloud-gcp-starter-bus-pubsub</artifactId> diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-cloudfoundry/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-cloudfoundry/pom.xml index b32453ec6e..7b88e2caeb 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-cloudfoundry/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-cloudfoundry/pom.xml @@ -5,7 +5,7 @@ <parent> <artifactId>spring-cloud-gcp-starters</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-config/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-config/pom.xml index 5439932eb4..b39b1653b7 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-config/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-config/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>com.google.cloud</groupId> <artifactId>spring-cloud-gcp-starters</artifactId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <artifactId>spring-cloud-gcp-starter-config</artifactId> <name>Spring Framework on Google Cloud Starter - Config</name> diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-datastore/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-datastore/pom.xml index f887a67d18..444da1e5bf 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-datastore/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-datastore/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>com.google.cloud</groupId> <artifactId>spring-cloud-gcp-starters</artifactId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <artifactId>spring-cloud-gcp-starter-data-datastore</artifactId> <name>Spring Framework on Google Cloud Starter - Datastore</name> diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-firestore/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-firestore/pom.xml index 747a5bdda0..cc598fae91 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-firestore/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-firestore/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>com.google.cloud</groupId> <artifactId>spring-cloud-gcp-starters</artifactId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <artifactId>spring-cloud-gcp-starter-data-firestore</artifactId> <name>Spring Framework on Google Cloud Starter - Firestore</name> diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-spanner/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-spanner/pom.xml index ca6cdf3212..603637453a 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-spanner/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-data-spanner/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>com.google.cloud</groupId> <artifactId>spring-cloud-gcp-starters</artifactId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <artifactId>spring-cloud-gcp-starter-data-spanner</artifactId> <name>Spring Framework on Google Cloud Starter - Spanner</name> diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-firestore/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-firestore/pom.xml index 21b682310e..a9a8c82477 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-firestore/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-firestore/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>com.google.cloud</groupId> <artifactId>spring-cloud-gcp-starters</artifactId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <artifactId>spring-cloud-gcp-starter-firestore</artifactId> <name>Spring Framework on Google Cloud Starter - Firestore</name> diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-kms/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-kms/pom.xml index ce533a391c..537d8d6906 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-kms/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-kms/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>com.google.cloud</groupId> <artifactId>spring-cloud-gcp-starters</artifactId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-logging/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-logging/pom.xml index a3d1f56e72..10c69c86ca 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-logging/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-logging/pom.xml @@ -5,7 +5,7 @@ <parent> <artifactId>spring-cloud-gcp-starters</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-metrics/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-metrics/pom.xml index d2608676b7..37f65ac214 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-metrics/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-metrics/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>com.google.cloud</groupId> <artifactId>spring-cloud-gcp-starters</artifactId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-pubsub/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-pubsub/pom.xml index 11aeeeaf1b..033b66ac52 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-pubsub/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-pubsub/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>com.google.cloud</groupId> <artifactId>spring-cloud-gcp-starters</artifactId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <artifactId>spring-cloud-gcp-starter-pubsub</artifactId> <name>Spring Framework on Google Cloud Starter - Pub/Sub</name> diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-secretmanager/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-secretmanager/pom.xml index 21ea3db06a..d3e3b4bd7d 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-secretmanager/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-secretmanager/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>com.google.cloud</groupId> <artifactId>spring-cloud-gcp-starters</artifactId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-security-firebase/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-security-firebase/pom.xml index ab69e0f10e..8cfe2cbaff 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-security-firebase/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-security-firebase/pom.xml @@ -5,7 +5,7 @@ <parent> <artifactId>spring-cloud-gcp-starters</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-security-iap/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-security-iap/pom.xml index 597f464284..74f4371c4c 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-security-iap/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-security-iap/pom.xml @@ -6,7 +6,7 @@ <parent> <artifactId>spring-cloud-gcp-starters</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql/pom.xml index 83a28656c9..3c045265b4 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-mysql/pom.xml @@ -5,7 +5,7 @@ <parent> <artifactId>spring-cloud-gcp-starters</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-postgres-r2dbc/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-postgres-r2dbc/pom.xml index f52e535d45..1486b48ddb 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-postgres-r2dbc/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-postgres-r2dbc/pom.xml @@ -5,7 +5,7 @@ <parent> <artifactId>spring-cloud-gcp-starters</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-postgresql/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-postgresql/pom.xml index 38fad7208c..8e78234430 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-postgresql/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-sql-postgresql/pom.xml @@ -5,7 +5,7 @@ <parent> <artifactId>spring-cloud-gcp-starters</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-storage/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-storage/pom.xml index ed2fc733e7..587ce7536a 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-storage/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-storage/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>com.google.cloud</groupId> <artifactId>spring-cloud-gcp-starters</artifactId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <artifactId>spring-cloud-gcp-starter-storage</artifactId> <name>Spring Framework on Google Cloud Starter - Storage</name> diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml index 9efa9d4d74..4f026adb7d 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-trace/pom.xml @@ -5,7 +5,7 @@ <parent> <artifactId>spring-cloud-gcp-starters</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-vision/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-vision/pom.xml index 118d6d7d90..89214faf4e 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter-vision/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter-vision/pom.xml @@ -5,7 +5,7 @@ <parent> <artifactId>spring-cloud-gcp-starters</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/spring-cloud-gcp-starters/spring-cloud-gcp-starter/pom.xml b/spring-cloud-gcp-starters/spring-cloud-gcp-starter/pom.xml index 001814edfb..db5a2e07ec 100644 --- a/spring-cloud-gcp-starters/spring-cloud-gcp-starter/pom.xml +++ b/spring-cloud-gcp-starters/spring-cloud-gcp-starter/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>com.google.cloud</groupId> <artifactId>spring-cloud-gcp-starters</artifactId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <artifactId>spring-cloud-gcp-starter</artifactId> <name>Spring Framework on Google Cloud Starter - Support</name> diff --git a/spring-cloud-gcp-storage/pom.xml b/spring-cloud-gcp-storage/pom.xml index 8f4c6a2eb3..62871ea1b8 100644 --- a/spring-cloud-gcp-storage/pom.xml +++ b/spring-cloud-gcp-storage/pom.xml @@ -6,7 +6,7 @@ <parent> <artifactId>spring-cloud-gcp</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <artifactId>spring-cloud-gcp-storage</artifactId> <name>Spring Framework on Google Cloud Module - Storage</name> diff --git a/spring-cloud-gcp-vision/pom.xml b/spring-cloud-gcp-vision/pom.xml index 715150c712..a42430cc7c 100644 --- a/spring-cloud-gcp-vision/pom.xml +++ b/spring-cloud-gcp-vision/pom.xml @@ -6,7 +6,7 @@ <parent> <artifactId>spring-cloud-gcp</artifactId> <groupId>com.google.cloud</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>4.0.0-SNAPSHOT</version><!-- {x-version-update:spring-cloud-gcp:current} --> </parent> <modelVersion>4.0.0</modelVersion> From ef3e5f40fe4b60df349bd7e04e1bc5eecb816081 Mon Sep 17 00:00:00 2001 From: Joe Wang <joewa@google.com> Date: Tue, 3 Jan 2023 19:56:00 -0500 Subject: [PATCH 165/179] restore dependency format --- docs/src/main/asciidoc/pubsub.adoc | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/src/main/asciidoc/pubsub.adoc b/docs/src/main/asciidoc/pubsub.adoc index e9ecb0511d..5fa6c6908a 100644 --- a/docs/src/main/asciidoc/pubsub.adoc +++ b/docs/src/main/asciidoc/pubsub.adoc @@ -238,16 +238,14 @@ The `pubsub-subscriber` indicator will then roll up to the overall application s [source,xml] ---- -<dependencies> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-actuator</artifactId> - </dependency> - <dependency> - <groupId>com.google.cloud</groupId> - <artifactId>google-cloud-monitoring</artifactId> - </dependency> -</dependencies> +<dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-actuator</artifactId> +</dependency> +<dependency> + <groupId>com.google.cloud</groupId> + <artifactId>google-cloud-monitoring</artifactId> +</dependency> ---- The health indicator validates a subscriber's health by checking the subscription's message backlog and the last processed message. From 52d475cf9fa32644ba4ec15f8a7a50fd4da5fa11 Mon Sep 17 00:00:00 2001 From: Joe Wang <joewa@google.com> Date: Tue, 3 Jan 2023 19:57:48 -0500 Subject: [PATCH 166/179] restore dependency format --- docs/src/main/asciidoc/pubsub.adoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/src/main/asciidoc/pubsub.adoc b/docs/src/main/asciidoc/pubsub.adoc index 5fa6c6908a..21098139cb 100644 --- a/docs/src/main/asciidoc/pubsub.adoc +++ b/docs/src/main/asciidoc/pubsub.adoc @@ -239,12 +239,12 @@ The `pubsub-subscriber` indicator will then roll up to the overall application s [source,xml] ---- <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-actuator</artifactId> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> - <groupId>com.google.cloud</groupId> - <artifactId>google-cloud-monitoring</artifactId> + <groupId>com.google.cloud</groupId> + <artifactId>google-cloud-monitoring</artifactId> </dependency> ---- From b494f41c6c9ff1e7562fa7d7cf15070fa26b8cb3 Mon Sep 17 00:00:00 2001 From: Joe Wang <joewa@google.com> Date: Wed, 4 Jan 2023 10:13:39 -0500 Subject: [PATCH 167/179] restore serialized page test --- .../DatastoreBookshelfExampleIntegrationTests.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/test/java/com/example/DatastoreBookshelfExampleIntegrationTests.java b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/test/java/com/example/DatastoreBookshelfExampleIntegrationTests.java index 8e26bce443..e9a7dcf4ae 100644 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/test/java/com/example/DatastoreBookshelfExampleIntegrationTests.java +++ b/spring-cloud-gcp-samples/spring-cloud-gcp-data-datastore-basic-sample/src/test/java/com/example/DatastoreBookshelfExampleIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2018 the original author or authors. + * Copyright 2017-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,7 @@ class DatastoreBookshelfExampleIntegrationTests { void saveBooks() { sendRequest( "/saveBook", - "{\"title\":\"The Moon Is a Harsh Mistress\", \"author\":\"Robert A. Heinlein\", \"year\":1966}", + "{\"id\":12345678, \"title\":\"The Moon Is a Harsh Mistress\", \"author\":\"Robert A. Heinlein\", \"year\":1966}", HttpMethod.POST); sendRequest( "/saveBook", @@ -74,6 +74,14 @@ void cleanUp() { this.datastoreTemplate.deleteAll(Book.class); } + @Test + void testSerializedPage() { + String responseBody = sendRequest("/allbooksserialized", null, HttpMethod.GET); + assertThat(responseBody) + .contains("content\":[{\"id\":12345678}],\"pageable\":") + .containsPattern("\"urlSafeCursor\":\".+\""); + } + @Test void findAllBooksTest() { Awaitility.await().atMost(15, TimeUnit.SECONDS).untilAsserted(() -> { From fd33f8994292e28e7d70b735457ab20e6d69220f Mon Sep 17 00:00:00 2001 From: Joe Wang <joewa@google.com> Date: Thu, 5 Jan 2023 13:45:30 -0500 Subject: [PATCH 168/179] modify changlog --- CHANGELOG.md | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0217c9a1f..877699103b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,94 @@ on GitHub. ## 4.0.0 +### Generals +This release officially introduces Spring Boot 3.x compatibility. Note that breaking changes occur in this release. + +All changes within one large [Pull Request](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/pull/1287) as we think split PRs may bring compatibility issues. For the rational of each change, please refer to the description of the PR. + +### Important version upgrades +* Java 17 +* Spring Framework libraries upgrade + - [Spring Boot 3.0](https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide) + - [Spring Framework 6.0](https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-6.x) + - [Spring Cloud 2022.0](https://github.com/spring-cloud/spring-cloud-release/wiki/Spring-Cloud-2022.0-Release-Notes) +* Upgrade plugin versions +* [Enable auto-configuration](https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#auto-configuration-files) +* Fix [#1294](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/issues/1294) + +### Bigquery +* Remove deprecated methods +* Replace `ListenableFuture` and `SettableListenableFuture` with `CompletableFuture` +* Code polish +* Improve code coverage + +### Cloud SQL +* Remove support for `r2dbc-mysql` +* Fix [#1200](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/issues/1200) + +### Datastore +* Remove deprecated methods and constructors +* Replace `ClassTypeInformation` with `TypeInformation` +* Extend inheritance of `DatastoreRepository` +* Change datastore-basic-sample to a web application to remove `spring-shell` dependency +* Fix broken tests +* Code polish + +### Firestore +* Replace `ClassTypeInformation` with `TypeInformation` +* Code polish + +### Kotlin sample +* Code polish + +### Logging +* Replace `javax.servlet` with `jakarta.servlet` +* Remove deprecated methods +* Code polish + +### Native support +* Delete the module + +### Pubsub +* Replace `ListenableFuture` and `SettableListenableFuture` with `CompletableFuture` +* Remove deprecated methods and constructors +* Code polish + +### Pubsub-stream-binder +* Change to functional programming model +* Change `spring-cloud-stream-binder-test` to `spring-cloud-stream-test-support` +* Fix broken tests + +### Secret Manager +* Delete `GcpSecretManagerBootstrapConfiguration` + +### Security +* Replace `javax.servlet` with `jakarta.servlet` + +### Spanner +* Replace `PreferredConstructor` with `InstanceCreatorMetadata` +* Replace `ClassTypeInformation` with `TypeInformation` +* Remove deprecated methods and constructors +* Extend inheritance of `SpannerRepository` +* Fix broken tests +* Code polish + +### Storage +* Remove deprecated methods +* Code polish +* Improve code coverage + +### Trace +* Remove `spring-cloud-sleuth` dependency +* Instrument trace using Observation API +* Remove deprecated methods +* Fix broken tests + +### Vision +* Replace `ListenableFuture` and `SettableListenableFuture` with `CompletableFuture` +* Fix broken tests +* Code polish + ## 3.4.0 ### General From 8f11ce4c9492b38d234e1885ea623ebfb2512a9e Mon Sep 17 00:00:00 2001 From: Joe Wang <joewa@google.com> Date: Thu, 5 Jan 2023 13:59:10 -0500 Subject: [PATCH 169/179] add versions.txt --- versions.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 versions.txt diff --git a/versions.txt b/versions.txt new file mode 100644 index 0000000000..a3240d75d1 --- /dev/null +++ b/versions.txt @@ -0,0 +1,4 @@ +# Format: +# module:released-version:current-version + +spring-cloud-gcp:4.0.0:4.0.1-SNAPSHOT \ No newline at end of file From f9e9068162fab223f6712cc736b78e214a956b7e Mon Sep 17 00:00:00 2001 From: Joe Wang <joewa@google.com> Date: Thu, 5 Jan 2023 14:28:24 -0500 Subject: [PATCH 170/179] delete native support test in samples --- ...mpleApplicationNativeIntegrationTests.java | 174 ------------------ 1 file changed, 174 deletions(-) delete mode 100644 spring-cloud-gcp-samples/spring-cloud-gcp-data-firestore-sample/src/test/java/com/example/FirestoreSampleApplicationNativeIntegrationTests.java diff --git a/spring-cloud-gcp-samples/spring-cloud-gcp-data-firestore-sample/src/test/java/com/example/FirestoreSampleApplicationNativeIntegrationTests.java b/spring-cloud-gcp-samples/spring-cloud-gcp-data-firestore-sample/src/test/java/com/example/FirestoreSampleApplicationNativeIntegrationTests.java deleted file mode 100644 index 8612e17f29..0000000000 --- a/spring-cloud-gcp-samples/spring-cloud-gcp-data-firestore-sample/src/test/java/com/example/FirestoreSampleApplicationNativeIntegrationTests.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright 2017-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example; - -import static java.util.Collections.emptyList; -import static java.util.Collections.singletonList; -import static org.assertj.core.api.Assertions.assertThat; -import static org.hamcrest.Matchers.is; -import static org.junit.Assume.assumeThat; - -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.cloud.NoCredentials; -import com.google.cloud.firestore.CollectionReference; -import com.google.cloud.firestore.DocumentReference; -import com.google.cloud.firestore.Firestore; -import com.google.cloud.firestore.FirestoreOptions; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ExecutionException; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; -import org.springframework.boot.web.client.RestTemplateBuilder; -import org.springframework.web.client.RestTemplate; -import org.testcontainers.containers.FirestoreEmulatorContainer; -import org.testcontainers.containers.GenericContainer; -import org.testcontainers.containers.wait.strategy.Wait; -import org.testcontainers.junit.jupiter.Container; -import org.testcontainers.junit.jupiter.Testcontainers; -import org.testcontainers.utility.DockerImageName; - -/** - * Tests created native docker image when maven "native" profile is active. A firestore is run in - * docker using TestContainers, and then our app's docker image will connect to that firestore to - * persist/fetch data. Test scenario is almost exactly the same as {@link - * FirestoreSampleApplicationIntegrationTests}. - */ -@Testcontainers -@Tag("native") -public class FirestoreSampleApplicationNativeIntegrationTests { - private static final User ALPHA_USER = - new User("Alpha", 49, singletonList(new Pet("rat", "Snowflake"))); - private static final List<PhoneNumber> ALPHA_PHONE_NUMBERS = - Arrays.asList(new PhoneNumber("555666777"), new PhoneNumber("777666555")); - private static final User BETA_USER = new User("Beta", 23, emptyList()); - private static final User DELTA_USER = - new User("Delta", 49, Arrays.asList(new Pet("fish", "Dory"), new Pet("spider", "Man"))); - private static final String MY_GCP_PROJECT_ID = "my-gcp-project-id"; - - @Container - private static final FirestoreEmulatorContainer emulator = - new FirestoreEmulatorContainer( - DockerImageName.parse("gcr.io/google.com/cloudsdktool/cloud-sdk:316.0.0-emulators")); - - private static Firestore firestore; - - @BeforeAll - static void beforeAll() { - assumeThat( - "Firestore Native tests are " + "disabled. Please use '-Dit.native=true' to enable them. ", - System.getProperty("it.native"), - is("true")); - - FirestoreOptions options = - FirestoreOptions.getDefaultInstance().toBuilder() - .setHost(emulator.getEmulatorEndpoint()) - .setCredentials(NoCredentials.getInstance()) - .setProjectId(MY_GCP_PROJECT_ID) - .build(); - firestore = options.getService(); - } - - @Test - void testApplicationNativeDockerImage() throws ExecutionException, InterruptedException { - // expose firestore port from local machine to be used by our app's docker image - Integer firestorePort = emulator.getMappedPort(8080); - org.testcontainers.Testcontainers.exposeHostPorts(firestorePort); - - try (MyAppNativeDockerContainer myApp = new MyAppNativeDockerContainer(emulator)) { - myApp.start(); - RestTemplate restTemplate = new RestTemplateBuilder().rootUri(myApp.getBaseUrl()).build(); - TestUserClient testUserClient = new TestUserClient(restTemplate); - - testUserClient.removePhonesForUser("Alpha"); - List<User> allUsers = testUserClient.listUsers(); - assertThat(allUsers).isEmpty(); - - testUserClient.saveUser(ALPHA_USER, ALPHA_PHONE_NUMBERS); - verifyUserPersisted(ALPHA_USER); - - testUserClient.saveUser(BETA_USER, emptyList()); - verifyUserPersisted(BETA_USER); - - testUserClient.saveUser(DELTA_USER, emptyList()); - verifyUserPersisted(DELTA_USER); - - allUsers = testUserClient.listUsers(); - assertThat(allUsers).map(User::getName).containsExactlyInAnyOrder("Alpha", "Beta", "Delta"); - - List<User> users49 = testUserClient.findUsersByAge(49); - assertThat(users49).containsExactlyInAnyOrder(ALPHA_USER, DELTA_USER); - List<PhoneNumber> phoneNumbers = testUserClient.listPhoneNumbers("Alpha"); - assertThat(phoneNumbers) - .map(PhoneNumber::getNumber) - .containsExactlyInAnyOrder("555666777", "777666555"); - - testUserClient.removeUserByName("Alpha"); - phoneNumbers = testUserClient.listPhoneNumbers("Alpha"); - assertThat(phoneNumbers) - .map(PhoneNumber::getNumber) - .containsExactlyInAnyOrder("555666777", "777666555"); - - testUserClient.removePhonesForUser("Alpha"); - phoneNumbers = testUserClient.listPhoneNumbers("Alpha"); - assertThat(phoneNumbers).isEmpty(); - } - } - - private void verifyUserPersisted(User user) throws InterruptedException, ExecutionException { - CollectionReference users = firestore.collection("users"); - DocumentReference docRef = users.document(user.getName()); - Map<String, Object> storedDoc = docRef.get().get().getData(); - - assertThat(storedDoc).isNotNull().containsEntry("age", (long) user.getAge()); - List<Map<String, Object>> petsMapList = - new ObjectMapper() - .convertValue(user.getPets(), new TypeReference<List<Map<String, Object>>>() {}); - assertThat(storedDoc.get("pets")) - .isNotNull() - .asList() - .hasSize(user.getPets().size()) - .containsAll(petsMapList); - } - - private static class MyAppNativeDockerContainer - extends GenericContainer<MyAppNativeDockerContainer> { - public static final int APP_PORT = 8080; - - MyAppNativeDockerContainer(FirestoreEmulatorContainer emulator) { - super(DockerImageName.parse("spring-cloud-gcp-data-firestore-sample:test")); - dependsOn(emulator); - withEnv("SPRING_CLOUD_GCP_FIRESTORE_EMULATOR_ENABLED", "true"); - withEnv( - "SPRING_CLOUD_GCP_FIRESTORE_HOST_PORT", - "host.testcontainers.internal:" + emulator.getMappedPort(8080)); - withEnv("SPRING_CLOUD_GCP_FIRESTORE_PROJECT_ID", MY_GCP_PROJECT_ID); - withExposedPorts(8080); - waitingFor(Wait.forHttp("/")); - withLogConsumer( - outputFrame -> - System.out.println("MYAPP-DOCKER-OUTPUT " + outputFrame.getUtf8String().trim())); - } - - public String getBaseUrl() { - return "http://" + getHost() + ":" + getMappedPort(APP_PORT); - } - } -} From debcf3f641a4f26c1fdbc46f88d27100dff3d8cc Mon Sep 17 00:00:00 2001 From: Joe Wang <joewa@google.com> Date: Wed, 18 Jan 2023 11:25:30 -0500 Subject: [PATCH 171/179] add migration guide --- .../main/asciidoc/migration-guide-3.x.adoc | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 docs/src/main/asciidoc/migration-guide-3.x.adoc diff --git a/docs/src/main/asciidoc/migration-guide-3.x.adoc b/docs/src/main/asciidoc/migration-guide-3.x.adoc new file mode 100644 index 0000000000..c8b4f4bc26 --- /dev/null +++ b/docs/src/main/asciidoc/migration-guide-3.x.adoc @@ -0,0 +1,143 @@ +== Migration Guide from Spring Cloud GCP v3.x to v4.x +=== Before you start +==== Upgrade to the 3.x version +This doc assumes you are running with Spring Cloud GCP 3.x. If you are currently running with an earlier major version of Spring Cloud GCP, i.e., 1.x or 2.x, we recommend that you upgrade to link:https://github.com/GoogleCloudPlatform/spring-cloud-gcp/releases/tag/v3.0.0[Spring Cloud GCP 3.x] before migrating to Spring Cloud GCP 4.0. + +* link:https://github.com/GoogleCloudPlatform/spring-cloud-gcp/blob/9e880aa2c23ed8a96727921686513e08da60f018/docs/src/main/asciidoc/migration-guide-1.x.adoc[Migration guide from Spring Cloud GCP 1.x to 2.x] +* link:https://github.com/GoogleCloudPlatform/spring-cloud-gcp/releases/tag/v3.0.0[Spring Cloud GCP 3.0 Release Note] + +Note that since Spring Cloud GCP 3.0 has few breaking changes, we only provide a release note. + +==== Review System requirements +Spring Cloud GCP 4.0 is built on Spring Boot 3.0 and Spring Framework 6.0, which requires Java 17 at minimum. If you are currently on Java 8 or Java 11, you need to upgrade your JDK before you can develop an application based on Spring Cloud GCP 4.0. + +==== Review Deprecations from 3.x +Classes, methods and properties that were deprecated in Spring Cloud GCP 3.x have been removed in this release. Please ensure that you aren’t calling deprecated methods before upgrading. + +=== Upgrade to Spring Cloud GCP 4.0 +==== Spring Boot 3.0 +Spring Cloud GCP 4.0 builds on Spring Boot 3.0. Review the link:https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide[Spring Boot 3.0 migration guide] before continuing. + +===== Review Dependencies +Run `mvn dependency:tree` (`gradlew dependencies` for Gradle projects) to see the dependency tree of your project. Ensure Spring-related dependencies have matching versions: + +* Spring Boot 3.0 +* Spring Cloud 2022.0 +** For detailed dependency versions, see "2022.0 (Kilburn)" column in link:https://github.com/spring-cloud/spring-cloud-release/wiki/Supported-Versions#supported-releases[Spring Cloud: Supported Versions] table. +* Spring Data 2022.0 +** For detailed dependency versions, see link:https://github.com/spring-projects/spring-data-commons/wiki/Spring-Data-2022.0-%28Turing%29-Release-Notes[Spring Data 2022.0 Release Note]. + +==== Update Bill of Materials (BOM) +If you’re a Maven user, add our BOM to your pom.xml `<dependencyManagement>` section. This will allow you to not specify versions for any of the Maven dependencies and instead delegate versioning to the BOM. + +[source, xml] +---- +<dependencyManagement> + <dependencies> + <dependency> + <groupId>com.google.cloud</groupId> + <artifactId>spring-cloud-gcp-dependencies</artifactId> + <version>4.0.0</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> +</dependencyManagement> +---- + +==== Cloud BigQuery +Replaced `ListenableFuture` and `SettableListenableFuture` with `CompletableFuture` as the former two Classes are deprecated in Spring Framework 6.0. + +==== Cloud SQL +MySQL R2DBC is not supported by Spring Cloud GCP 4.0 due to link:https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/issues/990[compatibility issues] with the Mariadb driver. + +==== Cloud Pub/Sub +Replaced `ListenableFuture` and `SettableListenableFuture` with `CompletableFuture` as the former two Classes are deprecated in Spring Framework 6.0. + +==== Spring Cloud Stream binder to Google Cloud Pub/Sub +Change to functional model as annotation-based model is removed from Spring Cloud Stream 4.0.0. + +==== Secret Manager +To enable the application to fetch a secret from SecretManager, add `spring.config.import=sm://` in the `application.properties` or `application.yml` files and inject the secret into the application by adding `application.secret=${sm://your-secret-name}`. Do not write secret values in the file. + +Please also remove `spring.cloud.gcp.secretmanager.enabled` and `spring.cloud.gcp.secretmanager.legacy` in `bootstrap.yml` or `bootstrap.properties` files. + +Please find more information in our link:https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/58b9fb9e034c7208df5398facbc96c5e8cdae916/spring-cloud-gcp-samples/spring-cloud-gcp-secretmanager-sample[sample] application. + +==== Cloud Trace +Annotation `org.springframework.cloud.sleuth.annotation.NewSpan` is deprecated in favor of `io.micrometer.observation.annotation.Observed` since Spring Boot 3.0 builds on Micrometer 1.0 rather than Spring Cloud Sleuth (which is excluded from the Spring Cloud release train). + +If you use `NewSpan` to generate an additional span, replace the annotation with `Observed`. The default name of the additional span is `<class-name>#<method-name>`. If you want to customize the additional span name, specify the `contextualName` parameter. + +Please also remove `spring.sleuth.enabled` from your `application.properties` or `application.yml` file. Note that `spring.cloud.gcp.trace.enabled=true` is still required if you want to enable Trace. + +This link:https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/28b8004fa09922d6dcbde19285c1faf7323c6644/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample[sample] is modified to show how to instrument trace and submit it to Cloud Trace. + +==== Cloud Vision +Replaced `ListenableFuture` and `SettableListenableFuture` with `CompletableFuture` as the former two Classes are deprecated in Spring Framework 6.0. + +=== Configuration Changelog +==== Removed +The following properties are removed from the codebase thus no longer needed in your application. + +* `spring.cloud.gcp.secretmanager.enabled` + +* `spring.cloud.gcp.secretmanager.legacy` + +See the "SecretManager" section. + +* `spring.sleuth.enabled` + +See the "Trace" section + +=== Deprecated Items Removed + +==== Cloud BigQuery +* `BigQueryTemplate(BigQuery bigQuery, String datasetName)` + +Use `BigQueryTemplate(BigQuery, BigQueryWriteClient, Map, TaskScheduler)` instead + +* `BigQueryTemplate(BigQuery, String, TaskScheduler)` + +Use `BigQueryTemplate(BigQuery, BigQueryWriteClient, Map, TaskScheduler)` instead + +==== Cloud Datastore +* `DatastorePersistentPropertyImpl.getPersistentEntityTypes()` + +Use `DatastorePersistentPropertyImpl.getPersistentEntityTypeInformation()` instead + +==== Cloud Pub/Sub +* `DefaultSubscriberFactory(GcpProjectIdProvider)` + +Use `DefaultSubscriberFactory(GcpProjectIdProvider, PubSubConfiguration)` instead + +* `PubSubConfiguration.computeSubscriberRetrySettings(String, String)` + +Use `PubSubConfiguration.computeSubscriberRetrySettings(ProjectSubscriptionName)` instead + +* `PubSubConfiguration.computeSubscriberFlowControlSettings(String, String)` + +Use `PubSubConfiguration.computeSubscriberFlowControlSettings(ProjectSubscriptionName)` instead + +* `PubSubConfiguration.getSubscriber(String, String)` + +Use `PubSubConfiguration.getSubscriptionProperties(ProjectSubscriptionName)` instead + +==== Secret Manager +`GcpSecretManagerBootstrapConfiguration` + +For how to fetch secrets from Secret Manager, refer to the Secret Manager section. + +==== Cloud Spanner +* `SpannerPersistentEntityImpl(TypeInformation<T>)` + +Use `SpannerPersistentEntityImpl(TypeInformation, SpannerMappingContext, SpannerEntityProcessor)` instead + +* `SpannerCompositeKeyProperty.getPersistentEntityTypes()` + +Use `SpannerCompositeKeyProperty.getPersistentEntityTypeInformation()` instead + +==== Cloud Trace +* `TracingSubscriberFactory.createSubscriberStub()` + +Use `TracingSubscriberFactory.createSubscriberStub(String)` instead From 131a161f8a2fb8bbe46471611fb311455b269851 Mon Sep 17 00:00:00 2001 From: Joe Wang <joewa@google.com> Date: Wed, 18 Jan 2023 13:54:00 -0500 Subject: [PATCH 172/179] remove trash files --- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 19 ------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 19 ------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 19 ------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 19 ------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 19 ------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 19 ------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 19 ------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 19 ------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 19 ------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 24 ----------------- .../maven-metadata-local.xml | 11 -------- .../3.5.0-SNAPSHOT/maven-metadata-local.xml | 19 ------------- .../spring-cloud-gcp/maven-metadata-local.xml | 11 -------- .../maven-metadata-central.xml | 27 ------------------- 181 files changed, 3127 deletions(-) delete mode 100644 spring-cloud-gcp-dependencies/~/.m2/repository/com/google/cloud/spring-cloud-gcp-dependencies/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 spring-cloud-gcp-dependencies/~/.m2/repository/com/google/cloud/spring-cloud-gcp-dependencies/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-autoconfigure/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-autoconfigure/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-bigquery-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-bigquery-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-bigquery/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-bigquery/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-cloudfoundry/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-cloudfoundry/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-config-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-config-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-core/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-core/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore-basic-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore-basic-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-firestore-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-firestore-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-firestore/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-firestore/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-jpa-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-jpa-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-multi-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-multi-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner-repository-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner-repository-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner-template-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner-template-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-dependencies/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-dependencies/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-docs/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-docs/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-firestore-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-firestore-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-json-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-json-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-polling-receiver/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-polling-receiver/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-receiver/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-receiver/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-sender/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-sender/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-test/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-test/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-storage-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-storage-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-kms-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-kms-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-kms/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-kms/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-kotlin-app-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-kotlin-app-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-kotlin-samples/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-kotlin-samples/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-logging-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-logging-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-logging/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-logging/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-metrics-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-metrics-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-client/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-client/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-server-github/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-server-github/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-server-local/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-server-local/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-test/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-test/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-reactive-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-reactive-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-binder/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-binder/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-dead-letter-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-dead-letter-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-sink/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-sink/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-source/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-source/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-test/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-test/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-samples/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-samples/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-secretmanager-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-secretmanager-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-secretmanager/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-secretmanager/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-firebase-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-firebase-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-firebase/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-firebase/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-iap-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-iap-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-iap/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-iap/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-mysql-r2dbc-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-mysql-r2dbc-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-mysql-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-mysql-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-postgres-r2dbc-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-postgres-r2dbc-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-postgres-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-postgres-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-bigquery/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-bigquery/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-bus-pubsub/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-bus-pubsub/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-cloudfoundry/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-cloudfoundry/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-config/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-config/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-datastore/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-datastore/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-firestore/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-firestore/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-spanner/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-spanner/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-firestore/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-firestore/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-kms/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-kms/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-logging/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-logging/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-metrics/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-metrics/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-pubsub/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-pubsub/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-secretmanager/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-secretmanager/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-security-firebase/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-security-firebase/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-security-iap/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-security-iap/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-mysql-r2dbc/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-mysql-r2dbc/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-mysql/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-mysql/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-postgres-r2dbc/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-postgres-r2dbc/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-postgresql/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-postgresql/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-storage/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-storage/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-trace/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-trace/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-vision/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-vision/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starters/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-starters/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-storage-resource-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-storage-resource-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-storage/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-storage/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-trace-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-trace-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision-api-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision-api-sample/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision-ocr-demo/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision-ocr-demo/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp/3.5.0-SNAPSHOT/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/com/google/cloud/spring-cloud-gcp/maven-metadata-local.xml delete mode 100644 ~/.m2/repository/org/codehaus/mojo/flatten-maven-plugin/maven-metadata-central.xml diff --git a/spring-cloud-gcp-dependencies/~/.m2/repository/com/google/cloud/spring-cloud-gcp-dependencies/3.5.0-SNAPSHOT/maven-metadata-local.xml b/spring-cloud-gcp-dependencies/~/.m2/repository/com/google/cloud/spring-cloud-gcp-dependencies/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 77f138b530..0000000000 --- a/spring-cloud-gcp-dependencies/~/.m2/repository/com/google/cloud/spring-cloud-gcp-dependencies/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-dependencies</artifactId> - <versioning> - <lastUpdated>20221105003604</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221105003604</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/spring-cloud-gcp-dependencies/~/.m2/repository/com/google/cloud/spring-cloud-gcp-dependencies/maven-metadata-local.xml b/spring-cloud-gcp-dependencies/~/.m2/repository/com/google/cloud/spring-cloud-gcp-dependencies/maven-metadata-local.xml deleted file mode 100644 index d0316766e8..0000000000 --- a/spring-cloud-gcp-dependencies/~/.m2/repository/com/google/cloud/spring-cloud-gcp-dependencies/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-dependencies</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221105003604</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-autoconfigure/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-autoconfigure/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index d52cdc2f84..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-autoconfigure/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-autoconfigure</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-autoconfigure/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-autoconfigure/maven-metadata-local.xml deleted file mode 100644 index b5a08c1ce6..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-autoconfigure/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-autoconfigure</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-bigquery-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-bigquery-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 214100898e..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-bigquery-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-bigquery-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-bigquery-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-bigquery-sample/maven-metadata-local.xml deleted file mode 100644 index ad5fa01a46..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-bigquery-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-bigquery-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-bigquery/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-bigquery/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index b8fd7d8400..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-bigquery/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-bigquery</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-bigquery/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-bigquery/maven-metadata-local.xml deleted file mode 100644 index 2b57602c0b..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-bigquery/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-bigquery</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-cloudfoundry/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-cloudfoundry/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index f2d3c02dc5..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-cloudfoundry/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-cloudfoundry</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-cloudfoundry/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-cloudfoundry/maven-metadata-local.xml deleted file mode 100644 index 6397b28dc8..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-cloudfoundry/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-cloudfoundry</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-config-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-config-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index d559b83ea2..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-config-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-config-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-config-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-config-sample/maven-metadata-local.xml deleted file mode 100644 index bd96a755de..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-config-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-config-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-core/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-core/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index e9bcab3249..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-core/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-core</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-core/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-core/maven-metadata-local.xml deleted file mode 100644 index 1b92a19efe..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-core/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-core</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore-basic-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore-basic-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index e77593134b..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore-basic-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-data-datastore-basic-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore-basic-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore-basic-sample/maven-metadata-local.xml deleted file mode 100644 index fb460e5bcf..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore-basic-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-data-datastore-basic-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 6b79eca6fd..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-data-datastore-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore-sample/maven-metadata-local.xml deleted file mode 100644 index 43eadcfb4c..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-data-datastore-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index f2396f3058..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-data-datastore</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore/maven-metadata-local.xml deleted file mode 100644 index 3467732d17..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-datastore/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-data-datastore</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-firestore-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-firestore-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 79fabcf755..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-firestore-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-data-firestore-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-firestore-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-firestore-sample/maven-metadata-local.xml deleted file mode 100644 index 5a644fc1d4..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-firestore-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-data-firestore-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-firestore/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-firestore/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index cfa7e8114f..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-firestore/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-data-firestore</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-firestore/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-firestore/maven-metadata-local.xml deleted file mode 100644 index f1a56a65c1..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-firestore/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-data-firestore</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-jpa-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-jpa-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 42156e86c1..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-jpa-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-data-jpa-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-jpa-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-jpa-sample/maven-metadata-local.xml deleted file mode 100644 index 2a2371accf..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-jpa-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-data-jpa-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-multi-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-multi-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 066eeef94c..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-multi-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-data-multi-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-multi-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-multi-sample/maven-metadata-local.xml deleted file mode 100644 index 373cc8ec1e..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-multi-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-data-multi-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner-repository-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner-repository-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index ba32fb22f8..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner-repository-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-data-spanner-repository-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner-repository-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner-repository-sample/maven-metadata-local.xml deleted file mode 100644 index 041adbdd6e..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner-repository-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-data-spanner-repository-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner-template-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner-template-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 51117d6d02..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner-template-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-data-spanner-template-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner-template-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner-template-sample/maven-metadata-local.xml deleted file mode 100644 index a8bf7f70b8..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner-template-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-data-spanner-template-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 749bb4a7cd..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-data-spanner</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner/maven-metadata-local.xml deleted file mode 100644 index 7d9289666a..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-data-spanner/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-data-spanner</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-dependencies/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-dependencies/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 716eba8191..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-dependencies/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-dependencies</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-dependencies/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-dependencies/maven-metadata-local.xml deleted file mode 100644 index ba2fef66a5..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-dependencies/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-dependencies</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-docs/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-docs/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 35ac590e99..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-docs/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-docs</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-docs/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-docs/maven-metadata-local.xml deleted file mode 100644 index 7522f36748..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-docs/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-docs</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-firestore-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-firestore-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 6404c36508..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-firestore-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-firestore-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-firestore-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-firestore-sample/maven-metadata-local.xml deleted file mode 100644 index 50844eddf5..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-firestore-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-firestore-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-json-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-json-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 266d43f0d1..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-json-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-integration-pubsub-json-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-json-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-json-sample/maven-metadata-local.xml deleted file mode 100644 index 76cf7d50d9..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-json-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-integration-pubsub-json-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-polling-receiver/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-polling-receiver/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 578f6f4ec2..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-polling-receiver/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-integration-pubsub-sample-polling-receiver</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-polling-receiver/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-polling-receiver/maven-metadata-local.xml deleted file mode 100644 index d3df7cb32b..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-polling-receiver/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-integration-pubsub-sample-polling-receiver</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-receiver/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-receiver/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index f7181d3438..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-receiver/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-integration-pubsub-sample-receiver</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-receiver/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-receiver/maven-metadata-local.xml deleted file mode 100644 index 8d204a7229..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-receiver/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-integration-pubsub-sample-receiver</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-sender/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-sender/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index b53fe563bf..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-sender/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-integration-pubsub-sample-sender</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-sender/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-sender/maven-metadata-local.xml deleted file mode 100644 index 4410d8e0e3..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-sender/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-integration-pubsub-sample-sender</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-test/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-test/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 2c84372186..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-test/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-integration-pubsub-sample-test</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-test/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-test/maven-metadata-local.xml deleted file mode 100644 index e1f284038d..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample-test/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-integration-pubsub-sample-test</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index dbdd9e7ea5..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-integration-pubsub-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample/maven-metadata-local.xml deleted file mode 100644 index b2a5f002d2..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-pubsub-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-integration-pubsub-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-storage-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-storage-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 1f3253fbc6..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-storage-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-integration-storage-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-storage-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-storage-sample/maven-metadata-local.xml deleted file mode 100644 index 4f3738d6ff..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-integration-storage-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-integration-storage-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kms-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kms-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index c02f0ac7c8..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kms-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-kms-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kms-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kms-sample/maven-metadata-local.xml deleted file mode 100644 index f0e0b6e499..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kms-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-kms-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kms/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kms/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 1cbd79ec16..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kms/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-kms</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kms/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kms/maven-metadata-local.xml deleted file mode 100644 index 0049b71983..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kms/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-kms</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kotlin-app-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kotlin-app-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index e43ab060b3..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kotlin-app-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-kotlin-app-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kotlin-app-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kotlin-app-sample/maven-metadata-local.xml deleted file mode 100644 index 3141baa31a..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kotlin-app-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-kotlin-app-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kotlin-samples/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kotlin-samples/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index c99cfd6c38..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kotlin-samples/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-kotlin-samples</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kotlin-samples/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kotlin-samples/maven-metadata-local.xml deleted file mode 100644 index 34d9e20956..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-kotlin-samples/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-kotlin-samples</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-logging-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-logging-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 4311a8ba8a..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-logging-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-logging-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-logging-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-logging-sample/maven-metadata-local.xml deleted file mode 100644 index d7d39ef4cd..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-logging-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-logging-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-logging/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-logging/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 9bd3b6ca04..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-logging/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-logging</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-logging/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-logging/maven-metadata-local.xml deleted file mode 100644 index 2099b3a0ea..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-logging/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-logging</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-metrics-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-metrics-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index c15d4be493..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-metrics-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-metrics-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-metrics-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-metrics-sample/maven-metadata-local.xml deleted file mode 100644 index 71ddc6035b..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-metrics-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-metrics-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-client/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-client/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 88bf0c1abc..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-client/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-bus-config-sample-client</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-client/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-client/maven-metadata-local.xml deleted file mode 100644 index 16fbb4e904..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-client/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-bus-config-sample-client</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-server-github/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-server-github/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 2cea71a3f5..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-server-github/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-bus-config-sample-server-github</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-server-github/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-server-github/maven-metadata-local.xml deleted file mode 100644 index 0357905818..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-server-github/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-bus-config-sample-server-github</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-server-local/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-server-local/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 70a906bdee..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-server-local/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-bus-config-sample-server-local</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-server-local/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-server-local/maven-metadata-local.xml deleted file mode 100644 index bc543c9f57..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-server-local/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-bus-config-sample-server-local</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-test/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-test/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 493b4e444b..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-test/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-bus-config-sample-test</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-test/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-test/maven-metadata-local.xml deleted file mode 100644 index 93e60db7ab..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample-test/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-bus-config-sample-test</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 0df673e4ba..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-bus-config-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample/maven-metadata-local.xml deleted file mode 100644 index f8f989e606..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-bus-config-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-bus-config-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-reactive-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-reactive-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 1812730f42..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-reactive-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-reactive-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-reactive-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-reactive-sample/maven-metadata-local.xml deleted file mode 100644 index f97462fbd6..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-reactive-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-reactive-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 74d103f36b..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-sample/maven-metadata-local.xml deleted file mode 100644 index 1997356e58..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-binder/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-binder/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index f6dc363a1e..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-binder/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-stream-binder</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-binder/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-binder/maven-metadata-local.xml deleted file mode 100644 index d8573d2279..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-binder/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-stream-binder</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-dead-letter-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-dead-letter-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 558e2ac117..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-dead-letter-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-stream-dead-letter-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-dead-letter-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-dead-letter-sample/maven-metadata-local.xml deleted file mode 100644 index 5aac40551e..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-dead-letter-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-stream-dead-letter-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-sink/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-sink/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 8df555e315..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-sink/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-stream-functional-sample-sink</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-sink/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-sink/maven-metadata-local.xml deleted file mode 100644 index c0b20b60a8..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-sink/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-stream-functional-sample-sink</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-source/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-source/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 7b86d1f8df..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-source/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-stream-functional-sample-source</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-source/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-source/maven-metadata-local.xml deleted file mode 100644 index 5564f5bce9..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-source/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-stream-functional-sample-source</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-test/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-test/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index d5fda6585c..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-test/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-stream-functional-sample-test</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-test/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-test/maven-metadata-local.xml deleted file mode 100644 index 5145c7dede..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample-test/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-stream-functional-sample-test</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 1242633309..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-stream-functional-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample/maven-metadata-local.xml deleted file mode 100644 index 5855472412..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub-stream-functional-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub-stream-functional-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 1d38f69b16..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub/maven-metadata-local.xml deleted file mode 100644 index b025cdf105..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-pubsub/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-pubsub</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-samples/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-samples/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index e308401000..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-samples/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-samples</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-samples/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-samples/maven-metadata-local.xml deleted file mode 100644 index 989643dd41..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-samples/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-samples</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-secretmanager-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-secretmanager-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 1737aa18c3..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-secretmanager-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-secretmanager-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-secretmanager-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-secretmanager-sample/maven-metadata-local.xml deleted file mode 100644 index 66f4434912..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-secretmanager-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-secretmanager-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-secretmanager/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-secretmanager/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 1e7852c634..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-secretmanager/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-secretmanager</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-secretmanager/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-secretmanager/maven-metadata-local.xml deleted file mode 100644 index 18b1f24689..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-secretmanager/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-secretmanager</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-firebase-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-firebase-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 5b607caf1b..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-firebase-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-security-firebase-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-firebase-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-firebase-sample/maven-metadata-local.xml deleted file mode 100644 index 85d2d031a4..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-firebase-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-security-firebase-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-firebase/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-firebase/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index e2767771bd..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-firebase/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-security-firebase</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-firebase/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-firebase/maven-metadata-local.xml deleted file mode 100644 index ab5ccb6168..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-firebase/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-security-firebase</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-iap-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-iap-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index e15fc1e05e..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-iap-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-security-iap-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-iap-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-iap-sample/maven-metadata-local.xml deleted file mode 100644 index c472321c19..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-iap-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-security-iap-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-iap/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-iap/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 7bceee80b2..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-iap/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-security-iap</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-iap/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-iap/maven-metadata-local.xml deleted file mode 100644 index b1a987ae70..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-security-iap/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-security-iap</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-mysql-r2dbc-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-mysql-r2dbc-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 62b46afac8..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-mysql-r2dbc-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-sql-mysql-r2dbc-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-mysql-r2dbc-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-mysql-r2dbc-sample/maven-metadata-local.xml deleted file mode 100644 index 8ce614f1f2..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-mysql-r2dbc-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-sql-mysql-r2dbc-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-mysql-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-mysql-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 8bb81cb90d..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-mysql-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-sql-mysql-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-mysql-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-mysql-sample/maven-metadata-local.xml deleted file mode 100644 index 0018632eba..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-mysql-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-sql-mysql-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-postgres-r2dbc-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-postgres-r2dbc-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index b46ca779e5..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-postgres-r2dbc-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-sql-postgres-r2dbc-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-postgres-r2dbc-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-postgres-r2dbc-sample/maven-metadata-local.xml deleted file mode 100644 index 92f967927c..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-postgres-r2dbc-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-sql-postgres-r2dbc-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-postgres-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-postgres-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 65813665b7..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-postgres-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-sql-postgres-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-postgres-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-postgres-sample/maven-metadata-local.xml deleted file mode 100644 index 46fafb5f54..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-sql-postgres-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-sql-postgres-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-bigquery/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-bigquery/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 7dae0816ea..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-bigquery/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-bigquery</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-bigquery/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-bigquery/maven-metadata-local.xml deleted file mode 100644 index 10b0f85d58..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-bigquery/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-bigquery</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-bus-pubsub/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-bus-pubsub/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 1ac3dc40ae..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-bus-pubsub/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-bus-pubsub</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-bus-pubsub/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-bus-pubsub/maven-metadata-local.xml deleted file mode 100644 index 21bf4d56b7..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-bus-pubsub/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-bus-pubsub</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-cloudfoundry/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-cloudfoundry/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index b2dda18f41..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-cloudfoundry/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-cloudfoundry</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-cloudfoundry/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-cloudfoundry/maven-metadata-local.xml deleted file mode 100644 index 5e3e15f42b..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-cloudfoundry/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-cloudfoundry</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-config/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-config/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 464b32bf7c..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-config/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-config</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-config/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-config/maven-metadata-local.xml deleted file mode 100644 index ee46036926..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-config/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-config</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-datastore/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-datastore/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 6616446bb0..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-datastore/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-data-datastore</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-datastore/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-datastore/maven-metadata-local.xml deleted file mode 100644 index 635b1a34b8..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-datastore/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-data-datastore</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-firestore/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-firestore/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index ca5334c87f..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-firestore/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-data-firestore</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-firestore/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-firestore/maven-metadata-local.xml deleted file mode 100644 index 29464efbb8..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-firestore/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-data-firestore</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-spanner/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-spanner/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 6ecd495faf..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-spanner/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-data-spanner</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-spanner/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-spanner/maven-metadata-local.xml deleted file mode 100644 index b554612c65..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-data-spanner/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-data-spanner</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-firestore/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-firestore/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index a0725964c8..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-firestore/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-firestore</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-firestore/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-firestore/maven-metadata-local.xml deleted file mode 100644 index 6d25df2391..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-firestore/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-firestore</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-kms/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-kms/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index a0fc4f0744..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-kms/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-kms</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-kms/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-kms/maven-metadata-local.xml deleted file mode 100644 index bf9ec43a0a..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-kms/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-kms</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-logging/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-logging/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 6c08a909a1..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-logging/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-logging</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-logging/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-logging/maven-metadata-local.xml deleted file mode 100644 index 3066ee9ef4..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-logging/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-logging</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-metrics/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-metrics/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 30f9452d07..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-metrics/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-metrics</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-metrics/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-metrics/maven-metadata-local.xml deleted file mode 100644 index 5764467df3..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-metrics/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-metrics</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-pubsub/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-pubsub/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 8c414024b9..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-pubsub/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-pubsub</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-pubsub/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-pubsub/maven-metadata-local.xml deleted file mode 100644 index d8b35126a5..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-pubsub/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-pubsub</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-secretmanager/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-secretmanager/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index de0aad9f02..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-secretmanager/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-secretmanager</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-secretmanager/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-secretmanager/maven-metadata-local.xml deleted file mode 100644 index 6f870c0556..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-secretmanager/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-secretmanager</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-security-firebase/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-security-firebase/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 11b51d2388..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-security-firebase/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-security-firebase</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-security-firebase/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-security-firebase/maven-metadata-local.xml deleted file mode 100644 index 19466a09fc..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-security-firebase/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-security-firebase</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-security-iap/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-security-iap/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index c61aa9fccf..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-security-iap/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-security-iap</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-security-iap/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-security-iap/maven-metadata-local.xml deleted file mode 100644 index bef754c8aa..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-security-iap/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-security-iap</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-mysql-r2dbc/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-mysql-r2dbc/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index cddefc368a..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-mysql-r2dbc/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-sql-mysql-r2dbc</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-mysql-r2dbc/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-mysql-r2dbc/maven-metadata-local.xml deleted file mode 100644 index 6fd06e69ac..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-mysql-r2dbc/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-sql-mysql-r2dbc</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-mysql/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-mysql/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 32fffb8a68..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-mysql/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-sql-mysql</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-mysql/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-mysql/maven-metadata-local.xml deleted file mode 100644 index a653ff00f7..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-mysql/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-sql-mysql</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-postgres-r2dbc/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-postgres-r2dbc/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index b27cc07b93..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-postgres-r2dbc/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-sql-postgres-r2dbc</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-postgres-r2dbc/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-postgres-r2dbc/maven-metadata-local.xml deleted file mode 100644 index 59a8044657..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-postgres-r2dbc/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-sql-postgres-r2dbc</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-postgresql/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-postgresql/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 2423499e34..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-postgresql/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-sql-postgresql</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-postgresql/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-postgresql/maven-metadata-local.xml deleted file mode 100644 index c8226a2aa2..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-sql-postgresql/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-sql-postgresql</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-storage/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-storage/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 5446ced010..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-storage/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-storage</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-storage/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-storage/maven-metadata-local.xml deleted file mode 100644 index f5ff649fe9..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-storage/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-storage</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-trace/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-trace/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index e8da02ab6a..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-trace/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-trace</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-trace/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-trace/maven-metadata-local.xml deleted file mode 100644 index cd66f6ada9..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-trace/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-trace</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-vision/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-vision/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index fe9f775800..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-vision/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-vision</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-vision/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-vision/maven-metadata-local.xml deleted file mode 100644 index f8c6c09538..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter-vision/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter-vision</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 9e108a17a2..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter/maven-metadata-local.xml deleted file mode 100644 index 9e0065ef86..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starter/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starter</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starters/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starters/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index b4dc6a0b41..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starters/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starters</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starters/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starters/maven-metadata-local.xml deleted file mode 100644 index a28da822ec..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-starters/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-starters</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-storage-resource-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-storage-resource-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index a7817d60d3..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-storage-resource-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-storage-resource-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-storage-resource-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-storage-resource-sample/maven-metadata-local.xml deleted file mode 100644 index 0ca592d9db..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-storage-resource-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-storage-resource-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-storage/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-storage/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 309bbdbd07..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-storage/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-storage</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-storage/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-storage/maven-metadata-local.xml deleted file mode 100644 index 2cfb7fdf70..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-storage/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-storage</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-trace-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-trace-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index cb532c6ba8..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-trace-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-trace-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-trace-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-trace-sample/maven-metadata-local.xml deleted file mode 100644 index 8f1fb54272..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-trace-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-trace-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision-api-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision-api-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 9d582e2e33..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision-api-sample/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-vision-api-sample</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision-api-sample/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision-api-sample/maven-metadata-local.xml deleted file mode 100644 index 129c91dc83..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision-api-sample/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-vision-api-sample</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision-ocr-demo/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision-ocr-demo/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 06bb2e4cd8..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision-ocr-demo/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-vision-ocr-demo</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision-ocr-demo/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision-ocr-demo/maven-metadata-local.xml deleted file mode 100644 index ff22f5e66a..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision-ocr-demo/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-vision-ocr-demo</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index a53d3a048e..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-vision</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>jar</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision/maven-metadata-local.xml deleted file mode 100644 index 83a851ba37..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp-vision/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp-vision</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp/3.5.0-SNAPSHOT/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp/3.5.0-SNAPSHOT/maven-metadata-local.xml deleted file mode 100644 index 019d046c04..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp/3.5.0-SNAPSHOT/maven-metadata-local.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata modelVersion="1.1.0"> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp</artifactId> - <versioning> - <lastUpdated>20221107185524</lastUpdated> - <snapshot> - <localCopy>true</localCopy> - </snapshot> - <snapshotVersions> - <snapshotVersion> - <extension>pom</extension> - <value>3.5.0-SNAPSHOT</value> - <updated>20221107185524</updated> - </snapshotVersion> - </snapshotVersions> - </versioning> - <version>3.5.0-SNAPSHOT</version> -</metadata> diff --git a/~/.m2/repository/com/google/cloud/spring-cloud-gcp/maven-metadata-local.xml b/~/.m2/repository/com/google/cloud/spring-cloud-gcp/maven-metadata-local.xml deleted file mode 100644 index c997fb4d62..0000000000 --- a/~/.m2/repository/com/google/cloud/spring-cloud-gcp/maven-metadata-local.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>com.google.cloud</groupId> - <artifactId>spring-cloud-gcp</artifactId> - <versioning> - <versions> - <version>3.5.0-SNAPSHOT</version> - </versions> - <lastUpdated>20221107185524</lastUpdated> - </versioning> -</metadata> diff --git a/~/.m2/repository/org/codehaus/mojo/flatten-maven-plugin/maven-metadata-central.xml b/~/.m2/repository/org/codehaus/mojo/flatten-maven-plugin/maven-metadata-central.xml deleted file mode 100644 index 658ea968df..0000000000 --- a/~/.m2/repository/org/codehaus/mojo/flatten-maven-plugin/maven-metadata-central.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<metadata> - <groupId>org.codehaus.mojo</groupId> - <artifactId>flatten-maven-plugin</artifactId> - <versioning> - <latest>1.3.0</latest> - <release>1.3.0</release> - <versions> - <version>1.0.0-beta-1</version> - <version>1.0.0-beta-2</version> - <version>1.0.0-beta-3</version> - <version>1.0.0-beta-4</version> - <version>1.0.0-beta-5</version> - <version>1.0.0</version> - <version>1.0.1</version> - <version>1.1.0</version> - <version>1.2.1</version> - <version>1.2.2</version> - <version>1.2.3</version> - <version>1.2.4</version> - <version>1.2.5</version> - <version>1.2.7</version> - <version>1.3.0</version> - </versions> - <lastUpdated>20220816215541</lastUpdated> - </versioning> -</metadata> From 911aeb8532350cd2519f4d2f03536545e00bb263 Mon Sep 17 00:00:00 2001 From: Joe Wang <joewa@google.com> Date: Wed, 18 Jan 2023 15:52:40 -0500 Subject: [PATCH 173/179] change to one sentence per line --- .../main/asciidoc/migration-guide-3.x.adoc | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/docs/src/main/asciidoc/migration-guide-3.x.adoc b/docs/src/main/asciidoc/migration-guide-3.x.adoc index c8b4f4bc26..e1be83d959 100644 --- a/docs/src/main/asciidoc/migration-guide-3.x.adoc +++ b/docs/src/main/asciidoc/migration-guide-3.x.adoc @@ -1,7 +1,9 @@ == Migration Guide from Spring Cloud GCP v3.x to v4.x === Before you start ==== Upgrade to the 3.x version -This doc assumes you are running with Spring Cloud GCP 3.x. If you are currently running with an earlier major version of Spring Cloud GCP, i.e., 1.x or 2.x, we recommend that you upgrade to link:https://github.com/GoogleCloudPlatform/spring-cloud-gcp/releases/tag/v3.0.0[Spring Cloud GCP 3.x] before migrating to Spring Cloud GCP 4.0. +This doc assumes you are running with Spring Cloud GCP 3.x. + +If you are currently running with an earlier major version of Spring Cloud GCP, i.e., 1.x or 2.x, we recommend that you upgrade to link:https://github.com/GoogleCloudPlatform/spring-cloud-gcp/releases/tag/v3.0.0[Spring Cloud GCP 3.x] before migrating to Spring Cloud GCP 4.0. * link:https://github.com/GoogleCloudPlatform/spring-cloud-gcp/blob/9e880aa2c23ed8a96727921686513e08da60f018/docs/src/main/asciidoc/migration-guide-1.x.adoc[Migration guide from Spring Cloud GCP 1.x to 2.x] * link:https://github.com/GoogleCloudPlatform/spring-cloud-gcp/releases/tag/v3.0.0[Spring Cloud GCP 3.0 Release Note] @@ -9,10 +11,12 @@ This doc assumes you are running with Spring Cloud GCP 3.x. If you are currently Note that since Spring Cloud GCP 3.0 has few breaking changes, we only provide a release note. ==== Review System requirements -Spring Cloud GCP 4.0 is built on Spring Boot 3.0 and Spring Framework 6.0, which requires Java 17 at minimum. If you are currently on Java 8 or Java 11, you need to upgrade your JDK before you can develop an application based on Spring Cloud GCP 4.0. +Spring Cloud GCP 4.0 is built on Spring Boot 3.0 and Spring Framework 6.0, which requires Java 17 at minimum. +If you are currently on Java 8 or Java 11, you need to upgrade your JDK before you can develop an application based on Spring Cloud GCP 4.0. ==== Review Deprecations from 3.x -Classes, methods and properties that were deprecated in Spring Cloud GCP 3.x have been removed in this release. Please ensure that you aren’t calling deprecated methods before upgrading. +Classes, methods and properties that were deprecated in Spring Cloud GCP 3.x have been removed in this release. +Please ensure that you aren’t calling deprecated methods before upgrading. === Upgrade to Spring Cloud GCP 4.0 ==== Spring Boot 3.0 @@ -28,7 +32,8 @@ Run `mvn dependency:tree` (`gradlew dependencies` for Gradle projects) to see th ** For detailed dependency versions, see link:https://github.com/spring-projects/spring-data-commons/wiki/Spring-Data-2022.0-%28Turing%29-Release-Notes[Spring Data 2022.0 Release Note]. ==== Update Bill of Materials (BOM) -If you’re a Maven user, add our BOM to your pom.xml `<dependencyManagement>` section. This will allow you to not specify versions for any of the Maven dependencies and instead delegate versioning to the BOM. +If you’re a Maven user, add our BOM to your pom.xml `<dependencyManagement>` section. +This will allow you to not specify versions for any of the Maven dependencies and instead delegate versioning to the BOM. [source, xml] ---- @@ -58,7 +63,8 @@ Replaced `ListenableFuture` and `SettableListenableFuture` with `CompletableFutu Change to functional model as annotation-based model is removed from Spring Cloud Stream 4.0.0. ==== Secret Manager -To enable the application to fetch a secret from SecretManager, add `spring.config.import=sm://` in the `application.properties` or `application.yml` files and inject the secret into the application by adding `application.secret=${sm://your-secret-name}`. Do not write secret values in the file. +To enable the application to fetch a secret from SecretManager, add `spring.config.import=sm://` in the `application.properties` or `application.yml` files and inject the secret into the application by adding `application.secret=${sm://your-secret-name}`. +Do not write secret values in the file. Please also remove `spring.cloud.gcp.secretmanager.enabled` and `spring.cloud.gcp.secretmanager.legacy` in `bootstrap.yml` or `bootstrap.properties` files. @@ -67,9 +73,12 @@ Please find more information in our link:https://github.com/GoogleCloudPlatform/ ==== Cloud Trace Annotation `org.springframework.cloud.sleuth.annotation.NewSpan` is deprecated in favor of `io.micrometer.observation.annotation.Observed` since Spring Boot 3.0 builds on Micrometer 1.0 rather than Spring Cloud Sleuth (which is excluded from the Spring Cloud release train). -If you use `NewSpan` to generate an additional span, replace the annotation with `Observed`. The default name of the additional span is `<class-name>#<method-name>`. If you want to customize the additional span name, specify the `contextualName` parameter. +If you use `NewSpan` to generate an additional span, replace the annotation with `Observed`. +The default name of the additional span is `<class-name>#<method-name>`. +If you want to customize the additional span name, specify the `contextualName` parameter. -Please also remove `spring.sleuth.enabled` from your `application.properties` or `application.yml` file. Note that `spring.cloud.gcp.trace.enabled=true` is still required if you want to enable Trace. +Please also remove `spring.sleuth.enabled` from your `application.properties` or `application.yml` file. +Note that `spring.cloud.gcp.trace.enabled=true` is still required if you want to enable Trace. This link:https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/28b8004fa09922d6dcbde19285c1faf7323c6644/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample[sample] is modified to show how to instrument trace and submit it to Cloud Trace. From 7fefee2030df4db77ca14ab31517b4d49fb0fcb3 Mon Sep 17 00:00:00 2001 From: Joe Wang <joewa@google.com> Date: Wed, 18 Jan 2023 20:06:24 -0500 Subject: [PATCH 174/179] add migration guide (markdown format) --- docs/src/main/md/migration-guide-3.x.md | 139 ++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 docs/src/main/md/migration-guide-3.x.md diff --git a/docs/src/main/md/migration-guide-3.x.md b/docs/src/main/md/migration-guide-3.x.md new file mode 100644 index 0000000000..2ae3e634c6 --- /dev/null +++ b/docs/src/main/md/migration-guide-3.x.md @@ -0,0 +1,139 @@ +## Migration Guide from Spring Cloud GCP 3.x to 4.x + +### Before you start + +#### Upgrade to the 3.x version +This doc assumes you are running with Spring Cloud GCP 3.x. + +If you are currently running with an earlier major version of Spring Cloud GCP, i.e., 1.x or 2.x, we recommend that you upgrade to [Spring Cloud GCP 3.x](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/releases/tag/v3.0.0) before migrating to Spring Cloud GCP 4.0. + +- [Migration guide from Spring Cloud GCP 1.x to 2.x](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/blob/main/docs/src/main/asciidoc/migration-guide-1.x.adoc) +- [Spring Cloud GCP 3.0 Release Note](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/releases/tag/v3.0.0) + +Note that since Spring Cloud GCP 3.0 has few breaking changes, we only provide a release note. + +#### Review System requirements +Spring Cloud GCP 4.0 is built on Spring Boot 3.0 and Spring Framework 6.0, which requires Java 17 at minimum. +If you are currently on Java 8 or Java 11, you need to upgrade your JDK before you can develop an application based on Spring Cloud GCP 4.0. + +#### Review Deprecations from 3.x +Classes, methods and properties that were deprecated in Spring Cloud GCP 3.x have been removed in this release. +Please ensure that you aren’t calling deprecated methods before upgrading. + +### Upgrade to Spring Cloud GCP 4.0 +#### Spring Boot 3.0 +Spring Cloud GCP 4.0 builds on Spring Boot 3.0. Review the [Spring Boot 3.0 migration guide](https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide) before continuing. + +##### Review Dependencies +Run `mvn dependency:tree` (`gradlew dependencies` for Gradle projects) to see the dependency tree of your project. +Ensure Spring-related dependencies have matching versions: + +- Spring Boot 3.0 +- Spring Cloud 2022.0 + - For detailed dependency versions, see "2022.0 (Kilburn)" column in [Spring Cloud: Supported Versions](https://github.com/spring-cloud/spring-cloud-release/wiki/Supported-Versions#supported-releases) table. +- Spring Data 2022.0 + - For detailed dependency versions, see [Spring Data 2022.0 Release Note](https://github.com/spring-projects/spring-data-commons/wiki/Spring-Data-2022.0-%28Turing%29-Release-Notes). + +#### Update Bill of Materials (BOM) +If you’re a Maven user, add our BOM to your pom.xml `<dependencyManagement>` section. +This will allow you to not specify versions for any of the Maven dependencies and instead delegate versioning to the BOM. + +```xml +<dependencyManagement> + <dependencies> + <dependency> + <groupId>com.google.cloud</groupId> + <artifactId>spring-cloud-gcp-dependencies</artifactId> + <version>4.0.0</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> +</dependencyManagement> +``` + +#### Cloud BigQuery +Replaced `ListenableFuture` and `SettableListenableFuture` with `CompletableFuture` as the former two Classes are deprecated in Spring Framework 6.0. + +#### Cloud SQL +MySQL R2DBC is not supported by Spring Cloud GCP 4.0 due to [compatibility issues](https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/issues/990) with the Mariadb driver. + +#### Cloud Pub/Sub +Replaced `ListenableFuture` and `SettableListenableFuture` with `CompletableFuture` as the former two Classes are deprecated in Spring Framework 6.0. + +#### Spring Cloud Stream binder to Google Cloud Pub/Sub +Change to functional model as annotation-based model is removed from Spring Cloud Stream 4.0.0. + +#### Secret Manager +To enable the application to fetch a secret from SecretManager, add `spring.config.import=sm://` in the `application.properties` or `application.yml` files and inject the secret into the application by adding `application.secret=${sm://your-secret-name}`. +Do not write secret values in the file. + +Please also remove `spring.cloud.gcp.secretmanager.enabled` and `spring.cloud.gcp.secretmanager.legacy` in `bootstrap.yml` or `bootstrap.properties` files. + +Please find more information in our [sample](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/58b9fb9e034c7208df5398facbc96c5e8cdae916/spring-cloud-gcp-samples/spring-cloud-gcp-secretmanager-sample) application. + +#### Cloud Trace +Annotation `org.springframework.cloud.sleuth.annotation.NewSpan` is deprecated in favor of `io.micrometer.observation.annotation.Observed` since Spring Boot 3.0 builds on Micrometer 1.0 rather than Spring Cloud Sleuth (which is excluded from the Spring Cloud release train). + +If you use `NewSpan` to generate an additional span, replace the annotation with `Observed`. +The default name of the additional span is `<class-name>#<method-name>`. +If you want to customize the additional span name, specify the `contextualName` parameter. + +Please also remove `spring.sleuth.enabled` from your `application.properties` or `application.yml` file. +Note that `spring.cloud.gcp.trace.enabled=true` is still required if you want to enable Trace. + +This [sample](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/28b8004fa09922d6dcbde19285c1faf7323c6644/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample) is modified to show how to instrument trace and submit it to Cloud Trace. + +#### Cloud Vision +Replaced `ListenableFuture` and `SettableListenableFuture` with `CompletableFuture` as the former two Classes are deprecated in Spring Framework 6.0. + +### Configuration Changelog +#### Removed +The following properties are removed from the codebase thus no longer needed in your application. + +- `spring.cloud.gcp.secretmanager.enabled` + +- `spring.cloud.gcp.secretmanager.legacy` + +See the "SecretManager" section. + +- `spring.sleuth.enabled` + +See the "Trace" section + +### Deprecated Items Removed + +#### Cloud BigQuery +- `BigQueryTemplate(BigQuery bigQuery, String datasetName)` + Use `BigQueryTemplate(BigQuery, BigQueryWriteClient, Map, TaskScheduler)` instead + +- `BigQueryTemplate(BigQuery, String, TaskScheduler)` + Use `BigQueryTemplate(BigQuery, BigQueryWriteClient, Map, TaskScheduler)` instead + +#### Cloud Datastore +- `DatastorePersistentPropertyImpl.getPersistentEntityTypes()` + Use `DatastorePersistentPropertyImpl.getPersistentEntityTypeInformation()` instead + +#### Cloud Pub/Sub +- `DefaultSubscriberFactory(GcpProjectIdProvider)` + Use `DefaultSubscriberFactory(GcpProjectIdProvider, PubSubConfiguration)` instead + +- `PubSubConfiguration.computeSubscriberRetrySettings(String, String)` + Use `PubSubConfiguration.computeSubscriberRetrySettings(ProjectSubscriptionName)` instead + +- `PubSubConfiguration.computeSubscriberFlowControlSettings(String, String)` + Use `PubSubConfiguration.computeSubscriberFlowControlSettings(ProjectSubscriptionName)` instead + +- `PubSubConfiguration.getSubscriber(String, String)` + Use `PubSubConfiguration.getSubscriptionProperties(ProjectSubscriptionName)` instead + +#### Cloud Spanner +- `SpannerPersistentEntityImpl(TypeInformation<T>)` + Use `SpannerPersistentEntityImpl(TypeInformation, SpannerMappingContext, SpannerEntityProcessor)` instead + +- `SpannerCompositeKeyProperty.getPersistentEntityTypes()` + Use `SpannerCompositeKeyProperty.getPersistentEntityTypeInformation()` instead + +#### Cloud Trace +- `TracingSubscriberFactory.createSubscriberStub()` + Use `TracingSubscriberFactory.createSubscriberStub(String)` instead From dcdab0a2d4dfd281d64615e8e06e4f3c32caea0e Mon Sep 17 00:00:00 2001 From: Joe Wang <joewa@google.com> Date: Wed, 18 Jan 2023 20:06:49 -0500 Subject: [PATCH 175/179] add link to migration guides --- .kokoro/publish_javadoc11.sh | 1 + docs/src/main/asciidoc/index.adoc | 2 + .../main/asciidoc/migration-guide-3.x.adoc | 56 +++++-------------- docs/src/main/md/convert-from-ascii.sh | 1 + 4 files changed, 18 insertions(+), 42 deletions(-) diff --git a/.kokoro/publish_javadoc11.sh b/.kokoro/publish_javadoc11.sh index c23187b4bc..4dc47ddd5f 100644 --- a/.kokoro/publish_javadoc11.sh +++ b/.kokoro/publish_javadoc11.sh @@ -79,6 +79,7 @@ sudo pandoc \ docs/src/main/md/kotlin.md \ docs/src/main/md/configuration.md \ docs/src/main/md/migration-guide-1.x.md \ + docs/src/main/md/migration-guide-3.x.md \ -t markdown_github -o docs/src/main/md/documentation.md # copy and replace {project-version} documentation diff --git a/docs/src/main/asciidoc/index.adoc b/docs/src/main/asciidoc/index.adoc index 778b402613..f9e92dc800 100644 --- a/docs/src/main/asciidoc/index.adoc +++ b/docs/src/main/asciidoc/index.adoc @@ -74,3 +74,5 @@ include::kotlin.adoc[] To see the list of all Google Cloud related configuration properties please check link:appendix.html[the Appendix page]. include::migration-guide-1.x.adoc[] + +include::migration-guide-3.x.adoc[] diff --git a/docs/src/main/asciidoc/migration-guide-3.x.adoc b/docs/src/main/asciidoc/migration-guide-3.x.adoc index e1be83d959..99933845f5 100644 --- a/docs/src/main/asciidoc/migration-guide-3.x.adoc +++ b/docs/src/main/asciidoc/migration-guide-3.x.adoc @@ -1,11 +1,11 @@ -== Migration Guide from Spring Cloud GCP v3.x to v4.x +== Migration Guide from Spring Cloud GCP 3.x to 4.x === Before you start ==== Upgrade to the 3.x version This doc assumes you are running with Spring Cloud GCP 3.x. If you are currently running with an earlier major version of Spring Cloud GCP, i.e., 1.x or 2.x, we recommend that you upgrade to link:https://github.com/GoogleCloudPlatform/spring-cloud-gcp/releases/tag/v3.0.0[Spring Cloud GCP 3.x] before migrating to Spring Cloud GCP 4.0. -* link:https://github.com/GoogleCloudPlatform/spring-cloud-gcp/blob/9e880aa2c23ed8a96727921686513e08da60f018/docs/src/main/asciidoc/migration-guide-1.x.adoc[Migration guide from Spring Cloud GCP 1.x to 2.x] +* link:migration-guide-1.x.adoc[Migration guide from Spring Cloud GCP 1.x to 2.x] * link:https://github.com/GoogleCloudPlatform/spring-cloud-gcp/releases/tag/v3.0.0[Spring Cloud GCP 3.0 Release Note] Note that since Spring Cloud GCP 3.0 has few breaking changes, we only provide a release note. @@ -23,7 +23,8 @@ Please ensure that you aren’t calling deprecated methods before upgrading. Spring Cloud GCP 4.0 builds on Spring Boot 3.0. Review the link:https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide[Spring Boot 3.0 migration guide] before continuing. ===== Review Dependencies -Run `mvn dependency:tree` (`gradlew dependencies` for Gradle projects) to see the dependency tree of your project. Ensure Spring-related dependencies have matching versions: +Run `mvn dependency:tree` (`gradlew dependencies` for Gradle projects) to see the dependency tree of your project. +Ensure Spring-related dependencies have matching versions: * Spring Boot 3.0 * Spring Cloud 2022.0 @@ -68,8 +69,6 @@ Do not write secret values in the file. Please also remove `spring.cloud.gcp.secretmanager.enabled` and `spring.cloud.gcp.secretmanager.legacy` in `bootstrap.yml` or `bootstrap.properties` files. -Please find more information in our link:https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/58b9fb9e034c7208df5398facbc96c5e8cdae916/spring-cloud-gcp-samples/spring-cloud-gcp-secretmanager-sample[sample] application. - ==== Cloud Trace Annotation `org.springframework.cloud.sleuth.annotation.NewSpan` is deprecated in favor of `io.micrometer.observation.annotation.Observed` since Spring Boot 3.0 builds on Micrometer 1.0 rather than Spring Cloud Sleuth (which is excluded from the Spring Cloud release train). @@ -80,8 +79,6 @@ If you want to customize the additional span name, specify the `contextualName` Please also remove `spring.sleuth.enabled` from your `application.properties` or `application.yml` file. Note that `spring.cloud.gcp.trace.enabled=true` is still required if you want to enable Trace. -This link:https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/28b8004fa09922d6dcbde19285c1faf7323c6644/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample[sample] is modified to show how to instrument trace and submit it to Cloud Trace. - ==== Cloud Vision Replaced `ListenableFuture` and `SettableListenableFuture` with `CompletableFuture` as the former two Classes are deprecated in Spring Framework 6.0. @@ -102,51 +99,26 @@ See the "Trace" section === Deprecated Items Removed ==== Cloud BigQuery -* `BigQueryTemplate(BigQuery bigQuery, String datasetName)` - -Use `BigQueryTemplate(BigQuery, BigQueryWriteClient, Map, TaskScheduler)` instead - -* `BigQueryTemplate(BigQuery, String, TaskScheduler)` +`BigQueryTemplate(BigQuery bigQuery, String datasetName)`:: Use `BigQueryTemplate(BigQuery, BigQueryWriteClient, Map, TaskScheduler)` instead -Use `BigQueryTemplate(BigQuery, BigQueryWriteClient, Map, TaskScheduler)` instead +`BigQueryTemplate(BigQuery, String, TaskScheduler)`:: Use `BigQueryTemplate(BigQuery, BigQueryWriteClient, Map, TaskScheduler)` instead ==== Cloud Datastore -* `DatastorePersistentPropertyImpl.getPersistentEntityTypes()` - -Use `DatastorePersistentPropertyImpl.getPersistentEntityTypeInformation()` instead +`DatastorePersistentPropertyImpl.getPersistentEntityTypes()`:: Use `DatastorePersistentPropertyImpl.getPersistentEntityTypeInformation()` instead ==== Cloud Pub/Sub -* `DefaultSubscriberFactory(GcpProjectIdProvider)` - -Use `DefaultSubscriberFactory(GcpProjectIdProvider, PubSubConfiguration)` instead - -* `PubSubConfiguration.computeSubscriberRetrySettings(String, String)` - -Use `PubSubConfiguration.computeSubscriberRetrySettings(ProjectSubscriptionName)` instead +`DefaultSubscriberFactory(GcpProjectIdProvider)`:: Use `DefaultSubscriberFactory(GcpProjectIdProvider, PubSubConfiguration)` instead -* `PubSubConfiguration.computeSubscriberFlowControlSettings(String, String)` +`PubSubConfiguration.computeSubscriberRetrySettings(String, String)`:: Use `PubSubConfiguration.computeSubscriberRetrySettings(ProjectSubscriptionName)` instead -Use `PubSubConfiguration.computeSubscriberFlowControlSettings(ProjectSubscriptionName)` instead +`PubSubConfiguration.computeSubscriberFlowControlSettings(String, String)`:: Use `PubSubConfiguration.computeSubscriberFlowControlSettings(ProjectSubscriptionName)` instead -* `PubSubConfiguration.getSubscriber(String, String)` - -Use `PubSubConfiguration.getSubscriptionProperties(ProjectSubscriptionName)` instead - -==== Secret Manager -`GcpSecretManagerBootstrapConfiguration` - -For how to fetch secrets from Secret Manager, refer to the Secret Manager section. +`PubSubConfiguration.getSubscriber(String, String)`:: Use `PubSubConfiguration.getSubscriptionProperties(ProjectSubscriptionName)` instead ==== Cloud Spanner -* `SpannerPersistentEntityImpl(TypeInformation<T>)` +`SpannerPersistentEntityImpl(TypeInformation<T>)`:: Use `SpannerPersistentEntityImpl(TypeInformation, SpannerMappingContext, SpannerEntityProcessor)` instead -Use `SpannerPersistentEntityImpl(TypeInformation, SpannerMappingContext, SpannerEntityProcessor)` instead - -* `SpannerCompositeKeyProperty.getPersistentEntityTypes()` - -Use `SpannerCompositeKeyProperty.getPersistentEntityTypeInformation()` instead +`SpannerCompositeKeyProperty.getPersistentEntityTypes()`:: Use `SpannerCompositeKeyProperty.getPersistentEntityTypeInformation()` instead ==== Cloud Trace -* `TracingSubscriberFactory.createSubscriberStub()` - -Use `TracingSubscriberFactory.createSubscriberStub(String)` instead +`TracingSubscriberFactory.createSubscriberStub()`:: Use `TracingSubscriberFactory.createSubscriberStub(String)` instead diff --git a/docs/src/main/md/convert-from-ascii.sh b/docs/src/main/md/convert-from-ascii.sh index 62041c1c35..91c23ce82b 100755 --- a/docs/src/main/md/convert-from-ascii.sh +++ b/docs/src/main/md/convert-from-ascii.sh @@ -39,6 +39,7 @@ convertascii kotlin convertascii configuration convertascii migration-guide-1.x + convertascii migration-guide-3.x convertascii appendix convertascii first-page From 5931470ca8ff4043f33703c511a8fc7f368481a8 Mon Sep 17 00:00:00 2001 From: Joe Wang <joewa@google.com> Date: Wed, 18 Jan 2023 20:18:06 -0500 Subject: [PATCH 176/179] remove cross references --- docs/src/main/md/migration-guide-3.x.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/src/main/md/migration-guide-3.x.md b/docs/src/main/md/migration-guide-3.x.md index 2ae3e634c6..884f8fe917 100644 --- a/docs/src/main/md/migration-guide-3.x.md +++ b/docs/src/main/md/migration-guide-3.x.md @@ -7,7 +7,7 @@ This doc assumes you are running with Spring Cloud GCP 3.x. If you are currently running with an earlier major version of Spring Cloud GCP, i.e., 1.x or 2.x, we recommend that you upgrade to [Spring Cloud GCP 3.x](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/releases/tag/v3.0.0) before migrating to Spring Cloud GCP 4.0. -- [Migration guide from Spring Cloud GCP 1.x to 2.x](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/blob/main/docs/src/main/asciidoc/migration-guide-1.x.adoc) +- [Migration guide from Spring Cloud GCP 1.x to 2.x](./migration-guide-1.x.md) - [Spring Cloud GCP 3.0 Release Note](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/releases/tag/v3.0.0) Note that since Spring Cloud GCP 3.0 has few breaking changes, we only provide a release note. @@ -70,8 +70,6 @@ Do not write secret values in the file. Please also remove `spring.cloud.gcp.secretmanager.enabled` and `spring.cloud.gcp.secretmanager.legacy` in `bootstrap.yml` or `bootstrap.properties` files. -Please find more information in our [sample](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/58b9fb9e034c7208df5398facbc96c5e8cdae916/spring-cloud-gcp-samples/spring-cloud-gcp-secretmanager-sample) application. - #### Cloud Trace Annotation `org.springframework.cloud.sleuth.annotation.NewSpan` is deprecated in favor of `io.micrometer.observation.annotation.Observed` since Spring Boot 3.0 builds on Micrometer 1.0 rather than Spring Cloud Sleuth (which is excluded from the Spring Cloud release train). @@ -82,8 +80,6 @@ If you want to customize the additional span name, specify the `contextualName` Please also remove `spring.sleuth.enabled` from your `application.properties` or `application.yml` file. Note that `spring.cloud.gcp.trace.enabled=true` is still required if you want to enable Trace. -This [sample](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/28b8004fa09922d6dcbde19285c1faf7323c6644/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample) is modified to show how to instrument trace and submit it to Cloud Trace. - #### Cloud Vision Replaced `ListenableFuture` and `SettableListenableFuture` with `CompletableFuture` as the former two Classes are deprecated in Spring Framework 6.0. From 92e5ca5bab3c96a4ead6654f74fc0a50d3a4740b Mon Sep 17 00:00:00 2001 From: Joe Wang <joewa@google.com> Date: Thu, 19 Jan 2023 11:20:11 -0500 Subject: [PATCH 177/179] specify min java version --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c558923ecd..3e32146500 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ This release officially introduces Spring Boot 3.x compatibility. Note that brea All changes within one large [Pull Request](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/pull/1287) as we think split PRs may bring compatibility issues. For the rational of each change, please refer to the description of the PR. ### Important version upgrades -* Java 17 +* Minimum Java version: Java 17 * Spring Framework libraries upgrade - [Spring Boot 3.0](https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide) - [Spring Framework 6.0](https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-6.x) From 3c819f2e21734bce8e53b35b1a03d434fc733297 Mon Sep 17 00:00:00 2001 From: Joe Wang <joewa@google.com> Date: Thu, 19 Jan 2023 11:20:42 -0500 Subject: [PATCH 178/179] restructure sections --- .../main/asciidoc/migration-guide-3.x.adoc | 20 +++++++++---------- docs/src/main/md/migration-guide-3.x.md | 20 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/src/main/asciidoc/migration-guide-3.x.adoc b/docs/src/main/asciidoc/migration-guide-3.x.adoc index 99933845f5..5a1e889f57 100644 --- a/docs/src/main/asciidoc/migration-guide-3.x.adoc +++ b/docs/src/main/asciidoc/migration-guide-3.x.adoc @@ -22,16 +22,6 @@ Please ensure that you aren’t calling deprecated methods before upgrading. ==== Spring Boot 3.0 Spring Cloud GCP 4.0 builds on Spring Boot 3.0. Review the link:https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide[Spring Boot 3.0 migration guide] before continuing. -===== Review Dependencies -Run `mvn dependency:tree` (`gradlew dependencies` for Gradle projects) to see the dependency tree of your project. -Ensure Spring-related dependencies have matching versions: - -* Spring Boot 3.0 -* Spring Cloud 2022.0 -** For detailed dependency versions, see "2022.0 (Kilburn)" column in link:https://github.com/spring-cloud/spring-cloud-release/wiki/Supported-Versions#supported-releases[Spring Cloud: Supported Versions] table. -* Spring Data 2022.0 -** For detailed dependency versions, see link:https://github.com/spring-projects/spring-data-commons/wiki/Spring-Data-2022.0-%28Turing%29-Release-Notes[Spring Data 2022.0 Release Note]. - ==== Update Bill of Materials (BOM) If you’re a Maven user, add our BOM to your pom.xml `<dependencyManagement>` section. This will allow you to not specify versions for any of the Maven dependencies and instead delegate versioning to the BOM. @@ -51,6 +41,16 @@ This will allow you to not specify versions for any of the Maven dependencies an </dependencyManagement> ---- +===== Review Dependencies +Run `mvn dependency:tree` (`gradlew dependencies` for Gradle projects) to see the dependency tree of your project. +Ensure Spring-related dependencies have matching versions: + +* Spring Boot 3.0 +* Spring Cloud 2022.0 +** For detailed dependency versions, see "2022.0 (Kilburn)" column in link:https://github.com/spring-cloud/spring-cloud-release/wiki/Supported-Versions#supported-releases[Spring Cloud: Supported Versions] table. +* Spring Data 2022.0 +** For detailed dependency versions, see link:https://github.com/spring-projects/spring-data-commons/wiki/Spring-Data-2022.0-%28Turing%29-Release-Notes[Spring Data 2022.0 Release Note]. + ==== Cloud BigQuery Replaced `ListenableFuture` and `SettableListenableFuture` with `CompletableFuture` as the former two Classes are deprecated in Spring Framework 6.0. diff --git a/docs/src/main/md/migration-guide-3.x.md b/docs/src/main/md/migration-guide-3.x.md index 884f8fe917..f66f1a1035 100644 --- a/docs/src/main/md/migration-guide-3.x.md +++ b/docs/src/main/md/migration-guide-3.x.md @@ -24,16 +24,6 @@ Please ensure that you aren’t calling deprecated methods before upgrading. #### Spring Boot 3.0 Spring Cloud GCP 4.0 builds on Spring Boot 3.0. Review the [Spring Boot 3.0 migration guide](https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide) before continuing. -##### Review Dependencies -Run `mvn dependency:tree` (`gradlew dependencies` for Gradle projects) to see the dependency tree of your project. -Ensure Spring-related dependencies have matching versions: - -- Spring Boot 3.0 -- Spring Cloud 2022.0 - - For detailed dependency versions, see "2022.0 (Kilburn)" column in [Spring Cloud: Supported Versions](https://github.com/spring-cloud/spring-cloud-release/wiki/Supported-Versions#supported-releases) table. -- Spring Data 2022.0 - - For detailed dependency versions, see [Spring Data 2022.0 Release Note](https://github.com/spring-projects/spring-data-commons/wiki/Spring-Data-2022.0-%28Turing%29-Release-Notes). - #### Update Bill of Materials (BOM) If you’re a Maven user, add our BOM to your pom.xml `<dependencyManagement>` section. This will allow you to not specify versions for any of the Maven dependencies and instead delegate versioning to the BOM. @@ -52,6 +42,16 @@ This will allow you to not specify versions for any of the Maven dependencies an </dependencyManagement> ``` +##### Review Dependencies +Run `mvn dependency:tree` (`gradlew dependencies` for Gradle projects) to see the dependency tree of your project. +Ensure Spring-related dependencies have matching versions: + +- Spring Boot 3.0 +- Spring Cloud 2022.0 + - For detailed dependency versions, see "2022.0 (Kilburn)" column in [Spring Cloud: Supported Versions](https://github.com/spring-cloud/spring-cloud-release/wiki/Supported-Versions#supported-releases) table. +- Spring Data 2022.0 + - For detailed dependency versions, see [Spring Data 2022.0 Release Note](https://github.com/spring-projects/spring-data-commons/wiki/Spring-Data-2022.0-%28Turing%29-Release-Notes). + #### Cloud BigQuery Replaced `ListenableFuture` and `SettableListenableFuture` with `CompletableFuture` as the former two Classes are deprecated in Spring Framework 6.0. From 551b27b1b077b3575c7fee5a18d04f253a014f67 Mon Sep 17 00:00:00 2001 From: Joe Wang <joewa@google.com> Date: Thu, 19 Jan 2023 11:39:32 -0500 Subject: [PATCH 179/179] restore maven-resources-plugin version --- docs/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pom.xml b/docs/pom.xml index ad1333e39f..ff3a30a742 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -23,7 +23,7 @@ <upload-docs-zip.phase>none</upload-docs-zip.phase> <!--maven-resources-plugin:3.2.0:copy-resources fails: https://issues.apache.org/jira/browse/MSHARED-966--> - <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version> + <maven-resources-plugin.version>3.1.0</maven-resources-plugin.version> </properties> <repositories>