reset EnvoronmentContext between test to avoid influence one test on another (#15933)

7.20.x
Sergii Kabashniuk 2020-02-05 13:20:12 +01:00 committed by GitHub
parent f4d8ad9a0b
commit c3b4b796f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -54,6 +54,7 @@ import org.eclipse.che.workspace.infrastructure.kubernetes.KubernetesClientFacto
import org.eclipse.che.workspace.infrastructure.kubernetes.api.shared.KubernetesNamespaceMeta;
import org.mockito.Mock;
import org.mockito.testng.MockitoTestNGListener;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
@ -95,6 +96,11 @@ public class KubernetesNamespaceFactoryTest {
.thenReturn(new UserImpl(USER_ID, "test@mail.com", USER_NAME));
}
@AfterMethod
public void tearDown() {
EnvironmentContext.reset();
}
@Test
public void shouldNotThrowExceptionIfDefaultNamespaceIsSpecifiedOnCheckingIfNamespaceIsAllowed()
throws Exception {