Fix thrown exceptions

This commit is contained in:
Sebastian Sdorra
2019-07-31 13:37:12 +02:00
parent 00fa943e51
commit f10b653a1d

View File

@@ -3,6 +3,7 @@ package sonia.scm.repository.spi;
import org.junit.Test; import org.junit.Test;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.IOException;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@@ -38,7 +39,7 @@ public class GitDiffCommandTest extends AbstractGitCommandTestBase {
"+f\n"; "+f\n";
@Test @Test
public void diffForOneRevisionShouldCreateDiff() { public void diffForOneRevisionShouldCreateDiff() throws IOException {
GitDiffCommand gitDiffCommand = new GitDiffCommand(createContext(), repository); GitDiffCommand gitDiffCommand = new GitDiffCommand(createContext(), repository);
DiffCommandRequest diffCommandRequest = new DiffCommandRequest(); DiffCommandRequest diffCommandRequest = new DiffCommandRequest();
diffCommandRequest.setRevision("3f76a12f08a6ba0dc988c68b7f0b2cd190efc3c4"); diffCommandRequest.setRevision("3f76a12f08a6ba0dc988c68b7f0b2cd190efc3c4");
@@ -48,7 +49,7 @@ public class GitDiffCommandTest extends AbstractGitCommandTestBase {
} }
@Test @Test
public void diffForOneBranchShouldCreateDiff() { public void diffForOneBranchShouldCreateDiff() throws IOException {
GitDiffCommand gitDiffCommand = new GitDiffCommand(createContext(), repository); GitDiffCommand gitDiffCommand = new GitDiffCommand(createContext(), repository);
DiffCommandRequest diffCommandRequest = new DiffCommandRequest(); DiffCommandRequest diffCommandRequest = new DiffCommandRequest();
diffCommandRequest.setRevision("test-branch"); diffCommandRequest.setRevision("test-branch");
@@ -58,7 +59,7 @@ public class GitDiffCommandTest extends AbstractGitCommandTestBase {
} }
@Test @Test
public void diffForPathShouldCreateLimitedDiff() { public void diffForPathShouldCreateLimitedDiff() throws IOException {
GitDiffCommand gitDiffCommand = new GitDiffCommand(createContext(), repository); GitDiffCommand gitDiffCommand = new GitDiffCommand(createContext(), repository);
DiffCommandRequest diffCommandRequest = new DiffCommandRequest(); DiffCommandRequest diffCommandRequest = new DiffCommandRequest();
diffCommandRequest.setRevision("test-branch"); diffCommandRequest.setRevision("test-branch");
@@ -69,7 +70,7 @@ public class GitDiffCommandTest extends AbstractGitCommandTestBase {
} }
@Test @Test
public void diffBetweenTwoBranchesShouldCreateDiff() { public void diffBetweenTwoBranchesShouldCreateDiff() throws IOException {
GitDiffCommand gitDiffCommand = new GitDiffCommand(createContext(), repository); GitDiffCommand gitDiffCommand = new GitDiffCommand(createContext(), repository);
DiffCommandRequest diffCommandRequest = new DiffCommandRequest(); DiffCommandRequest diffCommandRequest = new DiffCommandRequest();
diffCommandRequest.setRevision("master"); diffCommandRequest.setRevision("master");
@@ -80,7 +81,7 @@ public class GitDiffCommandTest extends AbstractGitCommandTestBase {
} }
@Test @Test
public void diffBetweenTwoBranchesForPathShouldCreateLimitedDiff() { public void diffBetweenTwoBranchesForPathShouldCreateLimitedDiff() throws IOException {
GitDiffCommand gitDiffCommand = new GitDiffCommand(createContext(), repository); GitDiffCommand gitDiffCommand = new GitDiffCommand(createContext(), repository);
DiffCommandRequest diffCommandRequest = new DiffCommandRequest(); DiffCommandRequest diffCommandRequest = new DiffCommandRequest();
diffCommandRequest.setRevision("master"); diffCommandRequest.setRevision("master");