WineryRepositoryClient implements IWineryRepositoryClient { @Override public QName getArtifactTypeQNameForExtension(String extension) { for (WebTarget wr : this.repositoryResources) { Response response = wr.path("artifacttypes").queryParam("extension", extension) .request(MediaType.TEXT_PLAIN) .get(); if (response.getStatusInfo().equals(Response.Status.OK)) { return QName.valueOf(response.readEntity(String.class)); } } return null; } WineryRepositoryClient();  WineryRepositoryClient(boolean useProxy); @Override void addRepository(String uri); @Override String getPrimaryRepository(); @Override void setPrimaryRepository(String uri); @Override SortedSet<String> getNamespaces(); @Override String getName(GenericId id); @Override List<QName> getQNameListOfAllTypes(Class<T> className); @Override Collection<QNameWithName> getListOfAllInstances(Class<? extends DefinitionsChildId> clazz); @Override Collection<T> getAllTypes(Class<T> c); @Override @SuppressWarnings("unchecked") T getType(QName qname, Class<T> type); @Override Definitions getDefinitions(DefinitionsChildId id); @Override Collection<TDefinitions> getAllTypesWithAssociatedElements(Class<T> c); @Override TTopologyTemplate getTopologyTemplate(QName serviceTemplate); @Override TTopologyTemplate getTopologyTemplate(QName serviceTemplate, String parentPath, String elementPath); @Override void setTopologyTemplate(QName serviceTemplate, TTopologyTemplate topologyTemplate); @Override QName getArtifactTypeQNameForExtension(String extension); @Override void createArtifactTemplate(QName qname, QName artifactType); @Override void createComponent(QName qname, Class<? extends DefinitionsChildId> idClass); @Override void forceDelete(GenericId id); @Override void rename(DefinitionsChildId oldId, DefinitionsChildId newId); @Override void duplicate(DefinitionsChildId from, DefinitionsChildId newId); @Override void forceDelete(Class<? extends DefinitionsChildId> definitionsChildIdClazz, Namespace namespace); @Override boolean primaryRepositoryAvailable(); static final JAXBContext context; }
@Test public void artifactTypeForWarFiles() throws Exception { this.setRevisionTo("origin/plain"); QName artifactType = TestWineryRepositoryClient.client.getArtifactTypeQNameForExtension("war"); assertNotNull(artifactType, "Artifact Type for .war does not exist"); }