use of com.microsoft.graph.core.MockBaseClient in project msgraph-sdk-java by microsoftgraph.
the class BaseCollectionPageTests method setUp.
@Before
public void setUp() throws Exception {
list = new ArrayList<String>();
list.add("Object1");
list.add("Object2");
list.add("Object3");
IBaseClient mBaseClient = new MockBaseClient();
mRequestBuilder = new MockRequestBuilder(mBaseClient, requestUrl);
baseCollectionPage = new BaseCollectionPage<String, IRequestBuilder>(list, mRequestBuilder) {
};
}
use of com.microsoft.graph.core.MockBaseClient in project msgraph-sdk-java by microsoftgraph.
the class BaseRequestTests method setUp.
@Before
public void setUp() throws Exception {
mAuthenticationProvider = new MockAuthenticationProvider();
mBaseClient = new MockBaseClient();
final ITestConnectionData data = new ITestConnectionData() {
@Override
public int getRequestCode() {
return 200;
}
@Override
public String getJsonResponse() {
return "{ \"id\": \"zzz\" }";
}
@Override
public Map<String, String> getHeaders() {
final HashMap<String, String> map = new HashMap<>();
map.put("Content-Type", "application/json");
return map;
}
};
MockHttpProvider mProvider = new MockHttpProvider(new MockSerializer(null, ""), mAuthenticationProvider, new MockExecutors(), new MockLogger());
mProvider.setConnectionFactory(new MockConnectionFactory(new MockConnection(data)));
mBaseClient.setHttpProvider(mProvider);
request = new BaseRequest("https://a.b.c", mBaseClient, null, null) {
};
}
use of com.microsoft.graph.core.MockBaseClient in project msgraph-sdk-java by microsoftgraph.
the class BaseStreamRequestTests method setUp.
@Before
public void setUp() throws Exception {
mAuthenticationProvider = new MockAuthenticationProvider();
mBaseClient = new MockBaseClient();
}
use of com.microsoft.graph.core.MockBaseClient in project msgraph-sdk-java by microsoftgraph.
the class BaseCollectionRequestTests method setUp.
@Before
public void setUp() throws Exception {
mAuthenticationProvider = new MockAuthenticationProvider();
mBaseClient = new MockBaseClient();
final ITestConnectionData data = new ITestConnectionData() {
@Override
public int getRequestCode() {
return 200;
}
@Override
public String getJsonResponse() {
return "{ \"id\": \"zzz\" }";
}
@Override
public Map<String, String> getHeaders() {
final HashMap<String, String> map = new HashMap<>();
map.put("Content-Type", "application/json");
return map;
}
};
MockHttpProvider mProvider = new MockHttpProvider(new MockSerializer(null, ""), mAuthenticationProvider, new MockExecutors(), new MockLogger());
mProvider.setConnectionFactory(new MockConnectionFactory(new MockConnection(data)));
mBaseClient.setHttpProvider(mProvider);
request = new BaseCollectionRequest<JsonObject, String>("https://a.b.c", mBaseClient, null, JsonObject.class, null) {
};
}
Aggregations