### Question:
PluginMetadataParser { public Set<MojoDescriptor> parseMojoDescriptors( File metadataFile ) throws PluginMetadataParseException { Set<MojoDescriptor> descriptors = new HashSet<>(); try ( Reader reader = ReaderFactory.newXmlReader( metadataFile ) ) { PluginMetadataXpp3Reader metadataReader = new PluginMetadataXpp3Reader(); PluginMetadata pluginMetadata = metadataReader.read( reader ); List<Mojo> mojos = pluginMetadata.getMojos(); if ( mojos != null ) { for ( Mojo mojo : mojos ) { MojoDescriptor descriptor = asDescriptor( metadataFile, mojo ); descriptors.add( descriptor ); } } } catch ( IOException | XmlPullParserException e ) { throw new PluginMetadataParseException( metadataFile, "Cannot parse plugin metadata from file.", e ); } return descriptors; }  Set<MojoDescriptor> parseMojoDescriptors( File metadataFile ); static final String IMPL_BASE_PLACEHOLDER; }### Answer:
@Test public void testBasicDeclarationWithoutCall() throws PluginMetadataParseException { File metadataFile = getMetadataFile( "test.mojos.xml" ); Set<MojoDescriptor> descriptors = new PluginMetadataParser().parseMojoDescriptors( metadataFile ); assertEquals(1, descriptors.size()); MojoDescriptor desc = descriptors.iterator().next(); assertFalse( desc.getImplementation().contains( ":" ) ); assertEquals( "test", desc.getGoal() ); }
@Test public void testBasicDeclarationWithCall() throws PluginMetadataParseException { File metadataFile = getMetadataFile( "test2.mojos.xml" ); Set<MojoDescriptor> descriptors = new PluginMetadataParser().parseMojoDescriptors( metadataFile ); assertEquals( 1, descriptors.size() ); MojoDescriptor desc = descriptors.iterator().next(); assertTrue( desc.getImplementation().endsWith( ":test2" ) ); assertEquals( "test2", desc.getGoal() ); }