mirror of https://github.com/apache/jclouds.git
fixed auth test
This commit is contained in:
parent
6141cdfca5
commit
3ddff73609
|
@ -53,6 +53,7 @@ import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
|
import java.util.Properties;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.SortedSet;
|
import java.util.SortedSet;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
@ -170,15 +171,16 @@ public abstract class BaseComputeServiceLiveTest extends BaseComputeServiceConte
|
||||||
client = view.getComputeService();
|
client = view.getComputeService();
|
||||||
}
|
}
|
||||||
|
|
||||||
// wait up to 5 seconds for an auth exception
|
|
||||||
@Test(enabled = true, expectedExceptions = AuthorizationException.class)
|
@Test(enabled = true, expectedExceptions = AuthorizationException.class)
|
||||||
public void testCorrectAuthException() throws Exception {
|
public void testCorrectAuthException() throws Exception {
|
||||||
ComputeServiceContext context = null;
|
ComputeServiceContext context = null;
|
||||||
try {
|
try {
|
||||||
|
Properties overrides = setupProperties();
|
||||||
|
overrides.setProperty(provider + ".identity", "MOMMA");
|
||||||
|
overrides.setProperty(provider + ".credential", "MIA");
|
||||||
context = newBuilder()
|
context = newBuilder()
|
||||||
.credentials("MOMMA", "MIA")
|
|
||||||
.modules(ImmutableSet.of(getLoggingModule(), credentialStoreModule))
|
.modules(ImmutableSet.of(getLoggingModule(), credentialStoreModule))
|
||||||
.overrides(setupProperties()).build(ComputeServiceContext.class);
|
.overrides(overrides).build(ComputeServiceContext.class);
|
||||||
context.getComputeService().listNodes();
|
context.getComputeService().listNodes();
|
||||||
} catch (AuthorizationException e) {
|
} catch (AuthorizationException e) {
|
||||||
throw e;
|
throw e;
|
||||||
|
|
Loading…
Reference in New Issue