@Test public void googleCredentialsTest () throws Exception { ServiceAccountCredentials googleCredentials = (ServiceAccountCredentials) gcpComputeService.googleCredentials(); assertFalse(googleCredentials.createScopedRequired()); assertThat(googleCredentials.getScopes(), containsInAnyOrder(ComputeScopes.CLOUD_PLATFORM)); }
@Bean(COMPUTE_CREDENTIALS) @RefreshScope @JsonIgnore public GoogleCredentials googleCredentials () throws IOException { return ServiceAccountCredentials.fromStream(new ByteArrayInputStream(jsonKey.getBytes())) .createScoped(ComputeScopes.CLOUD_PLATFORM); }
GcpComputeService implements CloudService { @Bean(COMPUTE_CREDENTIALS) @RefreshScope @JsonIgnore public GoogleCredentials googleCredentials () throws IOException { return ServiceAccountCredentials.fromStream(new ByteArrayInputStream(jsonKey.getBytes())) .createScoped(ComputeScopes.CLOUD_PLATFORM); } }
GcpComputeService implements CloudService { @Bean(COMPUTE_CREDENTIALS) @RefreshScope @JsonIgnore public GoogleCredentials googleCredentials () throws IOException { return ServiceAccountCredentials.fromStream(new ByteArrayInputStream(jsonKey.getBytes())) .createScoped(ComputeScopes.CLOUD_PLATFORM); }  }
GcpComputeService implements CloudService { @Bean(COMPUTE_CREDENTIALS) @RefreshScope @JsonIgnore public GoogleCredentials googleCredentials () throws IOException { return ServiceAccountCredentials.fromStream(new ByteArrayInputStream(jsonKey.getBytes())) .createScoped(ComputeScopes.CLOUD_PLATFORM); }  void setJsonKey(String jsonKey); @Bean(COMPUTE_CREDENTIALS) @RefreshScope @JsonIgnore GoogleCredentials googleCredentials(); @Bean @RefreshScope @JsonIgnore @ConditionalOnBean(value = GoogleCredentials.class, name = COMPUTE_CREDENTIALS) CredentialsProvider computeCredentialsProvider(
            @Qualifier(COMPUTE_CREDENTIALS) GoogleCredentials credentials); @Bean @RefreshScope @JsonIgnore @ConditionalOnMissingBean(value = GoogleCredentials.class, name = COMPUTE_CREDENTIALS) CredentialsProvider genericCredentialsProvider(GoogleCredentials credentials); }
GcpComputeService implements CloudService { @Bean(COMPUTE_CREDENTIALS) @RefreshScope @JsonIgnore public GoogleCredentials googleCredentials () throws IOException { return ServiceAccountCredentials.fromStream(new ByteArrayInputStream(jsonKey.getBytes())) .createScoped(ComputeScopes.CLOUD_PLATFORM); }  void setJsonKey(String jsonKey); @Bean(COMPUTE_CREDENTIALS) @RefreshScope @JsonIgnore GoogleCredentials googleCredentials(); @Bean @RefreshScope @JsonIgnore @ConditionalOnBean(value = GoogleCredentials.class, name = COMPUTE_CREDENTIALS) CredentialsProvider computeCredentialsProvider(
            @Qualifier(COMPUTE_CREDENTIALS) GoogleCredentials credentials); @Bean @RefreshScope @JsonIgnore @ConditionalOnMissingBean(value = GoogleCredentials.class, name = COMPUTE_CREDENTIALS) CredentialsProvider genericCredentialsProvider(GoogleCredentials credentials); static final String COMPUTE_CREDENTIALS; }