File tree 4 files changed +15
-14
lines changed
main/kotlin/no/nav/dagpenger/oauth2
test/kotlin/no/nav/dagpenger/client
pdl-klient/src/test/java/no/nav/dagpenger/client/pdl
4 files changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ package no.nav.dagpenger.oauth2
3
3
import com.github.benmanes.caffeine.cache.AsyncLoadingCache
4
4
import com.github.benmanes.caffeine.cache.Caffeine
5
5
import com.github.benmanes.caffeine.cache.Expiry
6
- import com.github.benmanes.caffeine.cache.LoadingCache
7
6
import kotlinx.coroutines.runBlocking
8
7
import no.nav.security.token.support.client.core.oauth2.OAuth2AccessTokenResponse
9
8
import java.util.concurrent.TimeUnit
Original file line number Diff line number Diff line change @@ -27,11 +27,11 @@ class OAuth2Client(
27
27
return httpClient.submitForm(
28
28
url = tokenEndpointUrl,
29
29
formParameters =
30
- Parameters .build {
31
- grantRequest.formParams.forEach {
32
- this .append(it.key, it.value)
33
- }
34
- },
30
+ Parameters .build {
31
+ grantRequest.formParams.forEach {
32
+ this .append(it.key, it.value)
33
+ }
34
+ },
35
35
).body()
36
36
}
37
37
}
Original file line number Diff line number Diff line change @@ -73,8 +73,8 @@ class ClientTest {
73
73
}
74
74
}
75
75
76
+ // @Disabled("Manual test")
76
77
@Test
77
- // @Disabled("Manual test")
78
78
fun clientCredentialsTest () {
79
79
val config =
80
80
OAuth2Config .AzureAd (
@@ -115,12 +115,14 @@ class ClientTest {
115
115
CachedOauth2Client (tokenEndpointUrl = config.tokenEndpointUrl, authType = config.privateKey())
116
116
117
117
runBlocking {
118
- val t1 = async {
119
- cachedOauth2Client.clientCredentials(" api://dev-gcp.nom.skjermede-personer-pip/.default" )
120
- }
121
- val t2 = async {
122
- cachedOauth2Client.clientCredentials(" api://dev-fss.pdl.pdl-api/.default" )
123
- }
118
+ val t1 =
119
+ async {
120
+ cachedOauth2Client.clientCredentials(" api://dev-gcp.nom.skjermede-personer-pip/.default" )
121
+ }
122
+ val t2 =
123
+ async {
124
+ cachedOauth2Client.clientCredentials(" api://dev-fss.pdl.pdl-api/.default" )
125
+ }
124
126
125
127
println (" t1 = ${t1.await().accessToken} t2 = ${t2.await().accessToken} " )
126
128
}
Original file line number Diff line number Diff line change 19
19
public class JavaClientTest {
20
20
21
21
@ Test
22
- @ Disabled
22
+ // @Disabled
23
23
public void test () {
24
24
final Map <String , String > env = Stream .of (new String [][]{
25
25
{"AZURE_APP_CLIENT_ID" , "" },
You can’t perform that action at this time.
0 commit comments