BAEL-1733 (#4417)
* BAEL-1733 * naming conventions settled * createManifestFile method added * remove accidentally created MANIFEST.MF file from the project root flder
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package com.baeldung.manifest;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class ExecuteJarFileUnitTest {
|
||||
|
||||
private static final String ERROR_MESSAGE = "no main manifest attribute, in example.jar\n";
|
||||
private static final String SUCCESS_MESSAGE = "AppExample executed!\n";
|
||||
|
||||
@Test
|
||||
public final void givenDefaultManifest_whenManifestAttributeIsNotPresent_thenGetErrorMessage() {
|
||||
String output = ExecuteJarFile.executeJarWithoutManifestAttribute();
|
||||
assertEquals(ERROR_MESSAGE, output);
|
||||
}
|
||||
|
||||
@Test
|
||||
public final void givenCustomManifest_whenManifestAttributeIsPresent_thenGetSuccessMessage() {
|
||||
String output = ExecuteJarFile.executeJarWithManifestAttribute();
|
||||
assertEquals(SUCCESS_MESSAGE, output);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user