public String accessSecret(String secretVersion) {

    checkArgument(!secretVersion.isEmpty(), "secretVersion can not be empty");
    checkIsUsable();
    try {
      SecretVersionName secretVersionName;

      if (SecretVersionName.isParsableFrom(secretVersion)) {
        secretVersionName = SecretVersionName.parse(secretVersion);

      } else {
        throw new IllegalArgumentException(
            "Provided Secret must be in the form"
                + " projects/{project}/secrets/{secret}/versions/{secret_version}");
      }
      AccessSecretVersionResponse response =
          secretManagerServiceClient.accessSecretVersion(secretVersionName);
      return response.getPayload().getData().toStringUtf8();

    } catch (Exception e) {
      throw new SecretManagerResourceManagerException("Error while accessing a secret version", e);
    }
  }
@Test
  public void testAccessSecretWithInvalidNameShouldFail() {
    IllegalArgumentException exception =
        assertThrows(IllegalArgumentException.class, () -> testManager.accessSecret(""));
    assertThat(exception).hasMessageThat().contains("secretVersion can not be empty");
  }