Package: RestAPIInternalImpl

RestAPIInternalImpl

nameinstructionbranchcomplexitylinemethod
RestAPIInternalImpl(String, String, String)
M: 62 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 13 C: 0
0%
M: 1 C: 0
0%
retrieveRevokedList()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: package org.wso2.am.integration.test;
2:
3: import org.wso2.am.integration.clients.internal.ApiClient;
4: import org.wso2.am.integration.clients.internal.ApiException;
5: import org.wso2.am.integration.clients.internal.api.RevokeJwt_Api;
6: import org.wso2.am.integration.clients.internal.api.dto.RevokedJWTListDTO;
7:
8: import javax.xml.bind.DatatypeConverter;
9: import java.nio.charset.StandardCharsets;
10: import java.util.List;
11:
12: public class RestAPIInternalImpl {
13: RevokeJwt_Api revokedListAPI = new RevokeJwt_Api();
14:
15: public RestAPIInternalImpl(String username, String password, String tenantDomain) {
16: ApiClient apiClient = new ApiClient();
17: String basicEncoded =
18: DatatypeConverter.printBase64Binary((username + ':' + password).getBytes(StandardCharsets.UTF_8));
19: apiClient.addDefaultHeader("Authorization", "Basic " + basicEncoded);
20: apiClient.setDebugging(true);
21: apiClient.setBasePath("https://localhost:9943/internal/data/v1");
22: apiClient.setReadTimeout(600000);
23: apiClient.setConnectTimeout(600000);
24: apiClient.setWriteTimeout(600000);
25: revokedListAPI.setApiClient(apiClient);
26: }
27:
28: public RevokedJWTListDTO retrieveRevokedList() throws ApiException {
29: return revokedListAPI.revokedjwtGet();
30:
31: }
32: }