Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tests): Use JUnit vintage engine so Spock tests still run #2766

Merged
merged 3 commits into from
Mar 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion orca-clouddriver/orca-clouddriver.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
apply from: "$rootDir/gradle/groovy.gradle"

test {
useJUnitPlatform()
useJUnitPlatform {
includeEngines "junit-vintage", "junit-jupiter"
}
}

dependencies {
Expand All @@ -39,4 +41,5 @@ dependencies {
testCompile "org.mockito:mockito-core:2.25.0"

testRuntime spinnaker.dependency("junitJupiterEngine")
testRuntime "org.junit.vintage:junit-vintage-engine:${spinnaker.version('jupiter')}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@

import static java.lang.String.format;

class PollerSupport {
public class PollerSupport {
private final ObjectMapper objectMapper;
private final RetrySupport retrySupport;
private final OortService oortService;

PollerSupport(ObjectMapper objectMapper, RetrySupport retrySupport, OortService oortService) {
public PollerSupport(ObjectMapper objectMapper, RetrySupport retrySupport, OortService oortService) {
this.objectMapper = objectMapper;
this.retrySupport = retrySupport;
this.oortService = oortService;
}

Optional<ServerGroup> fetchServerGroup(String account, String region, String name) {
public Optional<ServerGroup> fetchServerGroup(String account, String region, String name) {
return retrySupport.retry(() -> {
try {
Response response = oortService.getServerGroup(account, region, name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
@Slf4j
@Component
@ConditionalOnExpression(value = "${pollers.restorePinnedServerGroups.enabled:false}")
class RestorePinnedServerGroupsPoller extends AbstractPollingNotificationAgent {
public class RestorePinnedServerGroupsPoller extends AbstractPollingNotificationAgent {
private static final Logger log = LoggerFactory.getLogger(RestorePinnedServerGroupsPoller.class);

private final ObjectMapper objectMapper;
Expand Down Expand Up @@ -89,7 +89,7 @@ public RestorePinnedServerGroupsPoller(NotificationClusterLock notificationClust
}

@VisibleForTesting
RestorePinnedServerGroupsPoller(NotificationClusterLock notificationClusterLock,
public RestorePinnedServerGroupsPoller(NotificationClusterLock notificationClusterLock,
ObjectMapper objectMapper,
OortService oortService,
RetrySupport retrySupport,
Expand Down Expand Up @@ -184,7 +184,7 @@ protected void tick() {
}
}

List<PinnedServerGroupTag> fetchPinnedServerGroupTags() {
public List<PinnedServerGroupTag> fetchPinnedServerGroupTags() {
List<EntityTags> allEntityTags = retrySupport.retry(() -> objectMapper.convertValue(
oortService.getEntityTags(ImmutableMap.<String, String>builder()
.put("tag:" + PINNED_CAPACITY_TAG, "*")
Expand All @@ -211,7 +211,7 @@ List<PinnedServerGroupTag> fetchPinnedServerGroupTags() {
.collect(Collectors.toList());
}

boolean hasCompletedExecution(PinnedServerGroupTag pinnedServerGroupTag) {
public boolean hasCompletedExecution(PinnedServerGroupTag pinnedServerGroupTag) {
try {
Execution execution = executionRepository.retrieve(
pinnedServerGroupTag.executionType, pinnedServerGroupTag.executionId
Expand Down Expand Up @@ -276,7 +276,7 @@ private Map<String, Object> buildResizeOperation(PinnedServerGroupTag pinnedServ
.build();
}

private static class PinnedServerGroupTag {
public static class PinnedServerGroupTag {
public String id;

public String cloudProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Map<String, Object> getPreviousServerGroupFromCluster(String application,
}, 10, 3000, false); // retry for up to 30 seconds
}

Map<String, Object> getPreviousServerGroupFromClusterByTarget(String application,
public Map<String, Object> getPreviousServerGroupFromClusterByTarget(String application,
String account,
String cluster,
String cloudProvider,
Expand Down