projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
🔀 Merge bugfix/too-long-urls
[Sone.git]
/
src
/
test
/
kotlin
/
net
/
pterodactylus
/
sone
/
test
/
Matchers.kt
diff --git
a/src/test/kotlin/net/pterodactylus/sone/test/Matchers.kt
b/src/test/kotlin/net/pterodactylus/sone/test/Matchers.kt
index
85ed9e7
..
ecb2049
100644
(file)
--- a/
src/test/kotlin/net/pterodactylus/sone/test/Matchers.kt
+++ b/
src/test/kotlin/net/pterodactylus/sone/test/Matchers.kt
@@
-1,11
+1,11
@@
package net.pterodactylus.sone.test
import freenet.support.*
package net.pterodactylus.sone.test
import freenet.support.*
+import net.pterodactylus.sone.data.Post
import net.pterodactylus.sone.freenet.wot.*
import net.pterodactylus.sone.utils.*
import net.pterodactylus.util.web.*
import org.hamcrest.*
import net.pterodactylus.sone.freenet.wot.*
import net.pterodactylus.sone.utils.*
import net.pterodactylus.util.web.*
import org.hamcrest.*
-import org.hamcrest.Matchers
import org.hamcrest.Matchers.*
/**
import org.hamcrest.Matchers.*
/**
@@
-107,6
+107,9
@@
fun hasField(name: String, valueMatcher: Matcher<String>) = object : TypeSafeDia
}
}
}
}
+fun isPost(isRecipientId: Matcher<String?> = any(String::class.java)) = AttributeMatcher<Post>("post")
+ .addAttribute("recipient ID", { it.recipientId.orNull() }, isRecipientId)
+
/**
* [TypeSafeDiagnosingMatcher] implementation that aims to cut down boilerplate on verifying the attributes
* of typical container objects.
/**
* [TypeSafeDiagnosingMatcher] implementation that aims to cut down boilerplate on verifying the attributes
* of typical container objects.