[OLINGO-684] Try a local client for the OAuth test

This commit is contained in:
Christian Amend 2015-06-03 15:45:15 +02:00
parent 7ce457d82b
commit 0090e02075
1 changed files with 11 additions and 4 deletions

View File

@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@ -59,6 +59,13 @@ public class OAuth2TestITCase extends AbstractTestITCase {
client.getConfiguration().setHttpClientFactory(new DefaultHttpClientFactory());
}
protected ODataClient getLocalClient() {
ODataClient localClient = ODataClientFactory.getClient();
localClient.getConfiguration().setHttpClientFactory(
new CXFOAuth2HttpClientFactory(OAUTH2_GRANT_SERVICE_URI, OAUTH2_TOKEN_SERVICE_URI));
return localClient;
}
protected EdmEnabledODataClient getEdmClient() {
if (_edmClient == null) {
_edmClient = ODataClientFactory.getEdmEnabledClient(testOAuth2ServiceRootURL);
@ -94,12 +101,12 @@ public class OAuth2TestITCase extends AbstractTestITCase {
@Test
public void readAsAtom() {
read(client, ODataFormat.ATOM);
read(getLocalClient(), ODataFormat.ATOM);
}
@Test
public void readAsFullJSON() {
read(client, ODataFormat.JSON_FULL_METADATA);
read(getLocalClient(), ODataFormat.JSON_FULL_METADATA);
}
@Test