@Test public void setSecret() { AzureSetSecretData setSecretData = mock(AzureSetSecretData.class); String secretName = "id"; String secret = "secret"; when(setSecretData.getSecretName()).thenReturn(secretName); when(setSecretData.getSecret()).thenReturn(secret); keyVaultService.setSecret(setSecretData); SetSecretRequest expected = new SetSecretRequest.Builder(vaultUrl, secretName, secret).build(); ArgumentCaptor<SetSecretRequest> argument = ArgumentCaptor.forClass(SetSecretRequest.class); verify(azureKeyVaultClientDelegate).setSecret(argument.capture()); assertThat(argument.getValue()).isEqualToComparingFieldByField(expected); }
@Override public Object setSecret(AzureSetSecretData azureSetSecretData) { SetSecretRequest setSecretRequest = new SetSecretRequest.Builder(vaultUrl, azureSetSecretData.getSecretName(), azureSetSecretData.getSecret()).build(); return this.azureKeyVaultClientDelegate.setSecret(setSecretRequest); }
AzureKeyVaultService implements KeyVaultService<AzureSetSecretData, AzureGetSecretData> { @Override public Object setSecret(AzureSetSecretData azureSetSecretData) { SetSecretRequest setSecretRequest = new SetSecretRequest.Builder(vaultUrl, azureSetSecretData.getSecretName(), azureSetSecretData.getSecret()).build(); return this.azureKeyVaultClientDelegate.setSecret(setSecretRequest); } }
AzureKeyVaultService implements KeyVaultService<AzureSetSecretData, AzureGetSecretData> { @Override public Object setSecret(AzureSetSecretData azureSetSecretData) { SetSecretRequest setSecretRequest = new SetSecretRequest.Builder(vaultUrl, azureSetSecretData.getSecretName(), azureSetSecretData.getSecret()).build(); return this.azureKeyVaultClientDelegate.setSecret(setSecretRequest); } AzureKeyVaultService(KeyVaultConfig keyVaultConfig, AzureKeyVaultClientDelegate azureKeyVaultClientDelegate);   AzureKeyVaultService(String vaultUrl, AzureKeyVaultClientDelegate azureKeyVaultClientDelegate); }
AzureKeyVaultService implements KeyVaultService<AzureSetSecretData, AzureGetSecretData> { @Override public Object setSecret(AzureSetSecretData azureSetSecretData) { SetSecretRequest setSecretRequest = new SetSecretRequest.Builder(vaultUrl, azureSetSecretData.getSecretName(), azureSetSecretData.getSecret()).build(); return this.azureKeyVaultClientDelegate.setSecret(setSecretRequest); } AzureKeyVaultService(KeyVaultConfig keyVaultConfig, AzureKeyVaultClientDelegate azureKeyVaultClientDelegate);   AzureKeyVaultService(String vaultUrl, AzureKeyVaultClientDelegate azureKeyVaultClientDelegate); @Override String getSecret(AzureGetSecretData azureGetSecretData); @Override Object setSecret(AzureSetSecretData azureSetSecretData); }
AzureKeyVaultService implements KeyVaultService<AzureSetSecretData, AzureGetSecretData> { @Override public Object setSecret(AzureSetSecretData azureSetSecretData) { SetSecretRequest setSecretRequest = new SetSecretRequest.Builder(vaultUrl, azureSetSecretData.getSecretName(), azureSetSecretData.getSecret()).build(); return this.azureKeyVaultClientDelegate.setSecret(setSecretRequest); } AzureKeyVaultService(KeyVaultConfig keyVaultConfig, AzureKeyVaultClientDelegate azureKeyVaultClientDelegate);   AzureKeyVaultService(String vaultUrl, AzureKeyVaultClientDelegate azureKeyVaultClientDelegate); @Override String getSecret(AzureGetSecretData azureGetSecretData); @Override Object setSecret(AzureSetSecretData azureSetSecretData);  }