@Ignore("can only be ran once I make the code changes to mock out the composer factory") @Test public void generate_shouldNotAttemptToSetupTheLoggerOnTheSourceWriter() throws UnableToCompleteException { when(context.tryCreate(logger, packageName, className)).thenReturn(null); assertBundleClass(runGenerator()); verifyBundleInterfaceWasSetOnTheComposer(); verifyZeroInteractions(sourceWriter); }
@Ignore("can only be ran once I make the code changes to mock out the composer factory") @Test public void generate_shouldSetTheLoggerOnTheSourceWriter() throws Exception { StubPrintWriter contextWriter = new StubPrintWriter(); when(context.tryCreate(logger, packageName, className)).thenReturn(contextWriter); when(composerFactory.createSourceWriter(context, contextWriter)).thenReturn(sourceWriter); assertBundleClass(runGenerator()); verifyBundleInterfaceWasSetOnTheComposer(); verify(sourceWriter).commit(logger); }