use of com.buschmais.jqassistant.plugin.java.test.set.scanner.serviceloader.Service in project jqa-java-plugin by buschmais.
the class ServiceLoaderIT method verifyServiceLoaderDescriptor.
/**
* Verifies the expected service loader descriptor and its content.
*/
private void verifyServiceLoaderDescriptor() {
store.beginTransaction();
List<ServiceLoaderDescriptor> serviceLoaderDescriptors = query("MATCH (sd:ServiceLoader:File) RETURN sd").getColumn("sd");
assertThat(serviceLoaderDescriptors.size(), equalTo(1));
ServiceLoaderDescriptor serviceLoaderDescriptor = serviceLoaderDescriptors.get(0);
assertThat(serviceLoaderDescriptor.getFileName(), endsWith("/META-INF/services/" + Service.class.getName()));
assertThat(serviceLoaderDescriptor.getType(), typeDescriptor(Service.class));
List<TypeDescriptor> serviceTypes = serviceLoaderDescriptor.getContains();
assertThat(serviceTypes.size(), equalTo(2));
assertThat(serviceTypes, hasItem(typeDescriptor(ServiceImpl.class)));
assertThat(serviceTypes, hasItem(typeDescriptor(OuterClass.InnerClassServiceImpl.class)));
store.commitTransaction();
}
Aggregations