use of org.kie.workbench.common.screens.projectimportsscreen.type.ProjectImportsResourceTypeDefinition in project kie-wb-common by kiegroup.
the class ResourceHandlerManagerTest method testResourceHandlers.
@Test
public void testResourceHandlers() {
NewResourceHandler rh1 = mock(NewResourceHandler.class);
NewResourceHandler rh2 = mock(NewResourceHandler.class);
when(rh1.getResourceType()).thenReturn(new JavaResourceTypeDefinition(new Model()));
when(rh2.getResourceType()).thenReturn(new ProjectImportsResourceTypeDefinition(new Others()));
doReturn(Arrays.asList(rh1, rh2)).when(this.resourceHandlerManager).getNewResourceHandlers();
List<NewResourceHandler> handlers = this.resourceHandlerManager.getNewResourceHandlers(resourceHandler -> resourceHandler.getResourceType().getCategory().equals(new Model()));
assertTrue(handlers.size() == 1);
assertEquals(rh1, handlers.get(0));
}
Aggregations