@Test
public void testParseGlobalMetadata() throws Exception {

    Parser parser = new GribParser();
    Metadata metadata = new Metadata();
    ContentHandler handler = new BodyContentHandler();
    try (InputStream stream = GribParser.class.getResourceAsStream("/test-documents/gdas1.forecmwf.2014062612.grib2")) {
        parser.parse(stream, handler, metadata, new ParseContext());
    }
    assertNotNull(metadata);
    String content = handler.toString();
    assertTrue(content.contains("dimensions:"));
    assertTrue(content.contains("variables:"));
}