Search in sources :

Example 6 with SystemMock

use of org.eclipse.jkube.kit.common.SystemMock in project jkube by eclipse.

the class EnvUtilTest method testIsWindowsFalse.

@Test
public void testIsWindowsFalse() {
    // Given
    new SystemMock().put("os.name", "random");
    // When
    boolean result = EnvUtil.isWindows();
    // Then
    assertThat(result).isFalse();
}
Also used : SystemMock(org.eclipse.jkube.kit.common.SystemMock) Test(org.junit.Test)

Example 7 with SystemMock

use of org.eclipse.jkube.kit.common.SystemMock in project jkube by eclipse.

the class JKubeProjectUtilTest method getProperty_whenSystemPropertyPresent_returnsSystemProperty.

@Test
public void getProperty_whenSystemPropertyPresent_returnsSystemProperty() {
    // Given
    new SystemMock().put("jkube.testProperty", "true");
    JavaProject javaProject = JavaProject.builder().build();
    // When
    String result = JKubeProjectUtil.getProperty("jkube.testProperty", javaProject);
    // Then
    assertThat(result).isEqualTo("true");
}
Also used : JavaProject(org.eclipse.jkube.kit.common.JavaProject) SystemMock(org.eclipse.jkube.kit.common.SystemMock) Test(org.junit.Test)

Aggregations

SystemMock (org.eclipse.jkube.kit.common.SystemMock)7 Test (org.junit.Test)7 AuthConfig (org.eclipse.jkube.kit.build.api.auth.AuthConfig)3 JsonObject (com.google.gson.JsonObject)1 PodSpec (io.fabric8.kubernetes.api.model.PodSpec)1 DeploymentSpec (io.fabric8.kubernetes.api.model.apps.DeploymentSpec)1 HashMap (java.util.HashMap)1 MockUp (mockit.MockUp)1 AwsSdkAuthConfigFactory (org.eclipse.jkube.kit.build.service.docker.auth.ecr.AwsSdkAuthConfigFactory)1 JavaProject (org.eclipse.jkube.kit.common.JavaProject)1