use of org.guvnor.common.services.shared.metadata.model.Metadata in project kie-wb-common by kiegroup.
the class DiscussionWidgetPresenterTest method testInit.
@Test
public void testInit() throws Exception {
Metadata metadata = new Metadata();
metadata.getDiscussion().add(new DiscussionRecord(1234, "Toni", "Knock Knock"));
metadata.getDiscussion().add(new DiscussionRecord(1235, "Michael", "Who is there?"));
metadata.getDiscussion().add(new DiscussionRecord(1236, "Toni", "Can't think of anything funny :("));
DiscussionWidgetPresenter presenter = new DiscussionWidgetPresenter(view, identity, appConfigService);
presenter.setContent(metadata);
ArgumentCaptor<DiscussionRecord> discussionRecordArgumentCaptor = ArgumentCaptor.forClass(DiscussionRecord.class);
verify(view, times(3)).addRow(discussionRecordArgumentCaptor.capture());
assertComment(discussionRecordArgumentCaptor.getAllValues().get(0), 1234, "Toni", "Knock Knock");
assertComment(discussionRecordArgumentCaptor.getAllValues().get(1), 1235, "Michael", "Who is there?");
assertComment(discussionRecordArgumentCaptor.getAllValues().get(2), 1236, "Toni", "Can't think of anything funny :(");
}
use of org.guvnor.common.services.shared.metadata.model.Metadata in project kie-wb-common by kiegroup.
the class OverviewWidgetPresenterTest method testLockChangeDoesNotReloadAllMetadata.
@Test
public void testLockChangeDoesNotReloadAllMetadata() {
final Path testPath = PathFactory.newPath("test", "uri");
final Metadata metadata = mock(Metadata.class);
when(metadata.getPath()).thenReturn(testPath);
overview.setMetadata(metadata);
editor.setContent(overview, mock(ObservablePath.class));
verify(view, times(1)).setMetadata(any(Metadata.class), any(boolean.class));
// Verify that we only update the lock status but leave the rest of the metadata unchanged
final LockInfo lockInfo = new LockInfo(true, "christian", testPath);
editor.onLockChange(lockInfo);
verify(view, times(1)).setLockStatus(lockInfo);
verify(view, times(1)).setMetadata(any(Metadata.class), any(boolean.class));
}
use of org.guvnor.common.services.shared.metadata.model.Metadata in project kie-wb-common by kiegroup.
the class ProjectImportsServiceImplTest method testSaveAndRename.
@Test
public void testSaveAndRename() {
final Path path = mock(Path.class);
final String newName = "newName";
final Metadata metadata = mock(Metadata.class);
final ProjectImports content = mock(ProjectImports.class);
final String comment = "comment";
projectImportsService.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 PackageNameWhiteListServiceImplTest method testSave.
@Test
public void testSave() throws Exception {
final PackageNameWhiteListService service = makeService("");
final Path path = mock(Path.class);
final WhiteList whiteList = new WhiteList();
final Metadata metadata = new Metadata();
final String comment = "comment";
service.save(path, whiteList, metadata, comment);
verify(saver).save(path, whiteList, metadata, comment);
}
use of org.guvnor.common.services.shared.metadata.model.Metadata in project drools-wb by kiegroup.
the class WorkItemsEditorServiceImpl method save.
@Override
public Path save(final Path resource, final String content, final Metadata metadata, final String comment) {
try {
Metadata currentMetadata = metadataService.getMetadata(resource);
ioService.write(Paths.convert(resource), content, metadataService.setUpAttributes(resource, metadata), commentedOptionFactory.makeCommentedOption(comment));
fireMetadataSocialEvents(resource, currentMetadata, metadata);
return resource;
} catch (Exception e) {
throw ExceptionUtilities.handleException(e);
}
}
Aggregations