| 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 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (10) |
Complexity: 4 |
Complexity Density: 0.67 |
|
| 9 |
|
public class MockTrustedApplicationsFilter extends TrustedApplicationsFilter |
| 10 |
|
{ |
| 11 |
|
private final MockCertificateServer certificateServer; |
| 12 |
|
private final MockAuthenticator mockAuthenticator; |
| 13 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 14 |
10
|
public MockTrustedApplicationsFilter()... |
| 15 |
|
{ |
| 16 |
10
|
this(new MockCertificateServer(), new MockAuthenticator()); |
| 17 |
|
} |
| 18 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 19 |
10
|
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 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 26 |
1
|
public MockCertificateServer getMockCertificateServer()... |
| 27 |
|
{ |
| 28 |
1
|
return certificateServer; |
| 29 |
|
} |
| 30 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 31 |
2
|
public MockAuthenticator getMockAuthenticator()... |
| 32 |
|
{ |
| 33 |
2
|
return mockAuthenticator; |
| 34 |
|
} |
| 35 |
|
|
|
|
|
| 50% |
Uncovered Elements: 2 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
| 36 |
|
private static class MockAuthenticationController implements AuthenticationController |
| 37 |
|
{ |
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 38 |
6
|
public boolean shouldAttemptAuthentication(HttpServletRequest request)... |
| 39 |
|
{ |
| 40 |
6
|
return true; |
| 41 |
|
} |
| 42 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 43 |
0
|
public boolean canLogin(Principal principal, HttpServletRequest request)... |
| 44 |
|
{ |
| 45 |
0
|
return true; |
| 46 |
|
} |
| 47 |
|
} |
| 48 |
|
|
|
|
|
| 25% |
Uncovered Elements: 3 (4) |
Complexity: 4 |
Complexity Density: - |
|
| 49 |
|
private static class MockAuthenticationListener implements AuthenticationListener |
| 50 |
|
{ |
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 51 |
2
|
public void authenticationSuccess(Authenticator.Result result, HttpServletRequest request, HttpServletResponse response)... |
| 52 |
|
{ |
| 53 |
|
} |
| 54 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 55 |
0
|
public void authenticationFailure(Authenticator.Result result, HttpServletRequest request, HttpServletResponse response)... |
| 56 |
|
{ |
| 57 |
|
} |
| 58 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 59 |
0
|
public void authenticationError(Authenticator.Result result, HttpServletRequest request, HttpServletResponse response)... |
| 60 |
|
{ |
| 61 |
|
} |
| 62 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 63 |
0
|
public void authenticationNotAttempted(HttpServletRequest request, HttpServletResponse response)... |
| 64 |
|
{ |
| 65 |
|
} |
| 66 |
|
} |
| 67 |
|
} |