Skip to content

Commit

Permalink
Remove inheritance in QuickstarsUsingDefaultsIT to isolate test logic…
Browse files Browse the repository at this point in the history
… and prevent shared resources conflicts on ocp

(cherry picked from commit eb127f0)
  • Loading branch information
jcarranzan authored and fedinskiy committed Oct 8, 2024
1 parent a60f2d1 commit d0591ac
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package io.quarkus.qe;

import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;

import io.quarkus.test.bootstrap.RestService;
import io.quarkus.test.scenarios.QuarkusScenario;
import io.quarkus.test.services.GitRepositoryQuarkusApplication;

@DisabledOnOs(value = OS.WINDOWS, disabledReason = "Windows does not support long file paths")
@QuarkusScenario
public class BareMetalQuickstartUsingDefaultsIT extends QuickstartUsingDefaultsIT {

@GitRepositoryQuarkusApplication(repo = "https://github.com/quarkusio/quarkus-quickstarts.git", contextDir = "getting-started")
static final RestService app = new RestService();

@Override
protected RestService getApp() {
return app;
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
package io.quarkus.qe;

import io.quarkus.test.bootstrap.RestService;
import io.quarkus.test.scenarios.OpenShiftDeploymentStrategy;
import io.quarkus.test.scenarios.OpenShiftScenario;
import io.quarkus.test.services.GitRepositoryQuarkusApplication;

@OpenShiftScenario(deployment = OpenShiftDeploymentStrategy.UsingContainerRegistry)
public class OpenShiftContainerRegistryQuickstartUsingDefaultsIT extends QuickstartUsingDefaultsIT {
@GitRepositoryQuarkusApplication(repo = "https://github.com/quarkusio/quarkus-quickstarts.git", contextDir = "getting-started")
static final RestService app = new RestService();

@Override
protected RestService getApp() {
return app;
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
package io.quarkus.qe;

import io.quarkus.test.bootstrap.RestService;
import io.quarkus.test.scenarios.OpenShiftScenario;
import io.quarkus.test.services.GitRepositoryQuarkusApplication;

@OpenShiftScenario
public class OpenShiftS2iQuickstartUsingDefaultsIT extends QuickstartUsingDefaultsIT {

@GitRepositoryQuarkusApplication(repo = "https://github.com/quarkusio/quarkus-quickstarts.git", contextDir = "getting-started")
static final RestService app = new RestService();

@Override
protected RestService getApp() {
return app;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,16 @@

import org.apache.http.HttpStatus;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;

import io.quarkus.test.bootstrap.RestService;
import io.quarkus.test.scenarios.QuarkusScenario;
import io.quarkus.test.services.GitRepositoryQuarkusApplication;

@QuarkusScenario
@DisabledOnOs(value = OS.WINDOWS, disabledReason = "Windows does not support long file paths")
public class QuickstartUsingDefaultsIT {
public abstract class QuickstartUsingDefaultsIT {

@GitRepositoryQuarkusApplication(repo = "https://github.com/quarkusio/quarkus-quickstarts.git", contextDir = "getting-started")
static final RestService app = new RestService();
protected abstract RestService getApp();

@Test
public void test() {
app.given()
getApp().given()
.get("/hello")
.then()
.statusCode(HttpStatus.SC_OK);
Expand Down

0 comments on commit d0591ac

Please sign in to comment.