Corrected the file names
This commit is contained in:
parent
080dd2f226
commit
be3614c157
@ -0,0 +1,16 @@
|
|||||||
|
package com.baeldung.exceptions.nosuchfielderror;
|
||||||
|
|
||||||
|
public class FieldErrorExample {
|
||||||
|
|
||||||
|
public static void main(String... args) {
|
||||||
|
fetchAndPrint();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getDependentMessage() {
|
||||||
|
return Dependent.message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void fetchAndPrint() {
|
||||||
|
System.out.println(getDependentMessage());
|
||||||
|
}
|
||||||
|
}
|
@ -1,8 +0,0 @@
|
|||||||
package com.baeldung.exceptions.nosuchfielderror;
|
|
||||||
|
|
||||||
public class NoSuchFieldErrorExample {
|
|
||||||
|
|
||||||
public static String getDependentMessage() {
|
|
||||||
return Dependent.message;
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.baeldung.exceptions.nosuchfielderror;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
public class FieldErrorExampleUnitTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenDependentMessage_returnMessage() {
|
||||||
|
String dependentMessage = FieldErrorExample.getDependentMessage();
|
||||||
|
assertTrue("Hello Baeldung!!".equals(dependentMessage));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,15 +0,0 @@
|
|||||||
package com.baeldung.exceptions.nosuchfielderror;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
public class NoSuchFieldErrorExampleUnitTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void whenDependentMessage_returnMessage() {
|
|
||||||
String dependentMessage = NoSuchFieldErrorExample.getDependentMessage();
|
|
||||||
assertTrue("Hello Baeldung".equals(dependentMessage));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user