StudioWorkspaceResourceHandler implements WorkspaceResourceHandler { protected ResponseEntity<String> doGet(final Path filePath, String action) { if (restClient.isConfigured()) { final String url = createGetURL(filePath, action); RestTemplate restTemplate = restClient.getRestTemplate(); return restTemplate.getForEntity(URI.create(url), String.class); } return new ResponseEntity<>(HttpStatus.SERVICE_UNAVAILABLE); } @Inject  StudioWorkspaceResourceHandler(RestClient restClient); @Override void preOpen(final Path filePath); @Override void postClose(final Path filePath); @Override void delete(Path filePath); @Override void postDelete(final Path filePath); @Override void postSave(final Path filePath); @Override void preImport(); @Override void postImport(); @Override LockStatus getLockStatus(final Path filePath);  }
@Test public void should_doGet_doNothing_if_rest_client_is_not_configured() throws Exception { when(env.getProperty(RestClientProperties.WORKSPACE_API_REST_URL)).thenReturn(null); studioWorkspaceResourceHandler.doGet(filePath, StudioWorkspaceResourceHandler.GET_LOCK_STATUS); }