use of org.uberfire.backend.vfs.impl.LockInfo in project kie-wb-common by kiegroup.
the class MetadataWidgetTest method lockStatusTextLockedByOtherUser.
@Test
public void lockStatusTextLockedByOtherUser() {
final String lockedBy = "Michael";
final String expected = MetadataConstants.INSTANCE.LockedByHint() + " " + lockedBy;
final String lockStatusText = metadataWidget.getLockStatusText(new LockInfo(true, lockedBy, null));
assertEquals("Lock status text incorrect", expected, lockStatusText);
}
use of org.uberfire.backend.vfs.impl.LockInfo 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.uberfire.backend.vfs.impl.LockInfo in project kie-wb-common by kiegroup.
the class MetadataWidgetTest method lockStatusTextNotLocked.
@Test
public void lockStatusTextNotLocked() {
final String expected = MetadataConstants.INSTANCE.UnlockedHint();
final String lockStatusText = metadataWidget.getLockStatusText(new LockInfo(false, "", null));
assertEquals("Lock status text incorrect", expected, lockStatusText);
}
use of org.uberfire.backend.vfs.impl.LockInfo in project kie-wb-common by kiegroup.
the class MetadataWidgetTest method lockStatusTextLockedByCurrentUser.
@Test
public void lockStatusTextLockedByCurrentUser() {
final String lockedBy = "Christian";
final String expected = MetadataConstants.INSTANCE.LockedByHintOwned();
final String lockStatusText = metadataWidget.getLockStatusText(new LockInfo(true, lockedBy, null));
assertEquals("Lock status text incorrect", expected, lockStatusText);
}
Aggregations