| CommonsHttpClientTrustedRequest | Line # 9 | 4 | 3 | 100% |
1.0
|
| (2) | |||
| Result | |||
|
0.5
|
com.atlassian.security.auth.trustedapps.request.commonshttpclient.TestCommonsHttpClientTrustedRequest.testCannotCreateWithNullHttpMethod
com.atlassian.security.auth.trustedapps.request.commonshttpclient.TestCommonsHttpClientTrustedRequest.testCannotCreateWithNullHttpMethod
|
1 PASS | |
|
0.25
|
com.atlassian.security.auth.trustedapps.request.commonshttpclient.TestCommonsHttpClientTrustedRequest.testAddRequestParameter
com.atlassian.security.auth.trustedapps.request.commonshttpclient.TestCommonsHttpClientTrustedRequest.testAddRequestParameter
|
1 PASS | |
| 1 | package com.atlassian.security.auth.trustedapps.request.commonshttpclient; | |
| 2 | ||
| 3 | import com.atlassian.security.auth.trustedapps.request.TrustedRequest; | |
| 4 | import org.apache.commons.httpclient.HttpMethod; | |
| 5 | ||
| 6 | /** | |
| 7 | * Commons Http Client implementation of {@link TrustedRequest} | |
| 8 | */ | |
| 9 | public class CommonsHttpClientTrustedRequest implements TrustedRequest | |
| 10 | { | |
| 11 | private final HttpMethod httpMethod; | |
| 12 | ||
| 13 | 3 |
public CommonsHttpClientTrustedRequest(final HttpMethod httpMethod) |
| 14 | { | |
| 15 | 3 | if (httpMethod == null) |
| 16 | { | |
| 17 | 1 | throw new IllegalArgumentException("HttpMethod must not be null!"); |
| 18 | } | |
| 19 | 2 | this.httpMethod = httpMethod; |
| 20 | } | |
| 21 | ||
| 22 | 1 |
public void addRequestParameter(String name, String value) |
| 23 | { | |
| 24 | 1 | httpMethod.addRequestHeader(name, value); |
| 25 | } | |
| 26 | } | |
|
||||||||||