use of jetbrains.buildServer.controllers.AuthorizationInterceptor in project teamcity-torrent-plugin by JetBrains.
the class TrackerControllerTest method createController.
@Override
@SuppressWarnings("unchecked")
protected TrackerController createController() throws IOException {
Mockery m = new Mockery();
final XmlRpcHandlerManager rpcHandlerManager = m.mock(XmlRpcHandlerManager.class);
final AddressChecker addressChecker = m.mock(AddressChecker.class);
AuthorizationInterceptor interceptor = m.mock(AuthorizationInterceptor.class);
m.checking(new Expectations() {
{
allowing(rpcHandlerManager).addHandler(with(any(String.class)), with(any(Object.class)));
allowing(interceptor).addPathNotRequiringAuth(with(any(String.class)));
allowing(addressChecker).isBadAddress(with(any(String.class)));
will(returnValue(false));
}
});
final TorrentConfigurator configurator = new TorrentConfigurator(new ServerPaths(createTempDir().getAbsolutePath()), myFixture.getSingletonService(RootUrlHolder.class), rpcHandlerManager);
myTorrentTrackerManager = new TorrentTrackerManager(configurator, myFixture.getSingletonService(ExecutorServices.class), myFixture.getSingletonService(EventDispatcher.class), addressChecker);
myTorrentTrackerManager.startTracker();
return new TrackerController(myWebManager, myTorrentTrackerManager, interceptor);
}
Aggregations