FileApiClientImpl extends TokenProviderAwareClient implements FileApiClient { @Override public FileStatus getFileStatus(String fileUri) throws SmartlingApiException { final String params = buildParamsQuery(new BasicNameValuePair(FILE_URI, fileUri)); final HttpGet httpGet = new HttpGet(buildUrl(getApiUrl(FILES_API_V2_FILE_STATUS), params)); final StringResponse response = executeRequest(httpGet); return getApiV2Response(response.getContents(), new TypeToken<ApiV2ResponseWrapper<FileStatus>>() { } ).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 testGetFileStatus() throws Exception { when(response.getContents()).thenReturn(ResponseExamples.FILE_STATUS_RESPONSE); FileStatus apiResponse = fileApiClient.getFileStatus(FILE_URI); HttpRequestBase request = requestCaptor.getValue(); assertEquals(EXPECTED_AUTHORIZATION_HEADER, request.getFirstHeader(HttpHeaders.AUTHORIZATION).getValue()); assertEquals(HttpGet.class, request.getClass()); assertEquals("https: assertEquals(5, apiResponse.getItems().size()); assertEquals(5, apiResponse.getTotalCount()); assertEquals(3, apiResponse.getTotalWordCount()); assertEquals(1, apiResponse.getTotalStringCount()); assertEquals( "FileStatusItem[localeId=be-BY,authorizedStringCount=0,authorizedWordCount=0,completedStringCount=0,completedWordCount=0,excludedStringCount=0," + "excludedWordCount=0]", apiResponse.getItems().get(0).toString() ); }