forked from TNG/JGiven
-
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.
Nested steps not reported with jgiven spring
[TNG#259]
- Loading branch information
1 parent
59983ff
commit 8b827e4
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
...ot/src/test/java/com/tngtech/jgiven/example/springboot/HelloControllerNestedStepTest.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,36 @@ | ||
package com.tngtech.jgiven.example.springboot; | ||
|
||
import com.tngtech.jgiven.annotation.As; | ||
import com.tngtech.jgiven.annotation.JGivenConfiguration; | ||
import com.tngtech.jgiven.integration.spring.SimpleSpringScenarioTest; | ||
import org.junit.After; | ||
import org.junit.AfterClass; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.springframework.boot.test.OutputCapture; | ||
import org.springframework.boot.test.SpringApplicationConfiguration; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.mock.web.MockServletContext; | ||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||
import org.springframework.test.context.web.WebAppConfiguration; | ||
|
||
import static org.hamcrest.CoreMatchers.containsString; | ||
import static org.hamcrest.MatcherAssert.assertThat; | ||
|
||
@RunWith( SpringJUnit4ClassRunner.class ) | ||
@SpringApplicationConfiguration( classes = { MockServletContext.class, HelloTestContext.class } ) | ||
@WebAppConfiguration | ||
@JGivenConfiguration( HelloJGivenConfiguration.class ) | ||
public class HelloControllerNestedStepTest extends SimpleSpringScenarioTest<HelloStage> { | ||
|
||
@Rule | ||
public OutputCapture capture = new OutputCapture(); | ||
|
||
@Test | ||
public void nested_test() throws Exception { | ||
when().get( "/" ); | ||
then().I_should_get_home_page(); | ||
} | ||
|
||
} |
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
8b827e4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this specific example, nested steps are not reported in the output logs.
Actual test output logs contain
But expected test output log should contain