Search in sources :

Example 11 with QueryOption

use of com.microsoft.graph.options.QueryOption in project msgraph-sdk-java by microsoftgraph.

the class BaseRequestTests method testQueryParameters.

@Test
public void testQueryParameters() {
    final Option q1 = new QueryOption("q1", "option1 ");
    final Option q2 = new QueryOption("q2", "option2");
    final BaseRequest request = new BaseRequest("https://a.b.c", null, Arrays.asList(q1, q2), null) {
    };
    assertEquals("https://a.b.c?q1=option1+&q2=option2", request.getRequestUrl().toString());
    request.addQueryOption(new QueryOption("q3", "option3"));
    assertEquals("https://a.b.c?q1=option1+&q2=option2&q3=option3", request.getRequestUrl().toString());
    assertEquals(4, request.getOptions().size());
}
Also used : QueryOption(com.microsoft.graph.options.QueryOption) QueryOption(com.microsoft.graph.options.QueryOption) Option(com.microsoft.graph.options.Option) FunctionOption(com.microsoft.graph.options.FunctionOption) HeaderOption(com.microsoft.graph.options.HeaderOption) Test(org.junit.Test)

Aggregations

QueryOption (com.microsoft.graph.options.QueryOption)11 Option (com.microsoft.graph.options.Option)9 Test (org.junit.Test)6 FunctionOption (com.microsoft.graph.options.FunctionOption)5 LinkedList (java.util.LinkedList)4 ClientException (com.microsoft.graph.core.ClientException)3 HeaderOption (com.microsoft.graph.options.HeaderOption)3 ICallback (com.microsoft.graph.concurrency.ICallback)2 User (com.microsoft.graph.extensions.User)2 ISiteCollectionPage (com.microsoft.graph.requests.extensions.ISiteCollectionPage)2 SharedPreferences (android.content.SharedPreferences)1 DirectoryObject (com.microsoft.graph.extensions.DirectoryObject)1 IDirectoryObjectCollectionWithReferencesPage (com.microsoft.graph.extensions.IDirectoryObjectCollectionWithReferencesPage)1 IUserCollectionPage (com.microsoft.graph.extensions.IUserCollectionPage)1 PasswordProfile (com.microsoft.graph.extensions.PasswordProfile)1 ProfilePhoto (com.microsoft.graph.extensions.ProfilePhoto)1 EmailAddress (com.microsoft.graph.models.extensions.EmailAddress)1 Message (com.microsoft.graph.models.extensions.Message)1 Recipient (com.microsoft.graph.models.extensions.Recipient)1 User (com.microsoft.graph.models.extensions.User)1