@Test public void getQueryParamsTest2() { String queryParams = getQueryParams(TOP_QUERY, SELECT_QUERY, O_DATA_QUERY); assertEquals(EXPECTED_QUERY_PARAMS, queryParams); }
@NotNull public static String getQueryParams(@NotNull final String topQuery, @NotNull final String selectQuery, @NotNull String oDataQuery) { final StringBuilder oDataQueryParam = new StringBuilder() .append(TOP_QUERY) .append(topQuery); if (!isEmpty(selectQuery)) { oDataQueryParam.append(AND) .append(SELECT_PATH) .append(selectQuery); } if (!isEmpty(oDataQuery)) { if (oDataQuery.startsWith(QUERY)) { oDataQuery = oDataQuery.substring(1); } if (!oDataQuery.startsWith(AND)) { oDataQuery = AND + oDataQuery; } oDataQueryParam.append(oDataQuery); } return oDataQueryParam.toString(); }
HttpUtils { @NotNull public static String getQueryParams(@NotNull final String topQuery, @NotNull final String selectQuery, @NotNull String oDataQuery) { final StringBuilder oDataQueryParam = new StringBuilder() .append(TOP_QUERY) .append(topQuery); if (!isEmpty(selectQuery)) { oDataQueryParam.append(AND) .append(SELECT_PATH) .append(selectQuery); } if (!isEmpty(oDataQuery)) { if (oDataQuery.startsWith(QUERY)) { oDataQuery = oDataQuery.substring(1); } if (!oDataQuery.startsWith(AND)) { oDataQuery = AND + oDataQuery; } oDataQueryParam.append(oDataQuery); } return oDataQueryParam.toString(); } }
HttpUtils { @NotNull public static String getQueryParams(@NotNull final String topQuery, @NotNull final String selectQuery, @NotNull String oDataQuery) { final StringBuilder oDataQueryParam = new StringBuilder() .append(TOP_QUERY) .append(topQuery); if (!isEmpty(selectQuery)) { oDataQueryParam.append(AND) .append(SELECT_PATH) .append(selectQuery); } if (!isEmpty(oDataQuery)) { if (oDataQuery.startsWith(QUERY)) { oDataQuery = oDataQuery.substring(1); } if (!oDataQuery.startsWith(AND)) { oDataQuery = AND + oDataQuery; } oDataQueryParam.append(oDataQuery); } return oDataQueryParam.toString(); }  }
HttpUtils { @NotNull public static String getQueryParams(@NotNull final String topQuery, @NotNull final String selectQuery, @NotNull String oDataQuery) { final StringBuilder oDataQueryParam = new StringBuilder() .append(TOP_QUERY) .append(topQuery); if (!isEmpty(selectQuery)) { oDataQueryParam.append(AND) .append(SELECT_PATH) .append(selectQuery); } if (!isEmpty(oDataQuery)) { if (oDataQuery.startsWith(QUERY)) { oDataQuery = oDataQuery.substring(1); } if (!oDataQuery.startsWith(AND)) { oDataQuery = AND + oDataQuery; } oDataQueryParam.append(oDataQuery); } return oDataQueryParam.toString(); }  @NotNull static Proxy getProxy(@NotNull final String proxyHost, final int proxyPort, @NotNull final String proxyUser, @NotNull final String proxyPassword); @NotNull static URIBuilder getUriBuilder(); @NotNull static String getMessagesPath(@NotNull final String userPrincipalName,
                                         @NotNull final String userId); @NotNull static String updateUserPath(String userPrincipalName, String userId); @NotNull static String getMessagePath(@NotNull final String userPrincipalName,
                                        @NotNull final String userId,
                                        @NotNull final String messageId); @NotNull static String addAttachmentPath(@NotNull final String userPrincipalName,
                                           @NotNull final String userId,
                                           @NotNull final String messageId); @NotNull static String getAttachmentsPath(@NotNull final String userPrincipalName,
                                            @NotNull final String userId,
                                            @NotNull final String messageId,
                                            @NotNull final String attachmentId); @NotNull static String sendMessagePath(@NotNull final String userPrincipalName,
                                         @NotNull final String userId,
                                         @NotNull final String messageId); @NotNull static String getMessagesPath(@NotNull final String userPrincipalName,
                                         @NotNull final String userId,
                                         @NotNull final String folderId); @NotNull static String getMessagePath(@NotNull final String userPrincipalName,
                                        @NotNull final String userId,
                                        @NotNull final String messageId,
                                        @NotNull final String folderId); @NotNull static String moveMessagePath(@NotNull final String userPrincipalName,
                                         @NotNull final String userId,
                                         @NotNull final String messageId); static void setProxy(@NotNull final HttpClientInputs httpClientInputs,
                                @NotNull final String proxyHost,
                                @NotNull final String proxyPort,
                                @NotNull final String proxyUsername,
                                @NotNull final String proxyPassword); static void setSecurityInputs(@NotNull final HttpClientInputs httpClientInputs,
                                         @NotNull final String trustAllRoots,
                                         @NotNull final String x509HostnameVerifier,
                                         @NotNull final String trustKeystore,
                                         @NotNull final String trustPassword); static void setConnectionParameters(HttpClientInputs httpClientInputs,
                                               @NotNull final String connectTimeout,
                                               @NotNull final String socketTimeout,
                                               @NotNull final String keepAlive,
                                               @NotNull final String connectionsMaxPerRoot,
                                               @NotNull final String connectionsMaxTotal); @NotNull static String getAuthHeaders(@NotNull final String authToken); @NotNull static String getQueryParams(@NotNull final String topQuery,
                                        @NotNull final String selectQuery,
                                        @NotNull String oDataQuery); @NotNull static String getQueryParams(@NotNull final String selectQuery,
                                        @NotNull String oDataQuery); @NotNull static Map<String, String> getOperationResults(@NotNull final Map<String, String> result,
                                                          @NotNull final String successMessage,
                                                          final String failureMessage,
                                                          final String document); }
