FileApiClientImpl extends TokenProviderAwareClient implements FileApiClient { @Override public EmptyResponse renameFile(String fileUri, String newFileUri) throws SmartlingApiException { final HttpPost httpPost = createJsonPostRequest( getApiUrl(FILES_API_V2_FILE_RENAME), new FileRenamePayload(fileUri, newFileUri) ); final StringResponse response = executeRequest(httpPost); return getApiV2Response(response.getContents(), new TypeToken<ApiV2ResponseWrapper<EmptyResponse>>() { } ).retrieveData(); } private  FileApiClientImpl(final TokenProvider tokenProvider, final String projectId, final ProxyConfiguration proxyConfiguration,
                              final String baseUrl, final HttpClientConfiguration httpClientConfiguration); @Override UploadFileData uploadFile(File fileToUpload, FileUploadParameterBuilder fileUploadParameterBuilder); @Override UploadFileData uploadFile(InputStream inputStream, String fileName, FileUploadParameterBuilder fileUploadParameterBuilder); @Override EmptyResponse deleteFile(String fileUri); @Override EmptyResponse renameFile(String fileUri, String newFileUri); @Override FileLastModified getLastModified(FileLastModifiedParameterBuilder builder); @Override StringResponse getFilesArchive(GetFilesArchiveParameterBuilder builder); @Override StringResponse getFile(GetFileParameterBuilder getFileParameterBuilder); @Override StringResponse getOriginalFile(GetOriginalFileParameterBuilder getFileParameterBuilder); @Override FileList getFilesList(FileListSearchParameterBuilder fileListSearchParameterBuilder); @Override FileLocaleStatus getFileLocaleStatus(String fileUri, String locale); @Override FileStatus getFileStatus(String fileUri); @Override FileImportSmartlingData importTranslations(FileImportParameterBuilder fileImportParameterBuilder);  }
@Test public void testRenameFile() throws Exception { when(response.getContents()).thenReturn(ResponseExamples.EMPTY_RESPONSE); EmptyResponse apiResponse = fileApiClient.renameFile(FILE_URI, FILE_URI2); HttpRequestBase request = requestCaptor.getValue(); assertEquals(EXPECTED_AUTHORIZATION_HEADER, request.getFirstHeader(HttpHeaders.AUTHORIZATION).getValue()); assertEquals(HttpPost.class, request.getClass()); assertEquals("https: assertEquals(EmptyResponse.class, apiResponse.getClass()); }