Search in sources :

Example 1 with M2RepoService

use of org.guvnor.m2repo.service.M2RepoService in project kie-wb-common by kiegroup.

the class NewContainerFormPresenterTest method init.

@Before
public void init() {
    contentChangeHandlers.clear();
    m2RepoServiceCaller = new CallerMock<M2RepoService>(m2RepoService);
    specManagementServiceCaller = new CallerMock<SpecManagementService>(specManagementService);
    doNothing().when(wizardPageStatusChangeEvent).fire(any(WizardPageStatusChangeEvent.class));
    doAnswer(new Answer() {

        @Override
        public Object answer(InvocationOnMock invocation) throws Throwable {
            final ContentChangeHandler handler = (ContentChangeHandler) invocation.getArguments()[0];
            contentChangeHandlers.add(handler);
            return null;
        }
    }).when(view).addContentChangeHandler(any(ContentChangeHandler.class));
    doAnswer(contentHandlerAnswer).when(view).setArtifactId(anyString());
    doAnswer(contentHandlerAnswer).when(view).setGroupId(anyString());
    doAnswer(contentHandlerAnswer).when(view).setVersion(anyString());
    presenter = spy(new NewContainerFormPresenter(logger, view, presenterProvider, m2RepoServiceCaller, specManagementServiceCaller, wizardPageStatusChangeEvent));
    doReturn(artifactListWidgetPresenter).when(presenterProvider).get();
}
Also used : Answer(org.mockito.stubbing.Answer) InvocationOnMock(org.mockito.invocation.InvocationOnMock) ContentChangeHandler(org.kie.workbench.common.screens.server.management.client.util.ContentChangeHandler) M2RepoService(org.guvnor.m2repo.service.M2RepoService) WizardPageStatusChangeEvent(org.uberfire.ext.widgets.core.client.wizards.WizardPageStatusChangeEvent) SpecManagementService(org.kie.workbench.common.screens.server.management.service.SpecManagementService) Before(org.junit.Before)

Aggregations

M2RepoService (org.guvnor.m2repo.service.M2RepoService)1 Before (org.junit.Before)1 ContentChangeHandler (org.kie.workbench.common.screens.server.management.client.util.ContentChangeHandler)1 SpecManagementService (org.kie.workbench.common.screens.server.management.service.SpecManagementService)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1 Answer (org.mockito.stubbing.Answer)1 WizardPageStatusChangeEvent (org.uberfire.ext.widgets.core.client.wizards.WizardPageStatusChangeEvent)1