Internal graphics not initialized yet in JUunit test case
问题 I'm making a light weight painting application with JavaFx. I've been having some issues with my LayerController class and it's methods addLayer etc. So I thought that writing some JUunit test cases would be a good idea to check the correctness of my methods. To make the story short, I'm painting on a Canvas using its GraphicsContext in a selfmade class which I call PaintGraphics . This class does all the painting. The LayerController needs a PaintGraphics to do its work on the layers. But it