use of org.drools.workbench.screens.guided.dtable.client.wizard.NewGuidedDecisionTableWizardHelper in project drools-wb by kiegroup.
the class NewGuidedDecisionTableHandlerTest method setup.
@Before
public void setup() {
serviceCaller = new CallerMock<>(service);
helper = new NewGuidedDecisionTableWizardHelper(serviceCaller, oracleFactory, beanManager);
final NewGuidedDecisionTableHandler wrapped = new NewGuidedDecisionTableHandler(placeManager, serviceCaller, resourceType, options, busyIndicatorView, helper) {
{
this.notificationEvent = mockNotificationEvent;
this.newResourceSuccessEvent = newResourceSuccessEventMock;
}
};
handler = spy(wrapped);
when(beanManager.lookupBean(eq(NewGuidedDecisionTableWizard.class))).thenReturn(wizardBeanDef);
when(wizardBeanDef.getInstance()).thenReturn(wizardBean);
when(service.create(any(Path.class), any(String.class), any(GuidedDecisionTable52.class), any(String.class))).<Path>thenAnswer((invocation) -> {
final Path path = ((Path) invocation.getArguments()[0]);
final String fileName = ((String) invocation.getArguments()[1]);
final Path newPath = PathFactory.newPath(fileName, path.toURI() + "/" + fileName);
return newPath;
});
}
Aggregations