mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 23:45:44 +01:00
Remove redundant constructor parameter
The repository can be retrieved from the context and does not have to be passed through by every constructor
This commit is contained in:
@@ -110,6 +110,6 @@ public class SvnBlameCommandTest extends AbstractSvnCommandTestBase
|
||||
*/
|
||||
private SvnBlameCommand createCommand()
|
||||
{
|
||||
return new SvnBlameCommand(createContext(), repository);
|
||||
return new SvnBlameCommand(createContext());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
package sonia.scm.repository.spi;
|
||||
|
||||
import org.junit.Test;
|
||||
@@ -268,7 +268,7 @@ public class SvnBrowseCommandTest extends AbstractSvnCommandTestBase
|
||||
*/
|
||||
private SvnBrowseCommand createCommand()
|
||||
{
|
||||
return new SvnBrowseCommand(createContext(), repository);
|
||||
return new SvnBrowseCommand(createContext());
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
package sonia.scm.repository.spi;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
@@ -57,8 +57,7 @@ public class SvnBundleCommandTest extends AbstractSvnCommandTestBase
|
||||
File file = temp.newFile();
|
||||
ByteSink sink = Files.asByteSink(file);
|
||||
BundleCommandRequest req = new BundleCommandRequest(sink);
|
||||
BundleResponse res = new SvnBundleCommand(createContext(),
|
||||
repository).bundle(req);
|
||||
BundleResponse res = new SvnBundleCommand(createContext()).bundle(req);
|
||||
|
||||
assertThat(res, notNullValue());
|
||||
assertThat(res.getChangesetCount(), is(5l));
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
package sonia.scm.repository.spi;
|
||||
|
||||
import org.hamcrest.BaseMatcher;
|
||||
@@ -111,7 +111,7 @@ public class SvnCatCommandTest extends AbstractSvnCommandTestBase {
|
||||
request.setPath("a.txt");
|
||||
request.setRevision("1");
|
||||
|
||||
InputStream catResultStream = new SvnCatCommand(createContext(), repository).getCatResultStream(request);
|
||||
InputStream catResultStream = new SvnCatCommand(createContext()).getCatResultStream(request);
|
||||
|
||||
assertEquals('a', catResultStream.read());
|
||||
assertEquals('\n', catResultStream.read());
|
||||
@@ -126,8 +126,7 @@ public class SvnCatCommandTest extends AbstractSvnCommandTestBase {
|
||||
|
||||
try
|
||||
{
|
||||
new SvnCatCommand(createContext(), repository).getCatResult(request,
|
||||
baos);
|
||||
new SvnCatCommand(createContext()).getCatResult(request, baos);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
package sonia.scm.repository.spi;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
@@ -136,7 +136,7 @@ public class SvnLogCommandTest extends AbstractSvnCommandTestBase
|
||||
checkDate(c.getDate());
|
||||
assertEquals("perfect", c.getAuthor().getName());
|
||||
assertNull("douglas.adams@hitchhiker.com", c.getAuthor().getMail());
|
||||
SvnModificationsCommand modificationsCommand = new SvnModificationsCommand(createContext(), repository);
|
||||
SvnModificationsCommand modificationsCommand = new SvnModificationsCommand(createContext());
|
||||
Modifications modifications = modificationsCommand.getModifications("3");
|
||||
|
||||
assertNotNull(modifications);
|
||||
@@ -177,6 +177,6 @@ public class SvnLogCommandTest extends AbstractSvnCommandTestBase
|
||||
*/
|
||||
private SvnLogCommand createCommand()
|
||||
{
|
||||
return new SvnLogCommand(createContext(), repository);
|
||||
return new SvnLogCommand(createContext());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
package sonia.scm.repository.spi;
|
||||
|
||||
import org.apache.shiro.subject.Subject;
|
||||
@@ -57,7 +57,7 @@ public class SvnModifyCommandTest extends AbstractSvnCommandTestBase {
|
||||
public void initSvnModifyCommand() {
|
||||
context = createContext();
|
||||
workDirFactory = new SimpleSvnWorkDirFactory(new WorkdirProvider(context.getDirectory()));
|
||||
svnModifyCommand = new SvnModifyCommand(context, createRepository(), workDirFactory);
|
||||
svnModifyCommand = new SvnModifyCommand(context, workDirFactory);
|
||||
}
|
||||
|
||||
@Before
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
package sonia.scm.repository.spi;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
@@ -57,13 +57,8 @@ public class SvnUnbundleCommandTest extends AbstractSvnCommandTestBase
|
||||
File bundle = bundle();
|
||||
SvnContext ctx = createEmptyContext();
|
||||
//J-
|
||||
UnbundleResponse res = new SvnUnbundleCommand(
|
||||
ctx,
|
||||
repository
|
||||
).unbundle(
|
||||
new UnbundleCommandRequest(
|
||||
Files.asByteSource(bundle)
|
||||
)
|
||||
UnbundleResponse res = new SvnUnbundleCommand(ctx)
|
||||
.unbundle(new UnbundleCommandRequest(Files.asByteSource(bundle))
|
||||
);
|
||||
//J+
|
||||
|
||||
@@ -81,13 +76,8 @@ public class SvnUnbundleCommandTest extends AbstractSvnCommandTestBase
|
||||
File file = tempFolder.newFile();
|
||||
|
||||
//J-
|
||||
new SvnBundleCommand(
|
||||
createContext(),
|
||||
repository
|
||||
).bundle(
|
||||
new BundleCommandRequest(
|
||||
Files.asByteSink(file)
|
||||
)
|
||||
new SvnBundleCommand(createContext())
|
||||
.bundle(new BundleCommandRequest(Files.asByteSink(file))
|
||||
);
|
||||
//J+
|
||||
|
||||
|
||||
Reference in New Issue
Block a user