Search in sources :

Example 1 with FatJarDetector

use of org.eclipse.jkube.generator.javaexec.FatJarDetector in project jkube by eclipse.

the class OpenLibertyGeneratorTest method getEnvWithFatJar.

@Test
public void getEnvWithFatJar() {
    try (MockedConstruction<FatJarDetector> ignore = mockConstruction(FatJarDetector.class, withSettings().defaultAnswer(RETURNS_DEEP_STUBS), (mock, ctx) -> {
        // Given
        when(mock.scan().getArchiveFile()).thenReturn(new File("/the/archive/file.jar"));
        when(mock.scan().getMainClass()).thenReturn("wlp.lib.extract.SelfExtractRun");
    })) {
        // When
        final Map<String, String> result = new OpenLibertyGenerator(context).getEnv(false);
        // Then
        assertThat(result).hasSize(2).containsEntry("LIBERTY_RUNNABLE_JAR", "file.jar").containsEntry("JAVA_APP_JAR", "file.jar");
    }
}
Also used : File(java.io.File) FatJarDetector(org.eclipse.jkube.generator.javaexec.FatJarDetector) Test(org.junit.Test)

Aggregations

File (java.io.File)1 FatJarDetector (org.eclipse.jkube.generator.javaexec.FatJarDetector)1 Test (org.junit.Test)1