Skip to content

Commit

Permalink
fixup! Omit scm-username annotation from the PAT secret
Browse files Browse the repository at this point in the history
  • Loading branch information
vinokurig committed Jul 25, 2023
1 parent 2dc2f42 commit df64e40
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,12 @@ public void shouldReturnFirstValidToken() throws Exception {
when(kubernetesnamespace.secrets()).thenReturn(secrets);
when(scmPersonalAccessTokenFetcher.getScmUsername(any(PersonalAccessTokenParams.class)))
.thenAnswer(
(Answer<String>)
(Answer<Optional<String>>)
invocation -> {
PersonalAccessTokenParams params = invocation.getArgument(0);
return "id2".equals(params.getScmTokenId()) ? "user" : null;
return "id2".equals(params.getScmTokenId())
? Optional.of("user")
: Optional.empty();
});
when(cheServerKubernetesClientFactory.create()).thenReturn(kubeClient);
when(kubeClient.secrets()).thenReturn(secretsMixedOperation);
Expand Down

0 comments on commit df64e40

Please sign in to comment.