Skip to content

Commit

Permalink
test: fixed mirror test with new Bugsnag method name
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlongridge committed Mar 29, 2022
1 parent f3e35c4 commit a427799
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ import java.lang.reflect.Method
* signatures, and fails if the two are out of sync.
*
* This is intended to catch the case where a new API is added to one class but not the other.
* If a method genuinely only needs to be present on one of the classes, it can be added to a
* blacklist via [bugsnagBlacklist] or [clientBlacklist].
* If a method genuinely only needs to be present on one of the classes, it should be added to
* [bugsnagAllowList] or [clientAllowList].
*/
class BugsnagClientMirrorInterfaceTest {

private val bugsnagBlacklist = setOf("start", "getClient")
private val clientBlacklist = setOf(
private val bugsnagAllowList = setOf(
"start",
"getClient",
"isStarted"
)

private val clientAllowList = setOf(
"update",
"notifyObservers",
"addObserver",
Expand All @@ -35,14 +40,14 @@ class BugsnagClientMirrorInterfaceTest {
@Test
fun bugsnagHasSameMethodsAsClient() {
val methods = clientMethods.subtract(bugsnagMethods)
.filter { !clientBlacklist.contains(it.name) }
.filter { !clientAllowList.contains(it.name) }
assertTrue("Bugsnag is missing the following methods: $methods", methods.isEmpty())
}

@Test
fun clientHasSameMethodsAsBugsnag() {
val methods = bugsnagMethods.subtract(clientMethods)
.filter { !bugsnagBlacklist.contains(it.name) }
.filter { !bugsnagAllowList.contains(it.name) }
assertTrue("Client is missing the following methods: $methods", methods.isEmpty())
}
}

0 comments on commit a427799

Please sign in to comment.