@Test public void should_create_export_if_details_fulfilled() throws Exception { ReportExport result = exportFactory.create(mReportExecutionDescriptor, EXEC_ID, mExportIdWrapper); assertThat(result, is(notNullValue())); assertThat(result, is(instanceOf(ReportExport.class))); verify(mAttachmentsFactory).create(mExportDescriptor, EXEC_ID); }
@NotNull public ReportExport create(ReportExecutionDescriptor descriptor, String execId, ExportIdWrapper exportIdWrapper) throws ServiceException { ExportDescriptor export = findExportDescriptor(descriptor, exportIdWrapper.getServerId()); if (export == null) { throw new ServiceException("Server returned malformed export details", null, StatusCodes.EXPORT_EXECUTION_FAILED); } List<ReportAttachment> attachments = mAttachmentsFactory.create(export, execId); return new ReportExport(mExportExecutionApi, attachments, execId, exportIdWrapper.getExactId()); }
ExportFactory { @NotNull public ReportExport create(ReportExecutionDescriptor descriptor, String execId, ExportIdWrapper exportIdWrapper) throws ServiceException { ExportDescriptor export = findExportDescriptor(descriptor, exportIdWrapper.getServerId()); if (export == null) { throw new ServiceException("Server returned malformed export details", null, StatusCodes.EXPORT_EXECUTION_FAILED); } List<ReportAttachment> attachments = mAttachmentsFactory.create(export, execId); return new ReportExport(mExportExecutionApi, attachments, execId, exportIdWrapper.getExactId()); } }
ExportFactory { @NotNull public ReportExport create(ReportExecutionDescriptor descriptor, String execId, ExportIdWrapper exportIdWrapper) throws ServiceException { ExportDescriptor export = findExportDescriptor(descriptor, exportIdWrapper.getServerId()); if (export == null) { throw new ServiceException("Server returned malformed export details", null, StatusCodes.EXPORT_EXECUTION_FAILED); } List<ReportAttachment> attachments = mAttachmentsFactory.create(export, execId); return new ReportExport(mExportExecutionApi, attachments, execId, exportIdWrapper.getExactId()); } ExportFactory(ExportExecutionApi exportExecutionApi, AttachmentsFactory attachmentsFactory); }
ExportFactory { @NotNull public ReportExport create(ReportExecutionDescriptor descriptor, String execId, ExportIdWrapper exportIdWrapper) throws ServiceException { ExportDescriptor export = findExportDescriptor(descriptor, exportIdWrapper.getServerId()); if (export == null) { throw new ServiceException("Server returned malformed export details", null, StatusCodes.EXPORT_EXECUTION_FAILED); } List<ReportAttachment> attachments = mAttachmentsFactory.create(export, execId); return new ReportExport(mExportExecutionApi, attachments, execId, exportIdWrapper.getExactId()); } ExportFactory(ExportExecutionApi exportExecutionApi, AttachmentsFactory attachmentsFactory); @NotNull ReportExport create(ReportExecutionDescriptor descriptor, String execId, ExportIdWrapper exportIdWrapper); }
ExportFactory { @NotNull public ReportExport create(ReportExecutionDescriptor descriptor, String execId, ExportIdWrapper exportIdWrapper) throws ServiceException { ExportDescriptor export = findExportDescriptor(descriptor, exportIdWrapper.getServerId()); if (export == null) { throw new ServiceException("Server returned malformed export details", null, StatusCodes.EXPORT_EXECUTION_FAILED); } List<ReportAttachment> attachments = mAttachmentsFactory.create(export, execId); return new ReportExport(mExportExecutionApi, attachments, execId, exportIdWrapper.getExactId()); } ExportFactory(ExportExecutionApi exportExecutionApi, AttachmentsFactory attachmentsFactory); @NotNull ReportExport create(ReportExecutionDescriptor descriptor, String execId, ExportIdWrapper exportIdWrapper);  }