### Question:
ClusterEntityParser extends EntityParser<Cluster> { @Override public void validate(Cluster cluster) throws ValidationException { validateScheme(cluster, Interfacetype.READONLY); validateScheme(cluster, Interfacetype.WRITE); validateScheme(cluster, Interfacetype.WORKFLOW); if (ClusterHelper.getInterface(cluster, Interfacetype.MESSAGING) != null) { validateScheme(cluster, Interfacetype.MESSAGING); } if (CatalogServiceFactory.isEnabled() && ClusterHelper.getInterface(cluster, Interfacetype.REGISTRY) != null) { validateScheme(cluster, Interfacetype.REGISTRY); } validateACL(cluster); if (!EntityUtil.responsibleFor(cluster.getColo())) { return; } validateReadInterface(cluster); validateWriteInterface(cluster); validateExecuteInterface(cluster); validateWorkflowInterface(cluster); validateMessagingInterface(cluster); validateRegistryInterface(cluster); validateLocations(cluster); validateProperties(cluster); validateSparkMasterInterface(cluster); } ClusterEntityParser(); @Override void validate(Cluster cluster);  }### Answer:
@Test(expectedExceptions = ValidationException.class, expectedExceptionsMessageRegExp = ".*java.net.UnknownHostException.*") public void testParseClusterWithBadWriteInterface() throws Exception { InputStream stream = this.getClass().getResourceAsStream("/config/cluster/cluster-bad-write-endpoint.xml"); Cluster cluster = parser.parse(stream); parser.validate(cluster); }