Please note, this isn't a duplicate of this.
I have been writing some code that is run as a JUnit. I read the thread linked above, which talks about how the location of an error in a stack trace is normally closest to the bottom. However, because my code is being run as a JUnit test, the stack trace is infused with a lot of what I think is a result of the code being run as a Unit test, so the error can not be directly traced to the bottom of the stack trace, like what the post above says. (<--Why it isn't a duplicate).
The following is the stack trace that I get after running code.
java.lang.NullPointerException
at API.ItemFetcher.<init>(ItemFetcher.java:39)
at API.MarketConstants.<clinit>(MarketConstants.java:24)
at API.ItemFetcher.setOtherMonetaryValues(ItemFetcher.java:153)
at API.ItemFetcher.<init>(ItemFetcher.java:53)
at Tests.Tests.test(Tests.java:14)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
The structure of my code is as follows
-src
-API
-Item.java
-ItemFetcher.java
-MarketConstants.java
-IrrelevantFolder
-Tests
-Tests.java
Where should I look in the code, based on the stack trace, for the error? I'm not 100% sure where to look because of all of the JUnit stuff in the stack trace. Like I said before, I have read other SO threads on this but it hasn't been covered before.