with-environment

Execute a block with overridden environment variables

Лицензия

Лицензия

Группа

Группа

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

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

with-environment
Последняя версия

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

0.9.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

with-environment
Execute a block with overridden environment variables
Ссылка на сайт

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

https://github.com/brymck/with-environment
Система контроля версий

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

https://github.com/brymck/with-environment

Скачать with-environment

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

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

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.jetbrains : annotations jar 15.0
org.slf4j : slf4j-api jar 1.7.25

test (4)

Идентификатор библиотеки Тип Версия
org.slf4j : slf4j-simple jar 1.7.25
org.junit.jupiter : junit-jupiter-api jar 5.5.2
org.junit.jupiter : junit-jupiter-engine jar 5.5.2
org.junit.jupiter : junit-jupiter-params jar 5.5.2

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

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

with-environment

CircleCI codecov

with-environment is a library that allows overriding the system environment and executing a block.

Much of this is shamelessly yanked from SystemRules and is just designed to decouple the functionality from JUnit 4 and provide a natural Kotlin interface.

Usage

Include this in your POM:

<dependency>
  <groupId>com.github.brymck</groupId>
  <artifactId>with-environment</artifactId>
  <version>0.9.1</version>
</dependency>

And use it as s o in Java:

Map<String, String> overrides = new HashMap<>();
overrides.put("FOO", "bar");
WithEnvironment.withEnvironmentOverrides(overrides, () -> {
  String foo = System.getenv("FOO");
  System.out.println(foo);  // prints "bar"
});

or Kotlin:

val overrides = mapOf("FOO" to "bar")
withEnvironmentOverrides(overrides) {
  val foo = System.getenv("FOO");
  println(foo)  // prints "bar"
}

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

Версия
0.9.1
0.9.0