JUnit Lambda Extensions

JUnit extensions that make use of Java 8 lambdas.

Лицензия

Лицензия

MIT
Категории

Категории

JUnit Тестирование компонентов
Группа

Группа

com.github.marschall
Идентификатор

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

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

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

0.3.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

JUnit Lambda Extensions
JUnit extensions that make use of Java 8 lambdas.
Ссылка на сайт

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

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

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

https://github.com/marschall/junit-lambda

Скачать junit-lambda

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

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

Зависимости

provided (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12

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

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

JUnit λ Build Status Maven Central

JUnit extensions built on Java 8 lambdas. Helps to test exceptions and can be used instead of the following pattern:

try {
    Long.parseLong("foo");
    fail("'foo' should not be a valid long");
} catch (NumberFormatException e) {
    // should reach here
}

You can either use #assertRaises

import static com.github.marschall.junitlambda.LambdaAssert.assertRaises;
import org.junit.Test;

public final class JunitLambdaTest {
    @Test
    public void testNumberFormatException() {
        assertRaises(() -> Long.parseLong("foo"), NumberFormatException.class);
    }
}

or the Hamcrest matcher #throwsException

import static com.github.marschall.junitlambda.ThrowsException.throwsException;
import org.junit.Test;

public final class JunitLambdaTest {
    @Test
    public void testNumberFormatException() {
        assertThat(() -> Long.parseLong("foo"), throwsException(NumberFormatException.class));
    }
}
<dependency>
    <groupId>com.github.marschall</groupId>
    <artifactId>junit-lambda</artifactId>
    <version>0.3.0</version>
    <scope>test</scope>
</dependency>

The code is under MIT license.

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

Версия
0.3.0
0.2.0
0.1.0