static String createJobIdPrefix(
      String jobName, String stepUuid, JobType type, @Nullable String random) {
    jobName = jobName.replaceAll("-", "");
    String result =
        BIGQUERY_JOB_TEMPLATE
            .replaceFirst("\\{TYPE}", type.toString())
            .replaceFirst("\\{JOB_ID}", jobName)
            .replaceFirst("\\{STEP}", stepUuid);

    if (random != null) {
      return result.replaceFirst("\\{RANDOM}", random);
    } else {
      return result.replaceFirst("_\\{RANDOM}", "");
    }
  }
@Test
  public void testJobTypesInNames() {
    assertEquals(
        "beam_bq_job_EXPORT_beamappjobtest_abcd",
        BigQueryResourceNaming.createJobIdPrefix("beamapp-job-test", "abcd", JobType.EXPORT));

    assertEquals(
        "beam_bq_job_LOAD_beamappjobtest_abcd",
        BigQueryResourceNaming.createJobIdPrefix("beamapp-job-test", "abcd", JobType.LOAD));

    assertEquals(
        "beam_bq_job_QUERY_beamappjobtest_abcd",
        BigQueryResourceNaming.createJobIdPrefix("beamapp-job-test", "abcd", JobType.QUERY));

    assertEquals(
        "beam_bq_job_COPY_beamappjobtest_abcd",
        BigQueryResourceNaming.createJobIdPrefix("beamapp-job-test", "abcd", JobType.COPY));
  }