use of org.uberfire.mocks.CallerMock in project kie-wb-common by kiegroup.
the class ContainerConfigPresenterTest method setUp.
@Before
public void setUp() {
when(artifactSelector.getView()).thenReturn(artifactSelectorView);
m2RepoServiceCaller = spy(new CallerMock<>(m2RepoService));
provisioningValidationServiceCaller = new CallerMock<>(provisioningValidationService);
provisioningClientValidationService = new ProvisioningClientValidationService(provisioningValidationServiceCaller);
presenter = spy(new ContainerConfigPresenter(view, artifactSelector, translationService, popupHelper, m2RepoServiceCaller, provisioningClientValidationService));
presenter.init();
verify(view, times(1)).init(presenter);
verify(artifactSelector, times(1)).setArtifactSelectHandler(any());
verify(view, times(1)).setArtifactSelectorPresenter(artifactSelectorView);
}
use of org.uberfire.mocks.CallerMock in project kie-wb-common by kiegroup.
the class TemplateParamsFormPresenterTest method setUp.
@Before
public void setUp() {
when(popupHelper.getPopupErrorCallback()).thenReturn(errorCallback);
exceptionCaptor = ArgumentCaptor.forClass(Throwable.class);
initializeParams();
when(templateDescriptorModel.getParams()).thenReturn(allTemplateParams);
when(paramsEditorPresenter.getView()).thenReturn(paramsEditorPresenterView);
openshiftClientServiceCaller = spy(new CallerMock<>(openShiftClientService));
openShiftClientValidationService = new OpenShiftClientValidationService(openshiftClientServiceCaller);
presenter = spy(new TemplateParamsFormPresenter(view, paramsEditorPresenter, translationService, popupHelper, openshiftClientServiceCaller, openShiftClientValidationService));
presenter.init();
verify(view, times(1)).init(presenter);
verify(view, times(1)).setParamsEditorPresenter(paramsEditorPresenterView);
verify(paramsEditorPresenter, times(1)).setParamChangeHandler(any());
}
use of org.uberfire.mocks.CallerMock in project kie-wb-common by kiegroup.
the class ActiveOptionsInitParamTest method testParametersInPlaceRequest.
@Test
public void testParametersInPlaceRequest() throws Exception {
options = new ActiveContextOptions(new CallerMock<ExplorerService>(mock(ExplorerService.class)), changedEvent);
PlaceRequest placeRequest = mock(PlaceRequest.class);
when(placeRequest.getParameter("mode", "")).thenReturn(mode);
options.init(placeRequest, mock(Command.class));
assertTrue(options.getOptions().contains(option1));
assertTrue(options.getOptions().contains(option2));
}
use of org.uberfire.mocks.CallerMock in project kie-wb-common by kiegroup.
the class AbstractExecutorTest method setup.
public void setup() {
specManagementService = new CallerMock<>(specManagementServiceMock);
buildService = spy(new CallerMock<>(buildServiceMock));
final POM pom = new POM(new GAV(GROUP, ARTIFACT, VERSION));
when(buildServiceMock.build(any(KieModule.class))).thenReturn(new BuildResults());
when(buildServiceMock.buildAndDeploy(any(KieModule.class), any(DeploymentMode.class))).thenReturn(new BuildResults());
when(repository.getAlias()).thenReturn("repository");
when(module.getModuleName()).thenReturn("module");
when(module.getPomXMLPath()).thenReturn(pomPath);
when(module.getPom()).thenReturn(pom);
when(module.getRootPath()).thenReturn(mock(Path.class));
when(pomPath.getFileName()).thenReturn("pom.xml");
}
use of org.uberfire.mocks.CallerMock in project kie-wb-common by kiegroup.
the class AdvancedAnnotationListEditorTest method setup.
@Before
public void setup() {
yesCommandCaptor = ArgumentCaptor.forClass(Command.class);
noCommandCaptor = ArgumentCaptor.forClass(Command.class);
cancelCommandCaptor = ArgumentCaptor.forClass(Command.class);
annotationCallbackCaptor = (ArgumentCaptor) ArgumentCaptor.forClass(Callback.class);
Annotation annotation;
AnnotationSource annotationSource;
for (int i = 0; i < MAX_ITEMS; i++) {
annotation = mock(Annotation.class);
when(annotation.getClassName()).thenReturn("AnnotationClass" + i);
annotations.add(annotation);
annotationSource = mock(AnnotationSource.class);
annotationSourcesMap.put(annotation.getClassName(), annotationSource);
}
setupItemInstances();
annotationListEditor = new AdvancedAnnotationListEditor(view, new CallerMock(dataModelerService), valuePairEditorInstance, itemInstance) {
@Override
protected AnnotationListItem createListItem() {
if (listItemsCount >= itemInstances.size()) {
throw new RuntimeException("too many invocations");
} else {
super.createListItem();
return itemInstances.get(listItemsCount++);
}
}
@Override
protected ValuePairEditorPopup createValuePairEditor() {
super.createValuePairEditor();
return valuePairEditor;
}
};
annotationListEditor.addAddAnnotationHandler(addAnnotationHandler);
annotationListEditor.addDeleteAnnotationHandler(deleteAnnotationHandler);
annotationListEditor.addValuePairChangeHandler(valuePairChangeHandler);
annotationListEditor.addClearValuePairHandler(clearValuePairHandler);
}
Aggregations