Fixed issue #46: Remote Actor should be defined by target class and UUID
This commit is contained in:
parent
805fac6ebb
commit
f5b9e9804f
12 changed files with 138 additions and 94 deletions
|
|
@ -26,7 +26,7 @@ class BasicAuthenticatorSpec extends junit.framework.TestCase
|
|||
@Test def testChallenge = {
|
||||
val req = mock[ContainerRequest]
|
||||
|
||||
val result: Response = (authenticator !? Authenticate(req, List("foo")))
|
||||
val result: Response = (authenticator !! (Authenticate(req, List("foo")), 10000)).get
|
||||
|
||||
// the actor replies with a challenge for the browser
|
||||
result.getStatus must equal(Response.Status.UNAUTHORIZED.getStatusCode)
|
||||
|
|
@ -41,7 +41,7 @@ class BasicAuthenticatorSpec extends junit.framework.TestCase
|
|||
// fake a request authorization -> this will authorize the user
|
||||
when(req.isUserInRole("chef")).thenReturn(true)
|
||||
|
||||
val result: AnyRef = (authenticator !? Authenticate(req, List("chef")))
|
||||
val result: AnyRef = (authenticator !! (Authenticate(req, List("chef")), 10000)).get
|
||||
|
||||
result must be(OK)
|
||||
// the authenticator must have set a security context
|
||||
|
|
@ -55,7 +55,7 @@ class BasicAuthenticatorSpec extends junit.framework.TestCase
|
|||
when(req.getHeaderValue("Authorization")).thenReturn("Basic " + new String(Base64.encode("foo:bar")))
|
||||
when(req.isUserInRole("chef")).thenReturn(false) // this will deny access
|
||||
|
||||
val result: Response = (authenticator !? Authenticate(req, List("chef")))
|
||||
val result: Response = (authenticator !! (Authenticate(req, List("chef")), 10000)).get
|
||||
|
||||
result.getStatus must equal(Response.Status.FORBIDDEN.getStatusCode)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue