use of com.gitblit.GitBlitException in project gitblit by gitblit.
the class GroovyScriptTest method testBlockPush.
@Test
public void testBlockPush() throws Exception {
MockGitblit gitblit = new MockGitblit();
MockLogger logger = new MockLogger();
MockClientLogger clientLogger = new MockClientLogger();
List<ReceiveCommand> commands = new ArrayList<ReceiveCommand>();
commands.add(new ReceiveCommand(ObjectId.fromString("c18877690322dfc6ae3e37bb7f7085a24e94e887"), ObjectId.fromString("3fa7c46d11b11d61f1cbadc6888be5d0eae21969"), "refs/heads/master"));
RepositoryModel repository = new RepositoryModel("ex@mple.git", "", "admin", new Date());
try {
test("blockpush.groovy", gitblit, logger, clientLogger, commands, repository);
assertTrue("blockpush should have failed!", false);
} catch (GitBlitException e) {
assertTrue(e.getMessage().contains("failed"));
}
}
Aggregations