public void createSecret(String secretId, String secretData) {
    checkArgument(!secretId.isEmpty(), "secretId can not be empty");
    checkArgument(!secretData.isEmpty(), "secretData can not be empty");
    try {
      checkIsUsable();
      ProjectName projectName = ProjectName.of(projectId);

      // Create the parent secret.
      Secret secret =
          Secret.newBuilder()
              .setReplication(
                  Replication.newBuilder()
                      .setAutomatic(Replication.Automatic.newBuilder().build())
                      .build())
              .build();

      Secret createdSecret = secretManagerServiceClient.createSecret(projectName, secretId, secret);

      // Add a secret version.
      SecretPayload payload =
          SecretPayload.newBuilder().setData(ByteString.copyFromUtf8(secretData)).build();
      secretManagerServiceClient.addSecretVersion(createdSecret.getName(), payload);

      createdSecretIds.add(secretId);

      LOG.info("Created secret successfully.");

    } catch (Exception e) {
      throw new SecretManagerResourceManagerException("Error while creating secret", e);
    }
  }
@Test
  public void testCreateSecretWithInvalidNameShouldFail() {
    IllegalArgumentException exception =
        assertThrows(
            IllegalArgumentException.class, () -> testManager.createSecret("", SECRET_DATA));
    assertThat(exception).hasMessageThat().contains("secretId can not be empty");
  }