|
23 | 23 | import lombok.Setter;
|
24 | 24 | import neo4j.org.testkit.backend.TestkitState;
|
25 | 25 | import neo4j.org.testkit.backend.holder.DriverHolder;
|
26 |
| -import neo4j.org.testkit.backend.messages.responses.BackendError; |
27 | 26 | import neo4j.org.testkit.backend.messages.responses.DomainNameResolutionRequired;
|
28 | 27 | import neo4j.org.testkit.backend.messages.responses.Driver;
|
29 | 28 | import neo4j.org.testkit.backend.messages.responses.DriverError;
|
@@ -68,27 +67,28 @@ public TestkitResponse process( TestkitState testkitState )
|
68 | 67 | String id = testkitState.newId();
|
69 | 68 |
|
70 | 69 | AuthToken authToken;
|
71 |
| - switch ( data.getAuthorizationToken().getTokens().get( "scheme" ) ) |
| 70 | + switch ( data.getAuthorizationToken().getTokens().getScheme() ) |
72 | 71 | {
|
73 | 72 | case "basic":
|
74 |
| - authToken = AuthTokens.basic( data.authorizationToken.getTokens().get( "principal" ), |
75 |
| - data.authorizationToken.getTokens().get( "credentials" ), |
76 |
| - data.authorizationToken.getTokens().get( "realm" ) ); |
| 73 | + authToken = AuthTokens.basic( data.authorizationToken.getTokens().getPrincipal(), |
| 74 | + data.authorizationToken.getTokens().getCredentials(), |
| 75 | + data.authorizationToken.getTokens().getRealm() ); |
77 | 76 | break;
|
78 | 77 | case "bearer":
|
79 |
| - authToken = AuthTokens.bearer( data.authorizationToken.getTokens().get( "credentials" ) ); |
| 78 | + authToken = AuthTokens.bearer( data.authorizationToken.getTokens().getCredentials() ); |
80 | 79 | break;
|
81 | 80 | case "kerberos":
|
82 |
| - authToken = AuthTokens.kerberos( data.authorizationToken.getTokens().get( "credentials" ) ); |
| 81 | + authToken = AuthTokens.kerberos( data.authorizationToken.getTokens().getCredentials() ); |
83 | 82 | break;
|
84 | 83 | default:
|
85 |
| - return BackendError.builder() |
86 |
| - .data( BackendError |
87 |
| - .BackendErrorBody.builder() |
88 |
| - .msg( "Auth scheme " + data.authorizationToken.getTokens().get( "scheme" ) + |
89 |
| - " not implemented" ) |
90 |
| - .build() ) |
91 |
| - .build(); |
| 84 | + authToken = AuthTokens.custom( |
| 85 | + data.authorizationToken.getTokens().getPrincipal(), |
| 86 | + data.authorizationToken.getTokens().getCredentials(), |
| 87 | + data.authorizationToken.getTokens().getRealm(), |
| 88 | + data.authorizationToken.getTokens().getScheme(), |
| 89 | + data.authorizationToken.getTokens().getParameters() |
| 90 | + ); |
| 91 | + break; |
92 | 92 | }
|
93 | 93 |
|
94 | 94 | Config.ConfigBuilder configBuilder = Config.builder();
|
|
0 commit comments