ToscaParserSupplier implements Supplier<ToscaParser> { @Override public ToscaParser get() { ApplicationContext applicationContext = new AnnotationConfigApplicationContext(AppConfig.class); return applicationContext.getBean(ToscaParser.class); }  @Override ToscaParser get();  }
@Test public void testCreation() { final ToscaParser toscaParser = new ToscaParserSupplier().get(); assertNotNull(toscaParser); assertTrue(toscaParser instanceof ToscaParser); }
@Test public void testNodeType() throws URISyntaxException, ParsingException { ToscaParser toscaParser = new ToscaParserSupplier().get(); ParsingResult<ArchiveRoot> parsingResult = toscaParser.parseFile(Paths.get(Resources.getResource("tosca/SimpleProfile_wd03/parsing/tosca-node-type.yml").toURI())); ArchiveRoot archiveRoot = parsingResult.getResult(); assertNotNull(archiveRoot); assertNotNull(archiveRoot.getArchive()); assertEquals(TOSCA_VERSION, archiveRoot.getArchive().getToscaDefinitionsVersion()); assertEquals(1, archiveRoot.getNodeTypes().size()); assertNull(archiveRoot.getRelationshipTypes()); }