### Question:
DomainTopology { public static DomainTopology parseDomainTopologyYaml(String topologyYaml, Consumer<List<String>> errorReporter) { final DomainTopology domainTopology = parseDomainTopologyYaml(topologyYaml); if (domainTopology == null || domainTopology.getDomainValid()) { return domainTopology; } else { errorReporter.accept(domainTopology.validationErrors); return null; } } @SuppressWarnings("unused") // Used by parser  DomainTopology();  DomainTopology(WlsDomainConfig domain); static DomainTopology parseDomainTopologyYaml(String topologyYaml, Consumer<List<String>> errorReporter); static DomainTopology parseDomainTopologyYaml(String topologyYaml); boolean getDomainValid(); @SuppressWarnings("unused") // used by parser void setDomainValid(boolean domainValid); @SuppressWarnings("unused") // used by parser void setValidationErrors(List<String> validationErrors); WlsDomainConfig getDomain(); void setDomain(WlsDomainConfig domain); List<String> getValidationErrors(); String toString();  }### Answer:
@Test public void parseDomainTopologyYaml() { DomainTopology domainTopology = DomainTopology.parseDomainTopologyYaml(DOMAIN_TOPOLOGY); assertNotNull(domainTopology); assertTrue(domainTopology.getDomainValid()); WlsDomainConfig wlsDomainConfig = domainTopology.getDomain(); assertNotNull(wlsDomainConfig); assertEquals("base_domain", wlsDomainConfig.getName()); assertEquals("admin-server", wlsDomainConfig.getAdminServerName()); Map<String, WlsClusterConfig> wlsClusterConfigs = wlsDomainConfig.getClusterConfigs(); assertEquals(1, wlsClusterConfigs.size()); WlsClusterConfig wlsClusterConfig = wlsClusterConfigs.get("cluster-1"); assertNotNull(wlsClusterConfig); List<WlsServerConfig> wlsServerConfigs = wlsClusterConfig.getServers(); assertEquals(2, wlsServerConfigs.size()); Map<String, WlsServerConfig> serverConfigMap = wlsDomainConfig.getServerConfigs(); assertEquals(3, serverConfigMap.size()); assertTrue(serverConfigMap.containsKey("admin-server")); assertTrue(serverConfigMap.containsKey("server1")); assertTrue(serverConfigMap.containsKey("server2")); WlsServerConfig adminServerConfig = serverConfigMap.get("admin-server"); assertEquals(7099, adminServerConfig.getAdminPort().intValue()); assertTrue(adminServerConfig.isAdminPortEnabled()); WlsServerConfig server2Config = serverConfigMap.get("server2"); assertEquals("domain1-managed-server2", server2Config.getListenAddress()); assertEquals(9004, server2Config.getListenPort().intValue()); assertEquals(8004, server2Config.getSslListenPort().intValue()); assertTrue(server2Config.isSslPortEnabled()); List<NetworkAccessPoint> server2ConfigNaps = server2Config.getNetworkAccessPoints(); assertEquals(1, server2ConfigNaps.size()); NetworkAccessPoint server2ConfigNap = server2ConfigNaps.get(0); assertEquals("nap2", server2ConfigNap.getName()); assertEquals("t3", server2ConfigNap.getProtocol()); assertEquals(8005, server2ConfigNap.getListenPort().intValue()); assertEquals(8005, server2ConfigNap.getPublicPort().intValue()); }