Search in sources :

Example 1 with StatService

use of org.gluu.oxauth.client.service.StatService in project oxAuth by GluuFederation.

the class StatWSTest method statPost.

@Test(enabled = false)
@Parameters({ "umaPatClientId", "umaPatClientSecret" })
public void statPost(final String umaPatClientId, final String umaPatClientSecret) throws Exception {
    final Token authorization = UmaClient.requestPat(tokenEndpoint, umaPatClientId, umaPatClientSecret);
    final StatService service = ClientFactory.instance().createStatService(issuer + "/oxauth/restv1/internal/stat");
    final JsonNode node = service.statPost(authorization.getAccessToken(), "202101", null);
    assertTrue(node != null && node.hasNonNull("response"));
}
Also used : Token(org.gluu.oxauth.model.uma.wrapper.Token) JsonNode(com.fasterxml.jackson.databind.JsonNode) StatService(org.gluu.oxauth.client.service.StatService) Parameters(org.testng.annotations.Parameters) BaseTest(org.gluu.oxauth.BaseTest) Test(org.testng.annotations.Test)

Example 2 with StatService

use of org.gluu.oxauth.client.service.StatService in project oxAuth by GluuFederation.

the class StatWSTest method stat.

@Test(enabled = false)
@Parameters({ "umaPatClientId", "umaPatClientSecret" })
public void stat(final String umaPatClientId, final String umaPatClientSecret) throws Exception {
    final Token authorization = UmaClient.requestPat(tokenEndpoint, umaPatClientId, umaPatClientSecret);
    final StatService service = ClientFactory.instance().createStatService(issuer + "/oxauth/restv1/internal/stat");
    final JsonNode node = service.stat("Bearer " + authorization.getAccessToken(), "202101", null);
    assertTrue(node != null && node.hasNonNull("response"));
}
Also used : Token(org.gluu.oxauth.model.uma.wrapper.Token) JsonNode(com.fasterxml.jackson.databind.JsonNode) StatService(org.gluu.oxauth.client.service.StatService) Parameters(org.testng.annotations.Parameters) BaseTest(org.gluu.oxauth.BaseTest) Test(org.testng.annotations.Test)

Aggregations

JsonNode (com.fasterxml.jackson.databind.JsonNode)2 BaseTest (org.gluu.oxauth.BaseTest)2 StatService (org.gluu.oxauth.client.service.StatService)2 Token (org.gluu.oxauth.model.uma.wrapper.Token)2 Parameters (org.testng.annotations.Parameters)2 Test (org.testng.annotations.Test)2