use of org.kie.workbench.common.screens.javaeditor.type.JavaResourceTypeDefinition in project kie-wb-common by kiegroup.
the class NewAssetHandlerCardWidgetTest method setUp.
@Before
public void setUp() {
this.widget = new NewAssetHandlerCardWidget(this.view, this.newResourcePresenter, this.ts);
when(ts.getTranslation(eq(new Model().getName()))).thenReturn(MODEL);
when(newResourceHandler.getResourceType()).thenReturn(new JavaResourceTypeDefinition(new Model()));
when(newResourceHandler.getDescription()).thenReturn(TITLE);
}
use of org.kie.workbench.common.screens.javaeditor.type.JavaResourceTypeDefinition 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