@Test public void EnsureMethodsThrowExceptionIfNotInitialized() throws Exception { AbstractPrintFileProcessor processor = Mockito.mock(AbstractPrintFileProcessor.class, Mockito.CALLS_REAL_METHODS); PrintJob printJob = createTestPrintJob(processor); DataAid aid = null; try { // applyimagetransform processor.applyBulbMask(aid, null, 0, 0); Assert.fail("Failed to throw IllegalStateException."); } catch (IllegalStateException e) { } try { // applyimagetransform processor.applyImageTransforms(aid, null); Assert.fail("Failed to throw IllegalStateException."); } catch (IllegalStateException e) { } try { processor.performFooter(aid); Assert.fail("Failed to throw IllegalStateException."); } catch (IllegalStateException e) { } try { processor.performHeader(aid); Assert.fail("Failed to throw IllegalStateException."); } catch (IllegalStateException e) { } try { processor.printImageAndPerformPostProcessing(aid, image); Assert.fail("Failed to throw IllegalStateException."); } catch (IllegalStateException e) { } try { processor.performPreSlice(aid, null); Assert.fail("Failed to throw IllegalStateException."); } catch (IllegalStateException e) { } }