projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add unit test for version command
[Sone.git]
/
src
/
test
/
kotlin
/
net
/
pterodactylus
/
sone
/
fcp
/
LikePostCommandTest.kt
diff --git
a/src/test/kotlin/net/pterodactylus/sone/fcp/LikePostCommandTest.kt
b/src/test/kotlin/net/pterodactylus/sone/fcp/LikePostCommandTest.kt
index
f88e138
..
86fb586
100644
(file)
--- a/
src/test/kotlin/net/pterodactylus/sone/fcp/LikePostCommandTest.kt
+++ b/
src/test/kotlin/net/pterodactylus/sone/fcp/LikePostCommandTest.kt
@@
-17,7
+17,7
@@
import org.mockito.Mockito.verify
*/
class LikePostCommandTest : SoneCommandTest() {
*/
class LikePostCommandTest : SoneCommandTest() {
- private val post = createPost("PostId", mock<Sone>(),
null, 1000, "Text")
+ private val post = createPost("PostId", mock<Sone>(), null, 1000, "Text")
override fun createCommand(core: Core) = LikePostCommand(core)
override fun createCommand(core: Core) = LikePostCommand(core)
@@
-29,8
+29,13
@@
class LikePostCommandTest : SoneCommandTest() {
}
@Test
}
@Test
+ fun `command requires write access`() {
+ assertThat(command.requiresWriteAccess(), equalTo(true))
+ }
+
+ @Test
fun `request without parameters results in FCP exception`() {
fun `request without parameters results in FCP exception`() {
- requestWithoutAnyParameterResultsInFcpException()
+
requestWithoutAnyParameterResultsInFcpException()
}
@Test
}
@Test
@@
-42,7
+47,7
@@
class LikePostCommandTest : SoneCommandTest() {
@Test
fun `request with missing local sone results in FCP exception`() {
@Test
fun `request with missing local sone results in FCP exception`() {
- parameters += "Post" to "PostId"
+
parameters += "Post" to "PostId"
expectedException.expect(FcpException::class.java)
command.execute(parameters)
}
expectedException.expect(FcpException::class.java)
command.execute(parameters)
}