FileUploadParameterBuilder implements ParameterBuilder { @Override public List<NameValuePair> getNameValueList() { final List<NameValuePair> paramsList = new LinkedList<NameValuePair>(); paramsList.add(new BasicNameValuePair(FileApiParameter.FILE_URI, fileUri)); paramsList.add(new BasicNameValuePair(FileApiParameter.FILE_TYPE, fileType.getIdentifier())); paramsList.add(new BasicNameValuePair(FileApiParameter.AUTHORIZE, null == authorize ? null : Boolean.toString(authorize))); paramsList.add(new BasicNameValuePair(FileApiParameter.CALLBACK_URL, callbackUrl)); if (localeIdsToAuthorize != null && !localeIdsToAuthorize.isEmpty()) paramsList.addAll(convertLocalesBasedApproveParams(FileApiParameter.LOCALES_ID_TO_AUTHORIZE, localeIdsToAuthorize)); if (overwriteAuthorizedLocales != null) paramsList.add(new BasicNameValuePair(FileApiParameter.OVERWRITE_AUTHORIZED_LOCALES, overwriteAuthorizedLocales.toString())); paramsList.add(new BasicNameValuePair(FileApiParameter.CLIENT_LIB_ID, getClientUidDirective())); paramsList.addAll(convertMapParams(directives)); return paramsList; } FileUploadParameterBuilder(FileType fileType, String fileUri); FileUploadParameterBuilder directives(final Map<String, String> directives); FileUploadParameterBuilder overwriteAuthorizedLocales(final Boolean overwriteAuthorizedLocales); FileUploadParameterBuilder localeIdsToAuthorize(final List<String> localesToApprove); List<String> getLocaleIdsToAuthorize(); FileUploadParameterBuilder callbackUrl(final String callbackUrl); FileUploadParameterBuilder approveContent(final Boolean approveContent); String getFileUri(); FileUploadParameterBuilder charset(final String charset); String getCharset(); FileType getFileType(); @Override List<NameValuePair> getNameValueList();  }
@Test public void shouldContainDefaultClientLibIdDirectiveIfNonIsProvided() { String expectedValue = "{\"client\":\"test-artifact-id\",\"version\":\"1.0.0\"}"; List<NameValuePair> nameValueList = testedInstance.getNameValueList(); assertTrue(nameValueList.contains(new BasicNameValuePair(FileApiParameter.CLIENT_LIB_ID, expectedValue))); }