DescriptorParserFacade { public DeploymentDescriptor parseDeploymentDescriptor(InputStream yaml) { Map<String, Object> descriptor = yamlParser.convertYamlToMap(yaml); return parseDeploymentDescriptor(descriptor); } DescriptorParserFacade();  DescriptorParserFacade(YamlParser yamlParser); DeploymentDescriptor parseDeploymentDescriptor(InputStream yaml); DeploymentDescriptor parseDeploymentDescriptor(String yaml); ExtensionDescriptor parseExtensionDescriptor(InputStream yaml); ExtensionDescriptor parseExtensionDescriptor(String yaml);  }
@Test void testValidParseDeploymentDescriptorWithStream() { InputStream descriptorStream = TestUtil.getResourceAsInputStream(MTAD_VALID, getClass()); DeploymentDescriptor descriptor = parser.parseDeploymentDescriptor(descriptorStream); assertNotNull(descriptor); }
@Test void testValidParseDeploymentDescriptorWithString() { String descriptorString = TestUtil.getResourceAsString(MTAD_VALID, getClass()); DeploymentDescriptor descriptor = parser.parseDeploymentDescriptor(descriptorString); assertNotNull(descriptor); }
@Test void testEmptyParseDeploymentDescriptorWithStream() { InputStream descriptorStream = TestUtil.getResourceAsInputStream(DESCRIPTOR_EMPTY, getClass()); try { parser.parseDeploymentDescriptor(descriptorStream); fail("Expected exception"); } catch (ContentException e) { assertEquals(Messages.ERROR_EMPTY_DEPLOYMENT_DESCRIPTOR, e.getMessage()); } }
@Test void testMissingSchemaParseDeploymentDescriptorWithStream() { InputStream descriptorStream = TestUtil.getResourceAsInputStream(DESCRIPTOR_MISSING_SCHEMA, getClass()); try { parser.parseDeploymentDescriptor(descriptorStream); fail("Expected exception"); } catch (ContentException e) { assertEquals(MessageFormat.format(Messages.MISSING_REQUIRED_KEY, SCHEMA_VERSION_KEY), e.getMessage()); } }