RawYamlStatementLoader { public RawStmtsDocList load(Logger logger, String fromPath, String... searchPaths) { String data = loadRawFile(logger, fromPath, searchPaths); data = applyTransforms(logger, data); return parseYaml(logger, data); } RawYamlStatementLoader();  RawYamlStatementLoader(Function<String, String> stringTransformer); RawStmtsDocList load(Logger logger, String fromPath, String... searchPaths); void addTransformer(Function<String, String> transformer);  }
@Test public void tetLoadPropertiesBlock() { RawYamlStatementLoader ysl = new RawYamlStatementLoader(); RawStmtsDocList rawBlockDocs = ysl.load(logger, "testdocs/rawblock.yaml"); assertThat(rawBlockDocs.getStmtsDocs()).hasSize(1); RawStmtsDoc rawBlockDoc = rawBlockDocs.getStmtsDocs().get(0); assertThat(rawBlockDoc.getRawStmtDefs()).hasSize(1); assertThat(rawBlockDoc.getBindings()).hasSize(1); assertThat(rawBlockDoc.getName()).isEqualTo("name"); assertThat(rawBlockDoc.getTags()).hasSize(1); assertThat(rawBlockDoc.getParams()).hasSize(1); }
@Test public void testLoadFullFormat() { RawYamlStatementLoader ysl = new RawYamlStatementLoader(); RawStmtsDocList erthing = ysl.load(logger, "testdocs/docs_blocks_stmts.yaml"); List<RawStmtsDoc> rawStmtsDocs = erthing.getStmtsDocs(); assertThat(rawStmtsDocs).hasSize(2); RawStmtsDoc rawStmtsDoc = rawStmtsDocs.get(0); List<RawStmtsBlock> blocks = rawStmtsDoc.getBlocks(); assertThat(rawStmtsDoc.getName()).isEqualTo("doc1"); assertThat(blocks).hasSize(1); RawStmtsBlock rawStmtsBlock = blocks.get(0); assertThat(rawStmtsBlock.getName()).isEqualTo("block0"); }