@Test void testGetCredentials() { GetActorWorkloadCredentialsResponse response = GetActorWorkloadCredentialsResponse.newBuilder() .setPasswordHash(PASSWORD_HASH) .addAllKerberosKeys(ACTOR_KERBEROS_KEY_LIST) .setPasswordHashExpirationDate(EXPIRATION_DATE) .build(); when(grpcUmsClient.getActorWorkloadCredentials(any(), eq("user"), any())).thenReturn(response); WorkloadCredential credential = underTest.getCredentials("user", Optional.empty()); assertEquals(credential.getHashedPassword(), PASSWORD_HASH); assertEquals(credential.getExpirationDate(), Optional.of(Instant.ofEpochMilli(EXPIRATION_DATE))); assertTrue(credential.getKeys().containsAll(ACTOR_KERBEROS_KEY_LIST)); }
public WorkloadCredential getCredentials(String userCrn, Optional<String> requestId) { GetActorWorkloadCredentialsResponse response = grpcUmsClient.getActorWorkloadCredentials(INTERNAL_ACTOR_CRN, userCrn, requestId); return workloadCredentialConverter.toWorkloadCredential(response); }
UmsCredentialProvider { public WorkloadCredential getCredentials(String userCrn, Optional<String> requestId) { GetActorWorkloadCredentialsResponse response = grpcUmsClient.getActorWorkloadCredentials(INTERNAL_ACTOR_CRN, userCrn, requestId); return workloadCredentialConverter.toWorkloadCredential(response); } }
UmsCredentialProvider { public WorkloadCredential getCredentials(String userCrn, Optional<String> requestId) { GetActorWorkloadCredentialsResponse response = grpcUmsClient.getActorWorkloadCredentials(INTERNAL_ACTOR_CRN, userCrn, requestId); return workloadCredentialConverter.toWorkloadCredential(response); }  }
UmsCredentialProvider { public WorkloadCredential getCredentials(String userCrn, Optional<String> requestId) { GetActorWorkloadCredentialsResponse response = grpcUmsClient.getActorWorkloadCredentials(INTERNAL_ACTOR_CRN, userCrn, requestId); return workloadCredentialConverter.toWorkloadCredential(response); }  WorkloadCredential getCredentials(String userCrn, Optional<String> requestId); }
UmsCredentialProvider { public WorkloadCredential getCredentials(String userCrn, Optional<String> requestId) { GetActorWorkloadCredentialsResponse response = grpcUmsClient.getActorWorkloadCredentials(INTERNAL_ACTOR_CRN, userCrn, requestId); return workloadCredentialConverter.toWorkloadCredential(response); }  WorkloadCredential getCredentials(String userCrn, Optional<String> requestId);  }