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");
}
}
Aggregations