Search in sources :

Example 1 with ApiTokenData

use of com.bakdata.conquery.models.auth.apitoken.ApiTokenData in project conquery by bakdata.

the class SerializationTests method testApiTokenData.

@Test
public void testApiTokenData() throws JSONException, IOException {
    final CharArrayBuffer buffer = new CharArrayBuffer(5);
    buffer.append("testtest");
    final ApiToken apiToken = new ApiToken(buffer);
    final ApiTokenData apiTokenData = new ApiTokenData(UUID.randomUUID(), apiToken.hashToken(), "tokenName", new UserId("tokenUser"), LocalDate.now(), LocalDate.now().plus(1, ChronoUnit.DAYS), EnumSet.of(Scopes.DATASET), STORAGE);
    SerializationTestUtil.forType(ApiTokenData.class).injectables(STORAGE).test(apiTokenData);
}
Also used : UserId(com.bakdata.conquery.models.identifiable.ids.specific.UserId) CharArrayBuffer(org.apache.http.util.CharArrayBuffer) ApiToken(com.bakdata.conquery.models.auth.apitoken.ApiToken) ApiTokenData(com.bakdata.conquery.models.auth.apitoken.ApiTokenData) Test(org.junit.jupiter.api.Test) IdMapSerialisationTest(com.bakdata.conquery.models.identifiable.IdMapSerialisationTest)

Aggregations

ApiToken (com.bakdata.conquery.models.auth.apitoken.ApiToken)1 ApiTokenData (com.bakdata.conquery.models.auth.apitoken.ApiTokenData)1 IdMapSerialisationTest (com.bakdata.conquery.models.identifiable.IdMapSerialisationTest)1 UserId (com.bakdata.conquery.models.identifiable.ids.specific.UserId)1 CharArrayBuffer (org.apache.http.util.CharArrayBuffer)1 Test (org.junit.jupiter.api.Test)1