Skip to content

Commit

Permalink
fix(tests): Use JUnit vintage engine so Spock tests still run (#2766)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkschneider authored Mar 18, 2019
1 parent 9effbd7 commit ce443d8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
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

0 comments on commit ce443d8

Please sign in to comment.