TextExtractionStage extends AbstractProcessStage { String getFileFormat(LocalDocument doc) { Object fileFormatObject = doc.getContentField(fileFormatField); return fileFormatHelper(fileFormatObject, 0); }  @Override void process(LocalDocument doc); @Override void init(); void setUrlField(String urlField); void setContentField(String contentField); String getContentField(); void setMetadatPrefix(String prefix); String getMetadataPrefix(); long getMaxSizeInBytes(); void setMaxSizeInBytes(long size); String getFileSizeField(); void setFileSizeField(String fileSizeField); String getFileFormatField(); void setFileFormatField(String fileFormatField); List<String> getAllowedFileFormats(); void setAllowedFileFormats(List<String> allowedFileFormats);  }
@Test public void testGetFileFormat() { stage.setFileFormatField("fileFormat"); doc.putContentField("fileFormat", "ppt"); String format = stage.getFileFormat(doc); if (!"ppt".equals(format)) { fail("File format was not extracted"); } }