@Test public void shouldGetSkippedAsBlankIfLineItemIsNotSkipped() throws Exception { List<? extends Column> rnrColumns = asList(make(a(defaultRnrColumn, with(columnName, SKIPPED)))); RnrLineItem lineItem = make(a(defaultRnrLineItem, with(skipped, false))); List<PdfPCell> cells = getCells(rnrColumns, lineItem, "$"); assertThat(cells.get(0).getPhrase().getContent(), is("")); assertThat(cells.get(0).getHorizontalAlignment(), is(ALIGN_LEFT)); }
public static List<PdfPCell> getCells(List<? extends Column> visibleColumns, LineItem lineItem, String currency) throws NoSuchFieldException, IllegalAccessException, IOException, BadElementException { List<PdfPCell> result = new ArrayList<>(); for (Column column : visibleColumns) { ColumnType columnType = column.getColumnType(); String value = lineItem.getValue(column.getName()); createCell(result, columnType, value, currency); } return result; }
RequisitionCellFactory { public static List<PdfPCell> getCells(List<? extends Column> visibleColumns, LineItem lineItem, String currency) throws NoSuchFieldException, IllegalAccessException, IOException, BadElementException { List<PdfPCell> result = new ArrayList<>(); for (Column column : visibleColumns) { ColumnType columnType = column.getColumnType(); String value = lineItem.getValue(column.getName()); createCell(result, columnType, value, currency); } return result; } }
RequisitionCellFactory { public static List<PdfPCell> getCells(List<? extends Column> visibleColumns, LineItem lineItem, String currency) throws NoSuchFieldException, IllegalAccessException, IOException, BadElementException { List<PdfPCell> result = new ArrayList<>(); for (Column column : visibleColumns) { ColumnType columnType = column.getColumnType(); String value = lineItem.getValue(column.getName()); createCell(result, columnType, value, currency); } return result; }  }
RequisitionCellFactory { public static List<PdfPCell> getCells(List<? extends Column> visibleColumns, LineItem lineItem, String currency) throws NoSuchFieldException, IllegalAccessException, IOException, BadElementException { List<PdfPCell> result = new ArrayList<>(); for (Column column : visibleColumns) { ColumnType columnType = column.getColumnType(); String value = lineItem.getValue(column.getName()); createCell(result, columnType, value, currency); } return result; }  static PdfPCell numberCell(String value); static PdfPCell textCell(String value); static PdfPCell headingCell(String value); static List<PdfPCell> getCells(List<? extends Column> visibleColumns,
                                        LineItem lineItem,
                                        String currency); static PdfPCell imageCell(); static PdfPCell categoryRow(Integer visibleColumnsSize, LineItem lineItem); }
RequisitionCellFactory { public static List<PdfPCell> getCells(List<? extends Column> visibleColumns, LineItem lineItem, String currency) throws NoSuchFieldException, IllegalAccessException, IOException, BadElementException { List<PdfPCell> result = new ArrayList<>(); for (Column column : visibleColumns) { ColumnType columnType = column.getColumnType(); String value = lineItem.getValue(column.getName()); createCell(result, columnType, value, currency); } return result; }  static PdfPCell numberCell(String value); static PdfPCell textCell(String value); static PdfPCell headingCell(String value); static List<PdfPCell> getCells(List<? extends Column> visibleColumns,
                                        LineItem lineItem,
                                        String currency); static PdfPCell imageCell(); static PdfPCell categoryRow(Integer visibleColumnsSize, LineItem lineItem); static final float CELL_PADDING; static final BaseColor HEADER_BACKGROUND; static final Font H2_FONT; static final int WIDTH_PERCENTAGE; static final Logger logger; }