https://github.com/innoq/junit5-logging-extension
JUnit 5 extension for testing log statements
https://github.com/innoq/junit5-logging-extension
java junit junit-extension junit-jupiter junit-jupiter-extension junit5 logback logging slf4j
Last synced: 3 months ago
JSON representation
JUnit 5 extension for testing log statements
- Host: GitHub
- URL: https://github.com/innoq/junit5-logging-extension
- Owner: innoq
- License: apache-2.0
- Created: 2022-09-10T14:39:03.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-31T19:41:06.000Z (3 months ago)
- Last Synced: 2025-03-31T20:34:37.928Z (3 months ago)
- Topics: java, junit, junit-extension, junit-jupiter, junit-jupiter-extension, junit5, logback, logging, slf4j
- Language: Java
- Homepage:
- Size: 201 KB
- Stars: 5
- Watchers: 8
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# JUnit 5 logging extension
*- Sometimes logging is important*[](https://maven-badges.herokuapp.com/maven-central/com.innoq/junit5-logging-extension)
[](https://www.apache.org/licenses/LICENSE-2.0)
[](https://github.com/innoq/junit5-logging-extension/issues)
[](https://github.com/innoq/junit5-logging-extension/actions/workflows/main.yml)[JUnit 5](https://junit.org/junit5/) extension for testing log statements.
## Quick Start
Add junit5-logging-extension as dependency within test scope to your project.
### Apache Maven
```xml
com.innoq
junit5-logging-extension
0.2.0
test```
### Gradle Groovy DSL
```
testImplementation 'com.innoq:junit5-logging-extension:0.2.0'
```### Gradle Kotlin DSL
```
testImplementation("com.innoq:junit5-logging-extension:0.2.0")
```Use the extension within your JUnit 5 tests:
### Usage
```java
@Logging
class SomeTest {Logger LOG = LoggerFactory.getLogger(SomeTest.class);
@Test
void someTest(LoggingEvents events) {
LOG.info("Some log message");assertThat(events.isEmpty()).isFalse();
}
}
```## Code of Conduct
[Contributor Code of Conduct](./CODE_OF_CONDUCT.md). By participating in this
project you agree to abide by its terms.## License
junit5-logging-extension is Open Source software released under the
[Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0.html).