### Question:
DeploymentFactory { public static EnterpriseArchive createDeployment( GatewayConfig config, Topology topology ) { validateTopology( topology ); loadStacksServiceContributors( config ); Map<String,List<ProviderDeploymentContributor>> providers = selectContextProviders( topology ); Map<String,List<ServiceDeploymentContributor>> services = selectContextServices( topology ); Map<String,ServiceDeploymentContributor> applications = selectContextApplications( config, topology ); EnterpriseArchive ear = ShrinkWrap.create( EnterpriseArchive.class, topology.getName() ); ear.addAsResource( toStringAsset( topology ), "topology.xml" ); if( !services.isEmpty() ) { WebArchive war = createServicesDeployment( config, topology, providers, services ); ear.addAsModule( war ); } if( !applications.isEmpty() ) { for( Map.Entry<String, ServiceDeploymentContributor> application : applications.entrySet() ) { WebArchive war = createApplicationDeployment( config, topology, providers, application ); ear.addAsModule( war ); } } return ear; }  static void setGatewayServices(GatewayServices services); static EnterpriseArchive createDeployment( GatewayConfig config, Topology topology ); static WebArchive createApplicationDeployment(
      GatewayConfig config,
      Topology topology,
      Map<String,List<ProviderDeploymentContributor>> providers,
      Map.Entry<String,ServiceDeploymentContributor> application ); static ProviderDeploymentContributor getProviderContributor( String role, String name ); static ServiceDeploymentContributor getServiceContributor( String role, String name, Version version ); static ServletType<WebAppDescriptor> findServlet( DeploymentContext context, String name ); static FilterType<WebAppDescriptor> findFilter( DeploymentContext context, String name );  }### Answer:
@Test( timeout = TestUtils.MEDIUM_TIMEOUT ) public void testEmptyTopology() throws IOException, SAXException, ParserConfigurationException, TransformerException { GatewayConfig config = new GatewayConfigImpl(); Topology topology = new Topology(); topology.setName( "test-topology" ); EnterpriseArchive archive = DeploymentFactory.createDeployment( config, topology ); Document xml = XmlUtils.readXml( archive.get( "/META-INF/topology.xml" ).getAsset().openStream() ); assertThat( xml, hasXPath( "/topology/gateway" ) ); assertThat( xml, hasXPath( "/topology/name", equalTo( "test-topology" ) ) ); }