use of com.thoughtworks.go.server.service.BackupService in project gocd by gocd.
the class BackupFilterTest method setUp.
@Before
public void setUp() throws ServletException, IOException {
ServletHelper.init();
res = mock(HttpServletResponse.class);
backupService = mock(BackupService.class);
chain = mock(FilterChain.class);
filterConfig = mock(FilterConfig.class);
inputStream = BackupFilter.class.getClassLoader().getResourceAsStream("backup_in_progress.html");
output = new ByteArrayOutputStream();
writer = mock(PrintWriter.class);
when(res.getWriter()).thenReturn(writer);
this.backupFilter = new BackupFilter(backupService);
backupFilter.init(filterConfig);
}
use of com.thoughtworks.go.server.service.BackupService in project gocd by gocd.
the class ApiSessionFilterIntegrationTest method setUp.
@Before
public void setUp() throws Exception {
WebApplicationContext wac = mock(WebApplicationContext.class);
when(wac.getBean("filterChainProxy", javax.servlet.Filter.class)).thenReturn(filterChainProxy);
when(wac.getBean("backupService")).thenReturn(mock(BackupService.class));
filterChainProxy.init(new MockFilterConfig());
servletContext = new MockServletContext();
servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, wac);
proxy = new DelegatingFilterProxy("filterChainProxy", wac);
proxy.setServletContext(servletContext);
}
Aggregations