Commit ca13e85c authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Update PermissionInteractorTest.kt

parent 78866288
...@@ -52,7 +52,7 @@ class PermissionInteractorTest { ...@@ -52,7 +52,7 @@ class PermissionInteractorTest {
@Test @Test
fun isAllowedReturnsFalseWhenWithoutCurrentUser() { fun isAllowedReturnsFalseWhenWithoutCurrentUser() {
`when`(userRepository.current) `when`(userRepository.getCurrent())
.thenReturn(Flowable.just(Optional.absent())) .thenReturn(Flowable.just(Optional.absent()))
val testObserver = TestObserver<Boolean>() val testObserver = TestObserver<Boolean>()
...@@ -67,7 +67,7 @@ class PermissionInteractorTest { ...@@ -67,7 +67,7 @@ class PermissionInteractorTest {
fun isAllowedReturnsFalseWhenWithoutRoomRoleAndPermission() { fun isAllowedReturnsFalseWhenWithoutRoomRoleAndPermission() {
val permissionId = "permission" val permissionId = "permission"
`when`(userRepository.current) `when`(userRepository.getCurrent())
.thenReturn(Flowable.just(Optional.of(user))) .thenReturn(Flowable.just(Optional.of(user)))
`when`(roomRoleRepository.getFor(any(Room::class.java), any(User::class.java))) `when`(roomRoleRepository.getFor(any(Room::class.java), any(User::class.java)))
...@@ -88,7 +88,7 @@ class PermissionInteractorTest { ...@@ -88,7 +88,7 @@ class PermissionInteractorTest {
fun isAllowedReturnsFalseWhenWithoutRoomRole() { fun isAllowedReturnsFalseWhenWithoutRoomRole() {
val permissionId = "permission" val permissionId = "permission"
`when`(userRepository.current) `when`(userRepository.getCurrent())
.thenReturn(Flowable.just(Optional.of(user))) .thenReturn(Flowable.just(Optional.of(user)))
`when`(roomRoleRepository.getFor(any(Room::class.java), any(User::class.java))) `when`(roomRoleRepository.getFor(any(Room::class.java), any(User::class.java)))
...@@ -109,7 +109,7 @@ class PermissionInteractorTest { ...@@ -109,7 +109,7 @@ class PermissionInteractorTest {
fun isAllowedReturnsFalseWhenWithoutPermission() { fun isAllowedReturnsFalseWhenWithoutPermission() {
val permissionId = "permission" val permissionId = "permission"
`when`(userRepository.current) `when`(userRepository.getCurrent())
.thenReturn(Flowable.just(Optional.of(user))) .thenReturn(Flowable.just(Optional.of(user)))
`when`(roomRoleRepository.getFor(any(Room::class.java), any(User::class.java))) `when`(roomRoleRepository.getFor(any(Room::class.java), any(User::class.java)))
...@@ -131,7 +131,7 @@ class PermissionInteractorTest { ...@@ -131,7 +131,7 @@ class PermissionInteractorTest {
val permissionId = "permission" val permissionId = "permission"
`when`(userRepository.current) `when`(userRepository.getCurrent())
.thenReturn(Flowable.just(Optional.of(user))) .thenReturn(Flowable.just(Optional.of(user)))
`when`(roomRoleRepository.getFor(any(Room::class.java), any(User::class.java))) `when`(roomRoleRepository.getFor(any(Room::class.java), any(User::class.java)))
...@@ -153,7 +153,7 @@ class PermissionInteractorTest { ...@@ -153,7 +153,7 @@ class PermissionInteractorTest {
val permissionId = "permission" val permissionId = "permission"
`when`(userRepository.current) `when`(userRepository.getCurrent())
.thenReturn(Flowable.just(Optional.of(user))) .thenReturn(Flowable.just(Optional.of(user)))
`when`(roomRole.roles).thenReturn(getSomeRoles()) `when`(roomRole.roles).thenReturn(getSomeRoles())
...@@ -179,7 +179,7 @@ class PermissionInteractorTest { ...@@ -179,7 +179,7 @@ class PermissionInteractorTest {
val permissionId = "permission" val permissionId = "permission"
`when`(userRepository.current) `when`(userRepository.getCurrent())
.thenReturn(Flowable.just(Optional.of(user))) .thenReturn(Flowable.just(Optional.of(user)))
`when`(roomRole.roles).thenReturn(getMoreRoles()) `when`(roomRole.roles).thenReturn(getMoreRoles())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment