Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: 2 months ago
JSON representation

JUnit 5 extension for testing log statements

Awesome Lists containing this project

README

        

# JUnit 5 logging extension
*- Sometimes logging is important*

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.innoq/junit5-logging-extension/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.innoq/junit5-logging-extension)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
[![Open Issues](https://img.shields.io/github/issues/innoq/junit5-logging-extension.svg)](https://github.com/innoq/junit5-logging-extension/issues)
[![Build Status](https://github.com/innoq/junit5-logging-extension/actions/workflows/main.yml/badge.svg)](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).