コード例 #1
0
  @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);
  }
コード例 #2
0
  @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);
  }
コード例 #3
0
 private PropertyOracle mockPropertyOracle() {
   when(context.getPropertyOracle()).thenReturn(propertyOracle);
   return propertyOracle;
 }