OpenShiftStopWorkspaceRoleProvisioner { protected OpenshiftRole createStopWorkspacesRole(String name) { return new OpenshiftRoleBuilder() .withNewMetadata() .withName(name) .endMetadata() .withRules( new PolicyRuleBuilder() .withApiGroups("") .withResources("pods") .withVerbs("get", "list", "watch", "delete") .build(), new PolicyRuleBuilder() .withApiGroups("") .withResources("configmaps", "services", "secrets") .withVerbs("delete", "list", "get") .build(), new PolicyRuleBuilder() .withApiGroups("route.openshift.io") .withResources("routes") .withVerbs("delete", "list") .build(), new PolicyRuleBuilder() .withApiGroups("apps") .withResources("deployments", "replicasets") .withVerbs("delete", "list", "get", "patch") .build()) .build(); } @Inject  OpenShiftStopWorkspaceRoleProvisioner(
      OpenShiftClientFactory clientFactory,
      CheInstallationLocation installationLocation,
      @Named("che.workspace.stop.role.enabled") boolean stopWorkspaceRoleEnabled); void provision(String projectName);  }
@Test public void shouldCreateRole() { assertEquals( stopWorkspaceRoleProvisioner.createStopWorkspacesRole("workspace-stop"), expectedRole); }