@Test
public void testGetByNodeTypes() {

    ServiceResource serviceResource = new ServiceResource();
    serviceResource.setId("service1");
    serviceResource.setNodeInstance(new NodeInstance());
    serviceResource.getNodeInstance().setTypeVersion("1.0.0-SNAPSHOT");
    serviceResource.getNodeInstance().setNodeTemplate(new NodeTemplate());
    serviceResource.getNodeInstance().getNodeTemplate().setType("org.alien4cloud.nodes.MyType");
    alienDao.save(serviceResource);
    ServiceResource[] services = serviceResourceService.getByNodeTypes("org.alien4cloud.nodes.MyType", "1.0.0-SNAPSHOT");
    Assert.assertNotNull(services);
    Assert.assertEquals(1, services.length);
    services = serviceResourceService.getByNodeTypes("org.alien4cloud.nodes.UnusedType", "1.0.0-SNAPSHOT");
    Assert.assertNotNull(services);
    Assert.assertEquals(0, services.length);
    services = serviceResourceService.getByNodeTypes("org.alien4cloud.nodes.MyType", "1.0.0");
    Assert.assertNotNull(services);
    Assert.assertEquals(0, services.length);
}