forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly resolve
@TestProfile
when using nested tests in base classes
Fix quarkusio#35104
- Loading branch information
Showing
4 changed files
with
86 additions
and
1 deletion.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
integration-tests/main/src/test/java/io/quarkus/it/main/CommonNestedTest.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,27 @@ | ||
package io.quarkus.it.main; | ||
|
||
import static org.hamcrest.Matchers.is; | ||
|
||
import org.junit.jupiter.api.Nested; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import io.restassured.RestAssured; | ||
|
||
public abstract class CommonNestedTest { | ||
|
||
public String defaultProfile() { | ||
return "Hello"; | ||
} | ||
|
||
@Nested | ||
class NestedTests { | ||
@Test | ||
public void testProfileFromNested() { | ||
RestAssured.when() | ||
.get("/greeting/Stu") | ||
.then() | ||
.statusCode(200) | ||
.body(is(defaultProfile() + " Stu")); | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...ion-tests/main/src/test/java/io/quarkus/it/main/QuarkusTestNested1WithCommonCaseTest.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,14 @@ | ||
package io.quarkus.it.main; | ||
|
||
import io.quarkus.test.junit.QuarkusTest; | ||
import io.quarkus.test.junit.TestProfile; | ||
|
||
@QuarkusTest | ||
@TestProfile(QuarkusTestNestedWithTestProfileTestCase.OuterProfile.class) | ||
public class QuarkusTestNested1WithCommonCaseTest extends CommonNestedTest { | ||
|
||
@Override | ||
public String defaultProfile() { | ||
return "OuterProfile"; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...ion-tests/main/src/test/java/io/quarkus/it/main/QuarkusTestNested2WithCommonCaseTest.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,7 @@ | ||
package io.quarkus.it.main; | ||
|
||
import io.quarkus.test.junit.QuarkusTest; | ||
|
||
@QuarkusTest | ||
public class QuarkusTestNested2WithCommonCaseTest extends CommonNestedTest { | ||
} |
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