use of org.guvnor.common.services.shared.metadata.model.Metadata in project drools-wb by kiegroup.
the class GuidedScoreCardEditorServiceImplTest method testSaveAndRename.
@Test
public void testSaveAndRename() throws Exception {
final Path path = mock(Path.class);
final String newFileName = "newFileName";
final Metadata metadata = mock(Metadata.class);
final ScoreCardModel content = mock(ScoreCardModel.class);
final String comment = "comment";
service.saveAndRename(path, newFileName, metadata, content, comment);
verify(saveAndRenameService).saveAndRename(path, newFileName, metadata, content, comment);
}
use of org.guvnor.common.services.shared.metadata.model.Metadata in project kie-wb-common by kiegroup.
the class FormEditorServiceImplTest method testRename.
private void testRename(boolean saveBeforeRenaming) {
FormModelerContent content = mock(FormModelerContent.class);
doReturn(path).when(formEditorService).save(any(Path.class), any(FormModelerContent.class), any(Metadata.class), anyString());
doReturn(content).when(formEditorService).constructContent(any(Path.class), any(Overview.class));
when(content.getDefinition()).thenReturn(mock(FormDefinition.class));
Metadata metadata = mock(Metadata.class);
FormModelerContent resultContent = formEditorService.rename(path, NEW_FORM_NAME, COMMIT_COMMENT, saveBeforeRenaming, content, metadata);
assertSame(content, resultContent);
VerificationMode constructContentCalls = saveBeforeRenaming ? never() : times(1);
verify(formEditorService, constructContentCalls).constructContent(eq(path), any(Overview.class));
verify(formEditorService).save(eq(path), eq(content), eq(metadata), eq(COMMIT_COMMENT));
verify(renameService).rename(eq(path), eq(NEW_FORM_NAME), eq(COMMIT_COMMENT));
}
use of org.guvnor.common.services.shared.metadata.model.Metadata in project kie-wb-common by kiegroup.
the class DefaultEditorServiceImplTest method saveAndRename.
@Test
public void saveAndRename() throws Exception {
final Path path = mock(Path.class);
final Metadata metadata = mock(Metadata.class);
final String newName = "newName";
final String content = "content";
final String comment = "comment";
service.saveAndRename(path, newName, metadata, content, comment);
verify(saveAndRenameService).saveAndRename(path, newName, metadata, content, comment);
}
use of org.guvnor.common.services.shared.metadata.model.Metadata in project kie-wb-common by kiegroup.
the class PomEditorServiceImplTest method testSaveAndRename.
@Test
public void testSaveAndRename() {
final Path path = mock(Path.class);
final String newFileName = "newFileName";
final Metadata metadata = mock(Metadata.class);
final String content = "content";
final String comment = "comment";
service.saveAndRename(path, newFileName, metadata, content, comment);
verify(saveAndRenameService).saveAndRename(path, newFileName, metadata, content, comment);
}
use of org.guvnor.common.services.shared.metadata.model.Metadata in project kie-wb-common by kiegroup.
the class PomEditorServiceImplTest method testSave.
@Test
public void testSave() {
final Path path = mock(Path.class);
final String content = "content";
final Metadata metadata = mock(Metadata.class);
final String comment = "comment";
doReturn(path).when(service).save(path, content, metadata, comment, DeploymentMode.FORCED);
service.save(path, content, metadata, comment);
verify(service).save(path, content, metadata, comment, DeploymentMode.FORCED);
}
Aggregations