@Test public void testGenerateReport_usingFieldTypeAppraoch() throws Exception { ReportGenerator tested = new ReportGenerator(); ReportTemplateService reportTemplateServiceMock = createMock(ReportTemplateService.class); Whitebox.setInternalState(tested, reportTemplateServiceMock); final String reportId = "id"; expect(reportTemplateServiceMock.getTemplateId(reportId)).andReturn("templateId"); replay(reportTemplateServiceMock); Report actualReport = tested.generateReport(reportId); verify(reportTemplateServiceMock); assertEquals(new Report("name"), actualReport); }
public Report generateReport(String reportId) { String templateId = reportTemplateService.getTemplateId(reportId); return new Report("name"); }
ReportGenerator { public Report generateReport(String reportId) { String templateId = reportTemplateService.getTemplateId(reportId); return new Report("name"); } }
ReportGenerator { public Report generateReport(String reportId) { String templateId = reportTemplateService.getTemplateId(reportId); return new Report("name"); }  }
ReportGenerator { public Report generateReport(String reportId) { String templateId = reportTemplateService.getTemplateId(reportId); return new Report("name"); }  Report generateReport(String reportId); }
ReportGenerator { public Report generateReport(String reportId) { String templateId = reportTemplateService.getTemplateId(reportId); return new Report("name"); }  Report generateReport(String reportId);  }