use of org.kie.workbench.common.screens.library.client.settings.SettingsPresenter.Section in project kie-wb-common by kiegroup.
the class SettingsPresenterTest method testSave.
@Test
public void testSave() {
WorkspaceProject project = mock(WorkspaceProject.class);
doReturn(project).when(projectScreenService).save(any(), any(), any(), any());
final Section section1 = newMockedSection();
final Section section2 = newMockedSection();
doReturn(promises.resolve()).when(settingsPresenter).resetDirtyIndicator(eq(section1));
doReturn(promises.resolve()).when(settingsPresenter).resetDirtyIndicator(eq(section2));
settingsPresenter.sections = new ArrayList<>(Arrays.asList(section1, section2));
settingsPresenter.save("Test comment");
verify(section1).save(eq("Test comment"), any());
verify(section2).save(eq("Test comment"), any());
verify(settingsPresenter).saveProjectScreenModel(eq("Test comment"), eq(DeploymentMode.VALIDATED), any());
verify(settingsPresenter).resetDirtyIndicator(eq(section1));
verify(settingsPresenter).resetDirtyIndicator(eq(section2));
verify(settingsPresenter).displaySuccessMessage();
}
Aggregations