use of com.microsoft.graph.authentication.MockAuthenticationProvider 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.authentication.MockAuthenticationProvider in project msgraph-sdk-java by microsoftgraph.
the class DefaultClientConfigTests method setUp.
@Before
public void setUp() throws Exception {
mAuthenticationProvider = new MockAuthenticationProvider();
mClientConfig = DefaultClientConfig.createWithAuthenticationProvider(mAuthenticationProvider);
}
use of com.microsoft.graph.authentication.MockAuthenticationProvider 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.authentication.MockAuthenticationProvider 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) {
};
}
use of com.microsoft.graph.authentication.MockAuthenticationProvider in project msgraph-sdk-java by microsoftgraph.
the class BaseClientTests method setUp.
@Before
public void setUp() throws Exception {
baseClient = new BaseClient() {
@Override
public String getServiceRoot() {
return mEndpoint;
}
@Override
public void setServiceRoot(String value) {
mEndpoint = value;
}
};
mAuthenticationProvider = new MockAuthenticationProvider();
mExecutors = new MockExecutors();
mHttpProvider = new MockHttpProvider();
mLogger = new MockLogger();
mSerializer = new MockSerializer(null, "");
}
Aggregations