-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from fcamblor/specs-based-test-refacto
Some minor improvements in the way spec tests were written
- Loading branch information
Showing
3 changed files
with
60 additions
and
41 deletions.
There are no files selected for viewing
26 changes: 15 additions & 11 deletions
26
restx-core-shell/src/main/resources/restx/core/shell/HelloResourceSpecTest.java.mustache
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 |
---|---|---|
@@ -1,18 +1,22 @@ | ||
package {{mainPackage}}.rest; | ||
|
||
import {{mainPackage}}.AppServer; | ||
import org.junit.ClassRule; | ||
import org.junit.Test; | ||
import restx.tests.RestxSpecRule; | ||
import restx.tests.RestxSpecTestsRunner; | ||
import restx.tests.FindSpecsIn; | ||
|
||
@RunWith(RestxSpecTestsRunner.class) | ||
@FindSpecsIn("specs/hello") | ||
public class HelloResourceSpecTest { | ||
@ClassRule | ||
public static RestxSpecRule rule = new RestxSpecRule( | ||
AppServer.WEB_INF_LOCATION, | ||
AppServer.WEB_APP_LOCATION); | ||
@Test | ||
public void should_say_hello() throws Exception { | ||
rule.runTest("specs/hello/should_say_hello.spec.yaml"); | ||
} | ||
/** | ||
* Useless, thanks to both @RunWith(RestxSpecTestsRunner.class) & @FindSpecsIn() | ||
* | ||
* @Rule | ||
* public RestxSpecRule rule = new RestxSpecRule(); | ||
* | ||
* @Test | ||
* public void test_spec() throws Exception { | ||
* rule.runTest(specTestPath); | ||
* } | ||
*/ | ||
} |
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