StringSource<ImportDef> source = new StringSource<>(descriptor, String.format(
"<%s library='%s' property='p'/>", ImportDefHandler.TAG, expectedLibrary), "myID", Format.XML);
Mockito.doReturn(parentDescriptor).when(parentHandler).getDefDescriptor();
ImportDefHandler handler = new ImportDefHandler(parentHandler, getReader(source), source);
ImportDefImpl def = handler.getElement();
DefDescriptor<LibraryDef> expectedDescriptor = DefDescriptorImpl.getInstance(expectedLibrary, LibraryDef.class);
assertEquals(expectedDescriptor, def.getDescriptor());
assertEquals(expectedDescriptor, def.getLibraryDescriptor());
}