### Question:
DataprocProvisioner extends AbstractDataprocProvisioner { @Override protected String getClusterName(ProvisionerContext context) { ProgramRunInfo programRunInfo = context.getProgramRunInfo(); String cleanedAppName = programRunInfo.getApplication().replaceAll("[^A-Za-z0-9\\-]", "").toLowerCase(); int maxAppLength = 51 - CLUSTER_PREFIX.length() - 1 - programRunInfo.getRun().length(); if (cleanedAppName.length() > maxAppLength) { cleanedAppName = cleanedAppName.substring(0, maxAppLength); } return CLUSTER_PREFIX + cleanedAppName + "-" + programRunInfo.getRun(); } @SuppressWarnings("WeakerAccess")  DataprocProvisioner(); @Override void validateProperties(Map<String, String> properties); @Override Cluster createCluster(ProvisionerContext context); @Override ClusterStatus getClusterStatus(ProvisionerContext context, Cluster cluster); @Override Cluster getClusterDetail(ProvisionerContext context, Cluster cluster); @Override PollingStrategy getPollingStrategy(ProvisionerContext context, Cluster cluster);  }### Answer:
@Test public void testClusterName() { ProgramRunInfo programRunInfo = new ProgramRunInfo.Builder() .setNamespace("ns") .setApplication("app") .setVersion("1.0") .setProgramType("workflow") .setProgram("program") .setRun(UUID.randomUUID().toString()) .build(); Assert.assertEquals("cdap-app-" + programRunInfo.getRun(), new DataprocProvisioner().getClusterName(new MockProvisionerContext(programRunInfo))); programRunInfo = new ProgramRunInfo.Builder() .setNamespace("ns") .setApplication("My@Appl!cation") .setVersion("1.0") .setProgramType("workflow") .setProgram("program") .setRun(UUID.randomUUID().toString()) .build(); Assert.assertEquals("cdap-myapplcat-" + programRunInfo.getRun(), new DataprocProvisioner().getClusterName(new MockProvisionerContext(programRunInfo))); }