use of org.springframework.cloud.gcp.core.DefaultGcpProjectIdProvider in project spring-cloud-gcp by spring-cloud.
the class StackdriverJsonLayout method start.
@Override
public void start() {
super.start();
// If no Project ID set, then attempt to resolve it with the default project ID provider
if (StringUtils.isEmpty(this.projectId) || this.projectId.endsWith("_IS_UNDEFINED")) {
GcpProjectIdProvider projectIdProvider = new DefaultGcpProjectIdProvider();
this.projectId = projectIdProvider.getProjectId();
}
}
use of org.springframework.cloud.gcp.core.DefaultGcpProjectIdProvider in project spring-cloud-gcp by spring-cloud.
the class PubSubChannelAdaptersIntegrationTests method enableTests.
@BeforeClass
public static void enableTests() throws IOException {
assumeThat(System.getProperty("it.pubsub")).isEqualTo("true");
pubSubAdmin = new PubSubAdmin(new DefaultGcpProjectIdProvider(), new DefaultCredentialsProvider(() -> new Credentials()));
}
Aggregations