@BeforeClass public static void initJFX(){
  if (t == null) {
    t=new Thread(null);
    t.setDaemon(true);
    t.start();
  }
}

@ BeforeClass public static void initJFX ( ) { if ( t == null ) { t = new Thread ( null ) ; t . setDaemon ( true ) ; t . start ( ) ; } }
before testing start a javafx thread to be able to run and test javafx elements
