DescriptorParserFacade { public ExtensionDescriptor parseExtensionDescriptor(InputStream yaml) { Map<String, Object> descriptor = yamlParser.convertYamlToMap(yaml); return parseExtensionDescriptor(descriptor); } DescriptorParserFacade();  DescriptorParserFacade(YamlParser yamlParser); DeploymentDescriptor parseDeploymentDescriptor(InputStream yaml); DeploymentDescriptor parseDeploymentDescriptor(String yaml); ExtensionDescriptor parseExtensionDescriptor(InputStream yaml); ExtensionDescriptor parseExtensionDescriptor(String yaml);  }
@Test void testInvalidResourcesInExtensionDescriptor() { InputStream descriptorStream = TestUtil.getResourceAsInputStream(INVALID_RESOURCES_MTAEXT, getClass()); try { parser.parseExtensionDescriptor(descriptorStream); fail("Expected exception"); } catch (ContentException e) { assertEquals(MessageFormat.format(Messages.INVALID_TYPE_FOR_KEY, "resources#0#requires#0", Map.class.getSimpleName(), String.class.getSimpleName()), e.getMessage()); } }
@Test void testValidParseExtensionDescriptorWithString() { String descriptorString = TestUtil.getResourceAsString(MTAEXT_VALID, getClass()); ExtensionDescriptor descriptor = parser.parseExtensionDescriptor(descriptorString); assertNotNull(descriptor); }
@Test void testEmptyParseExtensionDescriptorWithString() { InputStream descriptorStream = TestUtil.getResourceAsInputStream(DESCRIPTOR_EMPTY, getClass()); try { parser.parseExtensionDescriptor(descriptorStream); fail("Expected exception"); } catch (ContentException e) { assertEquals(Messages.ERROR_EMPTY_EXTENSION_DESCRIPTOR, e.getMessage()); } }
@Test void testValidParseExtensionDescriptorWithStream() { InputStream descriptorStream = TestUtil.getResourceAsInputStream(MTAEXT_VALID, getClass()); ExtensionDescriptor descriptor = parser.parseExtensionDescriptor(descriptorStream); assertNotNull(descriptor); }