/
NikolayIvkin
/
tutorials1
Обзор
Документация
Войти
/
NikolayIvkin
/
tutorials1
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
testing-modules/testing-libraries-2/src/test/java/com/baeldung/systemrules/ClearSystemPropertiesWithRuleUnitTest.java
19 строк
503 B
Jonathan Cook
BAEL-4437 - System Rules (#10047)
18 сен 2020, 00:22
18 сен 2020, 00:22
f6adcd0
Код
Авторство
О чём код?
package com.baeldung.systemrules; import static org.junit.Assert.assertNull; import org.junit.Rule; import org.junit.Test; import org.junit.contrib.java.lang.system.ClearSystemProperties; public class ClearSystemPropertiesWithRuleUnitTest { @Rule public final ClearSystemProperties userNameIsClearedRule = new ClearSystemProperties("user.name"); @Test public void givenClearUsernameProperty_whenGetUserName_thenNull() { assertNull(System.getProperty("user.name")); } }