test_class.file: persistence-mongodb/src/test/java/org/devgateway/ocds/persistence/mongo/excel/ReleaseExportFileTest.java
test_class.identifier: ReleaseExportFileTest
test_case.body: @Test
      public void createWorkbook() throws Exception {
          final ClassLoader classLoader = getClass().getClassLoader();
          final File file = new File(classLoader.getResource("json/release-excel-export.json").getFile());
          final JsonToObject releasePackageJsonToObject = new ReleasePackageJsonToObject(file);
  
          final ReleasePackage releasePackage = (ReleasePackage) releasePackageJsonToObject.toObject();
  
          final ExcelFile releaseExcelFile = new ReleaseExportFile(new ArrayList<>(releasePackage.getReleases()));
          final Workbook workbook = releaseExcelFile.createWorkbook();
  //         try (FileOutputStream outputStream = new FileOutputStream("/home/mihai/ocds-export.xlsx")) {
  //             workbook.write(outputStream);
  //         }
  
          Assert.assertEquals("Number of sheets", 6, workbook.getNumberOfSheets());
  
          Assert.assertNotNull("release sheet", workbook.getSheet("release"));
          Assert.assertNotNull("tender sheet", workbook.getSheet("tender"));
          Assert.assertNotNull("award sheet", workbook.getSheet("award"));
          Assert.assertNotNull("item sheet", workbook.getSheet("item"));
          Assert.assertNotNull("contract sheet", workbook.getSheet("contract"));
  
          Assert.assertEquals("release id", "ocds-213czf-000-00001-01-planning",
                  workbook.getSheet("release").getRow(3).getCell(0).toString());
          Assert.assertEquals("release id", "ocds-213czf-000-00001-06-implementation",
                  workbook.getSheet("release").getRow(5).getCell(0).toString());
  
          Assert.assertEquals("tender parent", "release - ocds-213czf-000-00001",
                  workbook.getSheet("tender").getRow(1).getCell(0).toString());
          Assert.assertEquals("tender id", "ocds-213czf-000-00001-01-planning",
                  workbook.getSheet("tender").getRow(1).getCell(1).toString());
  
  
          Assert.assertEquals("award number of rows", 4, workbook.getSheet("award").getLastRowNum());
  
          Assert.assertEquals("item number of rows", 9, workbook.getSheet("item").getLastRowNum());
  
          Assert.assertEquals("contract flatten organization id", "E09000003 | E09000003",
                  workbook.getSheet("contract").getRow(2).getCell(17).toString());
      }
test_case.class_method_signature: ReleaseExportFileTest.createWorkbook()
test_case.full_signature: @Test public void createWorkbook()
test_case.identifier: createWorkbook
test_case.invocations: getClassLoader getClass getFile getResource toObject getReleases createWorkbook assertEquals getNumberOfSheets assertNotNull getSheet assertNotNull getSheet assertNotNull getSheet assertNotNull getSheet assertNotNull getSheet assertEquals toString getCell getRow getSheet assertEquals toString getCell getRow getSheet assertEquals toString getCell getRow getSheet assertEquals toString getCell getRow getSheet assertEquals getLastRowNum getSheet assertEquals getLastRowNum getSheet assertEquals toString getCell getRow getSheet
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void createWorkbook()
focal_class.declarator: releases
focal_class.modifier: private final
focal_class.original_string: private final List<Release> releases;
focal_class.type: List<Release>
focal_class.var_name: releases
focal_class.declarator: workbook
focal_class.modifier: private final
focal_class.original_string: private final Workbook workbook;
focal_class.type: Workbook
focal_class.var_name: workbook
focal_class.file: persistence-mongodb/src/main/java/org/devgateway/ocds/persistence/mongo/excel/ReleaseExportFile.java
focal_class.identifier: ReleaseExportFile
focal_class.interfaces: implements ExcelFile
focal_class.class_method_signature: ReleaseExportFile.ReleaseExportFile(final List<Release> releases)
focal_class.full_signature: public  ReleaseExportFile(final List<Release> releases)
focal_class.identifier: ReleaseExportFile
focal_class.modifiers: public
focal_class.parameters: (final List<Release> releases)
focal_class.signature:  ReleaseExportFile(final List<Release> releases)
focal_class.class_method_signature: ReleaseExportFile.createWorkbook()
focal_class.full_signature: @Override public Workbook createWorkbook()
focal_class.identifier: createWorkbook
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Workbook
focal_class.signature: Workbook createWorkbook()
focal_method.body: @Override
      public Workbook createWorkbook() {
          ExcelSheet releaseSheet = new OCDSObjectExcelSheet(this.workbook, Release.class);
  
          // don't do anything if the list of releases is empty, just display the error message
          if (releases != null && !releases.isEmpty()) {
              releaseSheet.writeSheet(new ArrayList<>(releases));
          }
  
          return workbook;
      }
focal_method.class_method_signature: ReleaseExportFile.createWorkbook()
focal_method.full_signature: @Override public Workbook createWorkbook()
focal_method.identifier: createWorkbook
focal_method.invocations: isEmpty writeSheet
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: Workbook
focal_method.signature: Workbook createWorkbook()