SLF4J JUnit

Library to make testing of logging behaviour easier when using SLF4J and JUnit

Лицензия

Лицензия

Категории

Категории

JUnit Тестирование компонентов SLF4J Библиотеки уровня приложения Logging
Группа

Группа

uk.co.webamoeba.slf4j
Идентификатор

Идентификатор

slf4j-junit
Последняя версия

Последняя версия

1.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

SLF4J JUnit
Library to make testing of logging behaviour easier when using SLF4J and JUnit
Ссылка на сайт

Ссылка на сайт

https://github.com/jameskennard/slf4j-junit
Система контроля версий

Система контроля версий

http://github.com/jameskennard/slf4j-junit

Скачать slf4j-junit

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/uk.co.webamoeba.slf4j/slf4j-junit/ -->
<dependency>
    <groupId>uk.co.webamoeba.slf4j</groupId>
    <artifactId>slf4j-junit</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/uk.co.webamoeba.slf4j/slf4j-junit/
implementation 'uk.co.webamoeba.slf4j:slf4j-junit:1.0.0'
// https://jarcasting.com/artifacts/uk.co.webamoeba.slf4j/slf4j-junit/
implementation ("uk.co.webamoeba.slf4j:slf4j-junit:1.0.0")
'uk.co.webamoeba.slf4j:slf4j-junit:jar:1.0.0'
<dependency org="uk.co.webamoeba.slf4j" name="slf4j-junit" rev="1.0.0">
  <artifact name="slf4j-junit" type="jar" />
</dependency>
@Grapes(
@Grab(group='uk.co.webamoeba.slf4j', module='slf4j-junit', version='1.0.0')
)
libraryDependencies += "uk.co.webamoeba.slf4j" % "slf4j-junit" % "1.0.0"
[uk.co.webamoeba.slf4j/slf4j-junit "1.0.0"]

Зависимости

provided (2)

Идентификатор библиотеки Тип Версия
org.slf4j : slf4j-api jar 1.7.7
junit : junit jar 4.12

test (1)

Идентификатор библиотеки Тип Версия
org.mockito : mockito-core jar 1.10.19

Модули Проекта

Данный проект не имеет модулей.

slf4j-junit

[![Coverage Status](https://img.shields.io/codecov/c/github/jameskennard/slf4j-junit.svg)](https://codecov.io/github/jameskennard/slf4j-junit)

slf4j-junit enables verification of logging made with SLF4J.

Getting Started

We create a normal JUnit test, and we add a JUnit TestRule in order to enable the verification of logging within the test.

import org.junit.Rule;

import static uk.co.webamoeba.slf4j.junit.LogVerification.enableLogging;

public class SomeTest {

@Rule
public EnableLogging enableLogging = enableLogging();

}

We can now create a test, and verify that some logging has taken place:

import static uk.co.webamoeba.slf4j.junit.LogVerification.verifyLogger;
import static uk.co.webamoeba.slf4j.junit.log.Level.INFO;

...

public void shouldDoSomething() { // Given String someArgument = "Hello everyone!";

// When
something.doSomething(someArgument);

// Then
verifyLogger(Something.class).logged(INFO, "I saw the 'Hello everyone!'");

}

Версии библиотеки

Версия
1.0.0