Clover Coverage Report - Atlassian Trusted Apps(Aggregated)
Coverage timestamp: Tue Jun 9 2009 19:34:44 CDT
8   67   10   0.8
0   53   1.25   3.33
10     1  
3    
 
 
  MockTrustedApplicationsFilter       Line # 9 6 4 100% 1.0
  MockTrustedApplicationsFilter.MockAuthenticationController       Line # 36 2 2 50% 0.5
  MockTrustedApplicationsFilter.MockAuthenticationListener       Line # 49 0 4 25% 0.25
 
  (10)
 
1    package com.atlassian.security.auth.trustedapps.filter;
2   
3    import javax.servlet.http.HttpServletRequest;
4    import javax.servlet.http.HttpServletResponse;
5    import java.security.Principal;
6   
7    /**
8    */
 
9    public class MockTrustedApplicationsFilter extends TrustedApplicationsFilter
10    {
11    private final MockCertificateServer certificateServer;
12    private final MockAuthenticator mockAuthenticator;
13   
 
14  10 toggle public MockTrustedApplicationsFilter()
15    {
16  10 this(new MockCertificateServer(), new MockAuthenticator());
17    }
18   
 
19  10 toggle private MockTrustedApplicationsFilter(MockCertificateServer certificateServer, MockAuthenticator mockAuthenticator)
20    {
21  10 super(certificateServer, mockAuthenticator, new MockAuthenticationController(), new MockAuthenticationListener());
22  10 this.certificateServer = certificateServer;
23  10 this.mockAuthenticator = mockAuthenticator;
24    }
25   
 
26  1 toggle public MockCertificateServer getMockCertificateServer()
27    {
28  1 return certificateServer;
29    }
30   
 
31  2 toggle public MockAuthenticator getMockAuthenticator()
32    {
33  2 return mockAuthenticator;
34    }
35   
 
36    private static class MockAuthenticationController implements AuthenticationController
37    {
 
38  6 toggle public boolean shouldAttemptAuthentication(HttpServletRequest request)
39    {
40  6 return true;
41    }
42   
 
43  0 toggle public boolean canLogin(Principal principal, HttpServletRequest request)
44    {
45  0 return true;
46    }
47    }
48   
 
49    private static class MockAuthenticationListener implements AuthenticationListener
50    {
 
51  2 toggle public void authenticationSuccess(Authenticator.Result result, HttpServletRequest request, HttpServletResponse response)
52    {
53    }
54   
 
55  0 toggle public void authenticationFailure(Authenticator.Result result, HttpServletRequest request, HttpServletResponse response)
56    {
57    }
58   
 
59  0 toggle public void authenticationError(Authenticator.Result result, HttpServletRequest request, HttpServletResponse response)
60    {
61    }
62   
 
63  0 toggle public void authenticationNotAttempted(HttpServletRequest request, HttpServletResponse response)
64    {
65    }
66    }
67    }