mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 06:55:47 +01:00
add Test / HgBrowseCommand shouldResolveBranchForRevision
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
|
||||
package sonia.scm.repository.spi;
|
||||
|
||||
import com.aragost.javahg.commands.LogCommand;
|
||||
import org.junit.Test;
|
||||
import sonia.scm.repository.BrowserResult;
|
||||
import sonia.scm.repository.FileObject;
|
||||
@@ -40,6 +41,7 @@ import sonia.scm.repository.FileObject;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
@@ -79,6 +81,19 @@ public class HgBrowseCommandTest extends AbstractHgCommandTestBase {
|
||||
assertEquals("c", c.getPath());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBrowseShouldResolveBranchForRevision() throws IOException {
|
||||
String defaultBranchRevision = new LogCommand(cmdContext.open()).rev("default").single().getNode();
|
||||
|
||||
BrowseCommandRequest browseCommandRequest = new BrowseCommandRequest();
|
||||
browseCommandRequest.setRevision("default");
|
||||
|
||||
BrowserResult result = new HgBrowseCommand(cmdContext,
|
||||
repository).getBrowserResult(browseCommandRequest);
|
||||
|
||||
assertThat(result.getRevision()).isEqualTo(defaultBranchRevision);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBrowseSubDirectory() throws IOException {
|
||||
BrowseCommandRequest request = new BrowseCommandRequest();
|
||||
|
||||
Reference in New Issue
Block a user