HttpUtils { @NotNull public static String getQueryParams(@NotNull final String topQuery, @NotNull final String selectQuery, @NotNull String oDataQuery) { final StringBuilder oDataQueryParam = new StringBuilder() .append(TOP_QUERY) .append(topQuery); if (!isEmpty(selectQuery)) { oDataQueryParam.append(AND) .append(SELECT_PATH) .append(selectQuery); } if (!isEmpty(oDataQuery)) { if (oDataQuery.startsWith(QUERY)) { oDataQuery = oDataQuery.substring(1); } if (!oDataQuery.startsWith(AND)) { oDataQuery = AND + oDataQuery; } oDataQueryParam.append(oDataQuery); } return oDataQueryParam.toString(); }  @NotNull static Proxy getProxy(@NotNull final String proxyHost, final int proxyPort, @NotNull final String proxyUser, @NotNull final String proxyPassword); @NotNull static URIBuilder getUriBuilder(); @NotNull static String getMessagesPath(@NotNull final String userPrincipalName,
                                         @NotNull final String userId); @NotNull static String updateUserPath(String userPrincipalName, String userId); @NotNull static String getMessagePath(@NotNull final String userPrincipalName,
                                        @NotNull final String userId,
                                        @NotNull final String messageId); @NotNull static String addAttachmentPath(@NotNull final String userPrincipalName,
                                           @NotNull final String userId,
                                           @NotNull final String messageId); @NotNull static String getAttachmentsPath(@NotNull final String userPrincipalName,
                                            @NotNull final String userId,
                                            @NotNull final String messageId,
                                            @NotNull final String attachmentId); @NotNull static String sendMessagePath(@NotNull final String userPrincipalName,
                                         @NotNull final String userId,
                                         @NotNull final String messageId); @NotNull static String getMessagesPath(@NotNull final String userPrincipalName,
                                         @NotNull final String userId,
                                         @NotNull final String folderId); @NotNull static String getMessagePath(@NotNull final String userPrincipalName,
                                        @NotNull final String userId,
                                        @NotNull final String messageId,
                                        @NotNull final String folderId); @NotNull static String moveMessagePath(@NotNull final String userPrincipalName,
                                         @NotNull final String userId,
                                         @NotNull final String messageId); static void setProxy(@NotNull final HttpClientInputs httpClientInputs,
                                @NotNull final String proxyHost,
                                @NotNull final String proxyPort,
                                @NotNull final String proxyUsername,
                                @NotNull final String proxyPassword); static void setSecurityInputs(@NotNull final HttpClientInputs httpClientInputs,
                                         @NotNull final String trustAllRoots,
                                         @NotNull final String x509HostnameVerifier,
                                         @NotNull final String trustKeystore,
                                         @NotNull final String trustPassword); static void setConnectionParameters(HttpClientInputs httpClientInputs,
                                               @NotNull final String connectTimeout,
                                               @NotNull final String socketTimeout,
                                               @NotNull final String keepAlive,
                                               @NotNull final String connectionsMaxPerRoot,
                                               @NotNull final String connectionsMaxTotal); @NotNull static String getAuthHeaders(@NotNull final String authToken); @NotNull static String getQueryParams(@NotNull final String topQuery,
                                        @NotNull final String selectQuery,
                                        @NotNull String oDataQuery); @NotNull static String getQueryParams(@NotNull final String selectQuery,
                                        @NotNull String oDataQuery); @NotNull static Map<String, String> getOperationResults(@NotNull final Map<String, String> result,
                                                          @NotNull final String successMessage,
                                                          final String failureMessage,
                                                          final String document);  }