Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
293d6225
Commit
293d6225
authored
Aug 30, 2017
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix errors on older tests
parent
6f58807f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
EditMessageInteractorTest.kt
...chat/rocket/core/interactors/EditMessageInteractorTest.kt
+7
-7
PermissionInteractorTest.kt
.../chat/rocket/core/interactors/PermissionInteractorTest.kt
+7
-7
No files found.
rocket-chat-core/src/test/java/chat/rocket/core/interactors/EditMessageInteractorTest.kt
View file @
293d6225
...
...
@@ -67,7 +67,7 @@ class EditMessageInteractorTest {
val
allowEdit
=
allowEditPublicSettings
(
true
)
val
allowEditTimeout
=
allowEditTimeLimitPublicSetting
()
`when`
(
userRepository
.
current
).
thenReturn
(
Flowable
.
just
(
Optional
.
of
(
user
)))
`when`
(
userRepository
.
getCurrent
()
).
thenReturn
(
Flowable
.
just
(
Optional
.
of
(
user
)))
`when`
(
publicSettingRepository
.
getById
(
PublicSettingsConstants
.
Message
.
ALLOW_EDITING
))
.
thenReturn
(
Single
.
just
(
Optional
.
of
(
allowEdit
)))
`when`
(
publicSettingRepository
.
getById
(
PublicSettingsConstants
.
Message
.
ALLOW_EDITING_BLOCK_TIMEOUT
))
...
...
@@ -93,7 +93,7 @@ class EditMessageInteractorTest {
val
allowEdit
=
allowEditPublicSettings
(
false
)
val
allowEditTimeout
=
allowEditTimeLimitPublicSetting
()
`when`
(
userRepository
.
current
).
thenReturn
(
Flowable
.
just
(
Optional
.
of
(
user
)))
`when`
(
userRepository
.
getCurrent
()
).
thenReturn
(
Flowable
.
just
(
Optional
.
of
(
user
)))
`when`
(
publicSettingRepository
.
getById
(
PublicSettingsConstants
.
Message
.
ALLOW_EDITING
))
.
thenReturn
(
Single
.
just
(
Optional
.
of
(
allowEdit
)))
`when`
(
publicSettingRepository
.
getById
(
PublicSettingsConstants
.
Message
.
ALLOW_EDITING_BLOCK_TIMEOUT
))
...
...
@@ -123,7 +123,7 @@ class EditMessageInteractorTest {
val
allowEdit
=
allowEditPublicSettings
(
true
)
val
allowEditTimeout
=
allowEditTimeLimitPublicSetting
(
1
)
`when`
(
userRepository
.
current
).
thenReturn
(
Flowable
.
just
(
Optional
.
of
(
user
)))
`when`
(
userRepository
.
getCurrent
()
).
thenReturn
(
Flowable
.
just
(
Optional
.
of
(
user
)))
`when`
(
publicSettingRepository
.
getById
(
PublicSettingsConstants
.
Message
.
ALLOW_EDITING
))
.
thenReturn
(
Single
.
just
(
Optional
.
of
(
allowEdit
)))
`when`
(
publicSettingRepository
.
getById
(
PublicSettingsConstants
.
Message
.
ALLOW_EDITING_BLOCK_TIMEOUT
))
...
...
@@ -155,7 +155,7 @@ class EditMessageInteractorTest {
val
anotherUser
=
mock
(
User
::
class
.
java
)
`when`
(
anotherUser
.
id
).
thenReturn
(
"another id"
)
`when`
(
userRepository
.
current
).
thenReturn
(
Flowable
.
just
(
Optional
.
of
(
anotherUser
)))
`when`
(
userRepository
.
getCurrent
()
).
thenReturn
(
Flowable
.
just
(
Optional
.
of
(
anotherUser
)))
`when`
(
publicSettingRepository
.
getById
(
PublicSettingsConstants
.
Message
.
ALLOW_EDITING
))
.
thenReturn
(
Single
.
just
(
Optional
.
of
(
allowEdit
)))
`when`
(
publicSettingRepository
.
getById
(
PublicSettingsConstants
.
Message
.
ALLOW_EDITING_BLOCK_TIMEOUT
))
...
...
@@ -184,7 +184,7 @@ class EditMessageInteractorTest {
val
allowEdit
=
allowEditPublicSettings
(
true
)
val
allowEditTimeout
=
allowEditTimeLimitPublicSetting
()
`when`
(
userRepository
.
current
).
thenReturn
(
Flowable
.
just
(
Optional
.
of
(
user
)))
`when`
(
userRepository
.
getCurrent
()
).
thenReturn
(
Flowable
.
just
(
Optional
.
of
(
user
)))
`when`
(
publicSettingRepository
.
getById
(
PublicSettingsConstants
.
Message
.
ALLOW_EDITING
))
.
thenReturn
(
Single
.
just
(
Optional
.
of
(
allowEdit
)))
`when`
(
publicSettingRepository
.
getById
(
PublicSettingsConstants
.
Message
.
ALLOW_EDITING_BLOCK_TIMEOUT
))
...
...
@@ -213,7 +213,7 @@ class EditMessageInteractorTest {
val
allowEdit
=
allowEditPublicSettings
(
true
)
val
allowEditTimeout
=
allowEditTimeLimitPublicSetting
()
`when`
(
userRepository
.
current
).
thenReturn
(
Flowable
.
just
(
Optional
.
of
(
user
)))
`when`
(
userRepository
.
getCurrent
()
).
thenReturn
(
Flowable
.
just
(
Optional
.
of
(
user
)))
`when`
(
publicSettingRepository
.
getById
(
PublicSettingsConstants
.
Message
.
ALLOW_EDITING
))
.
thenReturn
(
Single
.
just
(
Optional
.
of
(
allowEdit
)))
`when`
(
publicSettingRepository
.
getById
(
PublicSettingsConstants
.
Message
.
ALLOW_EDITING_BLOCK_TIMEOUT
))
...
...
@@ -242,7 +242,7 @@ class EditMessageInteractorTest {
val
allowEdit
=
allowEditPublicSettings
(
false
)
val
allowEditTimeout
=
allowEditTimeLimitPublicSetting
()
`when`
(
userRepository
.
current
).
thenReturn
(
Flowable
.
just
(
Optional
.
of
(
user
)))
`when`
(
userRepository
.
getCurrent
()
).
thenReturn
(
Flowable
.
just
(
Optional
.
of
(
user
)))
`when`
(
publicSettingRepository
.
getById
(
PublicSettingsConstants
.
Message
.
ALLOW_EDITING
))
.
thenReturn
(
Single
.
just
(
Optional
.
of
(
allowEdit
)))
`when`
(
publicSettingRepository
.
getById
(
PublicSettingsConstants
.
Message
.
ALLOW_EDITING_BLOCK_TIMEOUT
))
...
...
rocket-chat-core/src/test/java/chat/rocket/core/interactors/PermissionInteractorTest.kt
View file @
293d6225
...
...
@@ -52,7 +52,7 @@ class PermissionInteractorTest {
@Test
fun
isAllowedReturnsFalseWhenWithoutCurrentUser
()
{
`when`
(
userRepository
.
current
)
`when`
(
userRepository
.
getCurrent
()
)
.
thenReturn
(
Flowable
.
just
(
Optional
.
absent
()))
val
testObserver
=
TestObserver
<
Boolean
>()
...
...
@@ -67,7 +67,7 @@ class PermissionInteractorTest {
fun
isAllowedReturnsFalseWhenWithoutRoomRoleAndPermission
()
{
val
permissionId
=
"permission"
`when`
(
userRepository
.
current
)
`when`
(
userRepository
.
getCurrent
()
)
.
thenReturn
(
Flowable
.
just
(
Optional
.
of
(
user
)))
`when`
(
roomRoleRepository
.
getFor
(
any
(
Room
::
class
.
java
),
any
(
User
::
class
.
java
)))
...
...
@@ -88,7 +88,7 @@ class PermissionInteractorTest {
fun
isAllowedReturnsFalseWhenWithoutRoomRole
()
{
val
permissionId
=
"permission"
`when`
(
userRepository
.
current
)
`when`
(
userRepository
.
getCurrent
()
)
.
thenReturn
(
Flowable
.
just
(
Optional
.
of
(
user
)))
`when`
(
roomRoleRepository
.
getFor
(
any
(
Room
::
class
.
java
),
any
(
User
::
class
.
java
)))
...
...
@@ -109,7 +109,7 @@ class PermissionInteractorTest {
fun
isAllowedReturnsFalseWhenWithoutPermission
()
{
val
permissionId
=
"permission"
`when`
(
userRepository
.
current
)
`when`
(
userRepository
.
getCurrent
()
)
.
thenReturn
(
Flowable
.
just
(
Optional
.
of
(
user
)))
`when`
(
roomRoleRepository
.
getFor
(
any
(
Room
::
class
.
java
),
any
(
User
::
class
.
java
)))
...
...
@@ -131,7 +131,7 @@ class PermissionInteractorTest {
val
permissionId
=
"permission"
`when`
(
userRepository
.
current
)
`when`
(
userRepository
.
getCurrent
()
)
.
thenReturn
(
Flowable
.
just
(
Optional
.
of
(
user
)))
`when`
(
roomRoleRepository
.
getFor
(
any
(
Room
::
class
.
java
),
any
(
User
::
class
.
java
)))
...
...
@@ -153,7 +153,7 @@ class PermissionInteractorTest {
val
permissionId
=
"permission"
`when`
(
userRepository
.
current
)
`when`
(
userRepository
.
getCurrent
()
)
.
thenReturn
(
Flowable
.
just
(
Optional
.
of
(
user
)))
`when`
(
roomRole
.
roles
).
thenReturn
(
getSomeRoles
())
...
...
@@ -179,7 +179,7 @@ class PermissionInteractorTest {
val
permissionId
=
"permission"
`when`
(
userRepository
.
current
)
`when`
(
userRepository
.
getCurrent
()
)
.
thenReturn
(
Flowable
.
just
(
Optional
.
of
(
user
)))
`when`
(
roomRole
.
roles
).
thenReturn
(
getMoreRoles
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment