This repository was archived by the owner on Jun 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
main/java/com/venafi/vcert/sdk/connectors/tpp
test/java/com/venafi/vcert/sdk Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -128,23 +128,18 @@ public TokenInfo getAccessToken(Authentication auth) throws VCertException {
128128
129129 if (auth != null ) {
130130
131- Authentication authTemp = null ;
132-
133- if (auth != null ) {
134-
135- //creating a temp Authentication object based on the one passed as argument
136- // in order to avoid to modify that original given it's needed that
137- // the Authentication object to be passed to the authenticate() method needs
138- // that the accessToken and refreshToken doesn't set
139- authTemp = Authentication .builder ()
140- .user (auth .user ())
141- .password (auth .password ())
142- .clientId (auth .clientId ())
143- .scope (auth .scope ())
144- .state (auth .state ())
145- .redirectUri (auth .redirectUri ())
146- .build ();
147- }
131+ //creating a temp Authentication object based on the one passed as argument
132+ // in order to avoid to modify that original given it's needed that
133+ // the Authentication object to be passed to the authenticate() method needs
134+ // that the accessToken and refreshToken doesn't set
135+ Authentication authTemp = Authentication .builder ()
136+ .user (auth .user ())
137+ .password (auth .password ())
138+ .clientId (auth .clientId ())
139+ .scope (auth .scope ())
140+ .state (auth .state ())
141+ .redirectUri (auth .redirectUri ())
142+ .build ();
148143
149144 authenticate (authTemp );
150145
Original file line number Diff line number Diff line change 1313import org .junit .jupiter .api .Test ;
1414
1515import com .venafi .vcert .sdk .connectors .ConnectorException .MissingCredentialsException ;
16+ import com .venafi .vcert .sdk .connectors .ConnectorException .NullAuthenticationException ;
1617import com .venafi .vcert .sdk .connectors .tpp .TokenInfo ;
1718import com .venafi .vcert .sdk .endpoint .Authentication ;
1819import com .venafi .vcert .sdk .endpoint .ConnectorType ;
@@ -219,7 +220,7 @@ void invalidAuthenticationMissingCredentialsInAccessToken() {
219220 VCertTknClient client = getClientUnauthenticated ();
220221
221222 //asserting that the credentials were not provided
222- assertThrows (MissingCredentialsException .class , () -> client .getAccessToken ());
223+ assertThrows (NullAuthenticationException .class , () -> client .getAccessToken ());
223224
224225 //asserting that the credentials were not provided
225226 assertThrows (MissingCredentialsException .class , () -> client .getAccessToken (getAuthenticationMissingAccessToken ()));
You can’t perform that action at this time.
0 commit comments