-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
(cherry picked from commit dc54e38) Co-authored-by: Jason <[email protected]>
- Loading branch information
1 parent
760c996
commit 7363ab0
Showing
3 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
...m/netflix/spinnaker/clouddriver/appengine/config/AppEngineAccountCredentialsRepoTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package com.netflix.spinnaker.clouddriver.appengine.config; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.mockito.Mockito.mock; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.netflix.spectator.api.Registry; | ||
import com.netflix.spinnaker.clouddriver.appengine.AppengineJobExecutor; | ||
import com.netflix.spinnaker.clouddriver.jobs.JobExecutor; | ||
import com.netflix.spinnaker.clouddriver.names.NamerRegistry; | ||
import com.netflix.spinnaker.credentials.CredentialsLifecycleHandler; | ||
import com.netflix.spinnaker.credentials.CredentialsRepository; | ||
import com.netflix.spinnaker.kork.configserver.ConfigFileService; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.boot.context.annotation.UserConfigurations; | ||
import org.springframework.boot.test.context.TestConfiguration; | ||
import org.springframework.boot.test.context.runner.ApplicationContextRunner; | ||
import org.springframework.context.annotation.Bean; | ||
|
||
public class AppEngineAccountCredentialsRepoTest { | ||
|
||
private final ApplicationContextRunner runner = | ||
new ApplicationContextRunner() | ||
.withConfiguration( | ||
UserConfigurations.of( | ||
AppengineCredentialsConfiguration.class, TestConfiguration.class)); | ||
|
||
@Test | ||
void testCredentialsRepositoryBeanIsPresent() { | ||
runner.run(ctx -> assertThat(ctx).hasSingleBean(CredentialsRepository.class)); | ||
} | ||
|
||
static class TestConfiguration { | ||
@Bean | ||
ObjectMapper getObjectMapper() { | ||
return new ObjectMapper(); | ||
} | ||
|
||
@Bean | ||
CredentialsLifecycleHandler getCredentialsLifecycleHandler() { | ||
return mock(CredentialsLifecycleHandler.class); | ||
} | ||
|
||
@Bean | ||
NamerRegistry getNamerRegistry() { | ||
return mock(NamerRegistry.class); | ||
} | ||
|
||
@Bean | ||
AppengineConfigurationProperties getAppengineConfigurationProperties() { | ||
return mock(AppengineConfigurationProperties.class); | ||
} | ||
|
||
@Bean | ||
ConfigFileService getConfigFileService() { | ||
return mock(ConfigFileService.class); | ||
} | ||
|
||
@Bean | ||
AppengineJobExecutor getAppengineExecutor() { | ||
return mock(AppengineJobExecutor.class); | ||
} | ||
|
||
@Bean | ||
JobExecutor getJobExecutor() { | ||
return mock(JobExecutor.class); | ||
} | ||
|
||
@Bean | ||
Registry getRegistry() { | ||
return mock(Registry.class); | ||
} | ||
|
||
@Bean | ||
String getClouddriverUserAgentApplicationName() { | ||
return "clouddriverUserAgentApplicationName"; | ||
} | ||
} | ||
} |