NodeTypeResource extends TopologyGraphElementEntityTypeResource { public TNodeType getNodeType() { return (TNodeType) this.getElement(); } NodeTypeResource(NodeTypeId id); TNodeType getNodeType(); @GET @Path("implementations/") @Produces(MediaType.APPLICATION_JSON) List<QNameApiData> getImplementations(); @Path("instancestates/") InstanceStatesResource getInstanceStatesResource(); @Path("interfaces/") InterfacesResource getInterfaces(); @Path("requirementdefinitions/") RequirementDefinitionsResource getRequirementDefinitions(); @Path("capabilitydefinitions/") CapabilityDefinitionsResource getCapabilityDefinitions(); @Path("appearance") VisualAppearanceResource getVisualAppearanceResource(); @Path("interfacedefinitions") InterfaceDefinitionsResource InterfaceDefinitionsResource(); @GET @Path("artifacts/") @Produces(MediaType.APPLICATION_JSON) List<TArtifact> getArtifacts(); @POST @Path("artifacts/") @Consumes(MediaType.APPLICATION_JSON) Response addArtifact(TArtifact artifact); @DELETE @Path("artifacts/f/{name}") @Consumes(MediaType.APPLICATION_JSON) Response deleteArtifact(@PathParam("name") String name); @Path("artifacts/{name}") GenericFileResource uploadArtifact(@PathParam("name") String name);  }
@Test public void baobabInitialExistsUsingResource() throws Exception { this.setRevisionTo("5b5ad1106a3a428020b6bc5d2f154841acb5f779"); NodeTypeResource nodeTypeResource = (NodeTypeResource) NodeTypesResource.getComponentInstanceResource(TestIds.ID_FRUIT_BAOBAB); String testXml = BackendUtils.getXMLAsString(nodeTypeResource.getNodeType()); String controlXml = readFromClasspath("entitytypes/nodetypes/baobab_initial.xml"); org.hamcrest.MatcherAssert.assertThat(testXml, CompareMatcher.isIdenticalTo(controlXml).ignoreWhitespace()); }