BAEL-4193 - initial commit
initial commit in new module core-java-exceptions-3
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package com.baeldung.exceptions.nosuchmethoderror;
|
||||
|
||||
public class MainMenu {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Today's Specials: " + getSpecials());
|
||||
}
|
||||
|
||||
public static String getSpecials() {
|
||||
return SpecialToday.getDesert();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.baeldung.exceptions.nosuchmethoderror;
|
||||
public class SpecialToday {
|
||||
private static String desert = "Chocolate Cake";
|
||||
|
||||
public static String getDesert() {
|
||||
return desert;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.baeldung.exceptions.nosuchmethoderror;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class MainMenuUnitTest {
|
||||
|
||||
@Test
|
||||
void whenGetSpecials_thenNotNull() {
|
||||
assertNotNull(MainMenu.getSpecials());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user