@Test public void testInvalidProcessFloatValues() throws Exception { exception.expect(CellProcessingException.class); exception.expectMessage(containsString("The field must be a Float")); assertNull(processFloatValues(cellWithString)); assertNull(processFloatValues(blankCell)); }
public static Float processFloatValues(XSSFCell cell) { Float floatValue = null; if (cell != null) { switch (cell.getCellType()) { case Cell.CELL_TYPE_NUMERIC: floatValue = (float) cell.getNumericCellValue(); break; default: throw new CellProcessingException("The field must be a Float"); } } return floatValue; }
SheetCellProcessingService { public static Float processFloatValues(XSSFCell cell) { Float floatValue = null; if (cell != null) { switch (cell.getCellType()) { case Cell.CELL_TYPE_NUMERIC: floatValue = (float) cell.getNumericCellValue(); break; default: throw new CellProcessingException("The field must be a Float"); } } return floatValue; } }
SheetCellProcessingService { public static Float processFloatValues(XSSFCell cell) { Float floatValue = null; if (cell != null) { switch (cell.getCellType()) { case Cell.CELL_TYPE_NUMERIC: floatValue = (float) cell.getNumericCellValue(); break; default: throw new CellProcessingException("The field must be a Float"); } } return floatValue; }  }
SheetCellProcessingService { public static Float processFloatValues(XSSFCell cell) { Float floatValue = null; if (cell != null) { switch (cell.getCellType()) { case Cell.CELL_TYPE_NUMERIC: floatValue = (float) cell.getNumericCellValue(); break; default: throw new CellProcessingException("The field must be a Float"); } } return floatValue; }  static String processMandatoryStringValue(XSSFCell cell); static String processStringValue(XSSFCell cell); static Integer processIntValues(XSSFCell cell); static Float processFloatValues(XSSFCell cell); }
SheetCellProcessingService { public static Float processFloatValues(XSSFCell cell) { Float floatValue = null; if (cell != null) { switch (cell.getCellType()) { case Cell.CELL_TYPE_NUMERIC: floatValue = (float) cell.getNumericCellValue(); break; default: throw new CellProcessingException("The field must be a Float"); } } return floatValue; }  static String processMandatoryStringValue(XSSFCell cell); static String processStringValue(XSSFCell cell); static Integer processIntValues(XSSFCell cell); static Float processFloatValues(XSSFCell cell);  }