FileApiClientImpl extends TokenProviderAwareClient implements FileApiClient { @Override public EmptyResponse deleteFile(String fileUri) throws SmartlingApiException { final HttpPost httpPost = createJsonPostRequest( getApiUrl(FILES_API_V2_FILE_DELETE), new FileDeletePayload(fileUri) ); 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 testDeleteFile() throws Exception { String fileUriWithSpecialSymbols = "©¥†çƒ"; when(response.getContents()).thenReturn(ResponseExamples.EMPTY_RESPONSE); EmptyResponse apiResponse = fileApiClient.deleteFile(fileUriWithSpecialSymbols); HttpRequestBase request = requestCaptor.getValue(); assertEquals(EXPECTED_AUTHORIZATION_HEADER, request.getFirstHeader(HttpHeaders.AUTHORIZATION).getValue()); assertEquals("https: assertEquals(HttpPost.class, request.getClass()); HttpPost postRequest = (HttpPost) request; assertThat(postRequest.getEntity(), instanceOf(StringEntity.class)); assertThat(postRequest.getEntity().getContentEncoding().getValue(), equalTo("UTF-8")); assertThat(postRequest.getEntity().getContentType().getValue(), startsWith("application/json")); assertThat(IOUtils.toString(postRequest.getEntity().getContent(), "UTF-8"), containsString(fileUriWithSpecialSymbols)); assertEquals(EmptyResponse.class, apiResponse.getClass()); }