https://github.com/be-hase/output-capture
[Java] Output capture for testing.
https://github.com/be-hase/output-capture
Last synced: 3 months ago
JSON representation
[Java] Output capture for testing.
- Host: GitHub
- URL: https://github.com/be-hase/output-capture
- Owner: be-hase
- License: apache-2.0
- Created: 2016-06-11T15:51:48.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-06-11T17:35:10.000Z (almost 9 years ago)
- Last Synced: 2025-01-18T08:18:04.190Z (5 months ago)
- Language: Java
- Size: 59.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://circleci.com/gh/be-hase/output-capture)
[](https://maven-badges.herokuapp.com/maven-central/com.be-hase.output-capture/output-capture)# output-capture
[Java] Output capture for testing.
Inspired by OutputCapture of Spring Boot.## How to use ?
```java
@Rule
public OutputCapture capture = new OutputCapture();@Test
public void useToString() throws Exception {
System.out.println("Hello World!");
assertThat(capture.toString(), containsString("World"));
}@Test
public void useExpect() throws Exception {
System.out.println("Hello World!");
capture.expect(containsString("World"));
}```