use of com.microsoft.graph.options.Option in project msgraph-sdk-java by microsoftgraph.
the class SharePointTests method setUp.
@Before
public void setUp() {
testBase = new TestBase();
List<Option> requestOptions = new LinkedList<Option>();
requestOptions.add(new QueryOption("search", "Contoso"));
ISiteCollectionPage sites = testBase.graphClient.sites().buildRequest(requestOptions).get();
testSite = sites.getCurrentPage().get(0);
}
use of com.microsoft.graph.options.Option in project msgraph-sdk-java by microsoftgraph.
the class BaseCollectionRequestTests method testQueryParameters.
@Test
public void testQueryParameters() {
final Option q1 = new QueryOption("q1", "option1 ");
final Option q2 = new QueryOption("q2", "option2");
final BaseCollectionRequest<String, String> request = new BaseCollectionRequest<String, String>("https://a.b.c", null, Arrays.asList(q1, q2), null, 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());
}
use of com.microsoft.graph.options.Option in project msgraph-sdk-java by microsoftgraph.
the class BaseCollectionRequestTests method testFunctionParameters.
@Test
public void testFunctionParameters() {
final Option f1 = new FunctionOption("1", "one");
final Option f2 = new FunctionOption("2", null);
final BaseCollectionRequest<String, String> request = new BaseCollectionRequest<String, String>("https://a.b.c", null, Arrays.asList(f1, f2), null, null) {
};
String urlTest = request.getRequestUrl().toString();
assertEquals("https://a.b.c(1='one',2=null)", request.getRequestUrl().toString());
request.addFunctionOption(new FunctionOption("3", "two"));
;
assertEquals("https://a.b.c(1='one',2=null,3='two')", request.getRequestUrl().toString());
assertEquals(4, request.getOptions().size());
}
use of com.microsoft.graph.options.Option in project msgraph-sdk-java by microsoftgraph.
the class BaseRequestTests method testFunctionParameters.
@Test
public void testFunctionParameters() {
final Option fo1 = new FunctionOption("1", "one");
final Option fo2 = new FunctionOption("2", null);
final BaseRequest request = new BaseRequest("https://a.b.c", null, Arrays.asList(fo1, fo2), null) {
};
assertEquals("https://a.b.c(1='one',2=null)", request.getRequestUrl().toString());
request.addFunctionOption(new FunctionOption("3", "two"));
;
assertEquals("https://a.b.c(1='one',2=null,3='two')", request.getRequestUrl().toString());
assertEquals(4, request.getOptions().size());
}
use of com.microsoft.graph.options.Option in project msgraph-sdk-java by microsoftgraph.
the class BaseRequestTests method testProtectedProperties.
@Test
public void testProtectedProperties() {
assertEquals(0, request.functionOptions.size());
assertEquals(0, request.queryOptions.size());
final Option q1 = new QueryOption("q1", "option1 ");
final Option f1 = new FunctionOption("f1", "option2");
final BaseRequest request = new BaseRequest("https://a.b.c", null, Arrays.asList(q1, f1), null) {
};
assertEquals(1, request.functionOptions.size());
assertEquals(1, request.queryOptions.size());
assertEquals("q1", request.queryOptions.get(0).getName());
assertEquals("option1 ", request.queryOptions.get(0).getValue());
assertEquals("f1", request.functionOptions.get(0).getName());
assertEquals("option2", request.functionOptions.get(0).getValue());
}
Aggregations