I have the following test code for a class:
/**
* Test Class
*/
public class GeneratorTestTest {
private Generator generator;
private static BufferedImage testImage;
private BufferedImage rotatedImageTestResult;
@Before
public void setUp() throws Exception {
generator = new Generator(null, 0);
File inputFile = new File("src/test/resource/picture.jpg");
testImage = ImageIO.read(inputFile);
}
/**
* Test method
*/
@Test
public void testRotateImageRotateImage() {
//Line 39
rotatedImageTestResult = generator.rotateImage(testImage, 0);
assertTrue(imageEquals(testImage, rotatedImageTestResult));
}
I am get a NullPointerException
on the Test method when I try to run it. How can I pass the Junit test?
Here is a full log of the Exception:
line 39 is "rotatedImageTestResult = generator.rotateImage(testImage, 0);