Search in sources :

Example 1 with TokenUtils

use of org.bf2.admin.kafka.systemtest.utils.TokenUtils in project kafka-admin-api by bf2fc6cc711aee1a0c2a.

the class AccessControlListIT method setup.

@BeforeEach
void setup() {
    validResourceOperations = config.getValue(KafkaAdminConfigRetriever.ACL_RESOURCE_OPERATIONS, String.class);
    tokenUtils = new TokenUtils(config);
}
Also used : TokenUtils(org.bf2.admin.kafka.systemtest.utils.TokenUtils) JsonString(javax.json.JsonString) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with TokenUtils

use of org.bf2.admin.kafka.systemtest.utils.TokenUtils in project kafka-admin-api by bf2fc6cc711aee1a0c2a.

the class ConsumerGroupsOAuthTestIT method initialize.

@BeforeAll
static void initialize() {
    tokenUtils = new TokenUtils(ConfigProvider.getConfig());
    JsonObject token = tokenUtils.getTokenObject(UserType.OWNER.getUsername());
    // Fetch one token before the tests begin to minimize wait time in expired token test
    initialToken = token.getString("access_token");
    initialTokenExpiresAt = System.currentTimeMillis() + (token.getInt("expires_in") * 1000);
}
Also used : TokenUtils(org.bf2.admin.kafka.systemtest.utils.TokenUtils) JsonObject(javax.json.JsonObject) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 3 with TokenUtils

use of org.bf2.admin.kafka.systemtest.utils.TokenUtils in project kafka-admin-api by bf2fc6cc711aee1a0c2a.

the class PartitionsOffsetOauthIT method setup.

@BeforeEach
void setup() {
    tokenUtils = new TokenUtils(config);
    consumerUtils = new ConsumerUtils(config, tokenUtils.getToken(UserType.OWNER.getUsername()));
}
Also used : ConsumerUtils(org.bf2.admin.kafka.systemtest.utils.ConsumerUtils) TokenUtils(org.bf2.admin.kafka.systemtest.utils.TokenUtils) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 4 with TokenUtils

use of org.bf2.admin.kafka.systemtest.utils.TokenUtils in project kafka-admin-api by bf2fc6cc711aee1a0c2a.

the class RestOAuthTestIT method initialize.

@BeforeAll
static void initialize() {
    tokenUtils = new TokenUtils(ConfigProvider.getConfig());
    JsonObject token = tokenUtils.getTokenObject(UserType.OWNER.getUsername());
    // Fetch one token before the tests begin to minimize wait time in expired token test
    initialToken = token.getString("access_token");
    initialTokenExpiresAt = System.currentTimeMillis() + (token.getInt("expires_in") * 1000);
}
Also used : TokenUtils(org.bf2.admin.kafka.systemtest.utils.TokenUtils) JsonObject(javax.json.JsonObject) BeforeAll(org.junit.jupiter.api.BeforeAll)

Aggregations

TokenUtils (org.bf2.admin.kafka.systemtest.utils.TokenUtils)4 JsonObject (javax.json.JsonObject)2 BeforeAll (org.junit.jupiter.api.BeforeAll)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 JsonString (javax.json.JsonString)1 ConsumerUtils (org.bf2.admin.kafka.systemtest.utils.ConsumerUtils)1