### Question:
ExecutionScheduleManager { protected WebResource extendApiResource(WebResource webResource, String relativeUri) { WebResource result = webResource; if (StringUtils.isNotEmpty(relativeUri) && !CONTAINS_API_VERSION_PATTERN.matcher(relativeUri).matches()) { result = webResource.path(DEFAULT_API_PATH); } return result.path(relativeUri); } @Inject  ExecutionScheduleManager(Configuration configuration,
                                  ExecutionScheduler executionScheduler,
                                  InternalTokenStorage tokenStorage,
                                  Clusters clusters,
                                  ActionDBAccessor actionDBAccessor,
                                  Gson gson); void start(); void stop(); boolean isSchedulerAvailable(); void scheduleJob(Trigger trigger); boolean continueOnMisfire(JobExecutionContext jobExecutionContext); void scheduleBatch(RequestExecution requestExecution); void updateBatchSchedule(RequestExecution requestExecution); void validateSchedule(Schedule schedule); void deleteAllJobs(RequestExecution requestExecution); Long executeBatchRequest(long executionId,
                                  long batchId,
                                  String clusterName); BatchRequestResponse getBatchRequestResponse(Long requestId, String clusterName); void updateBatchRequest(long executionId, long batchId, String clusterName,
                                 BatchRequestResponse batchRequestResponse,
                                 boolean statusOnly); boolean hasToleranceThresholdExceeded(Long executionId,
      String clusterName, Map<String, Integer> taskCounts); void finalizeBatch(long executionId, String clusterName); static final String USER_ID_HEADER; }### Answer:
@Test public void testExtendApiResource() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { WebResource webResource = Client.create().resource("http: String clustersEndpoint = "http: Clusters clustersMock = createMock(Clusters.class); Configuration configurationMock = createNiceMock(Configuration.class); ExecutionScheduler executionSchedulerMock = createMock(ExecutionScheduler.class); InternalTokenStorage tokenStorageMock = createMock(InternalTokenStorage.class); ActionDBAccessor actionDBAccessorMock = createMock(ActionDBAccessor.class); Gson gson = new Gson(); replay(clustersMock, configurationMock, executionSchedulerMock, tokenStorageMock, actionDBAccessorMock); ExecutionScheduleManager scheduleManager = new ExecutionScheduleManager(configurationMock, executionSchedulerMock, tokenStorageMock, clustersMock, actionDBAccessorMock, gson); assertEquals(clustersEndpoint, scheduleManager.extendApiResource(webResource, "clusters").getURI().toString()); assertEquals(clustersEndpoint, scheduleManager.extendApiResource(webResource, "/clusters").getURI().toString()); assertEquals(clustersEndpoint, scheduleManager.extendApiResource(webResource, "/api/v1/clusters").getURI().toString()); assertEquals(clustersEndpoint, scheduleManager.extendApiResource(webResource, "api/v1/clusters").getURI().toString()); assertEquals("http: scheduleManager.extendApiResource(webResource, "").getURI().toString()); }