Skip to content

Commit

Permalink
fix(tests): set order of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed May 4, 2023
1 parent 33c6565 commit 816f9d6
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import app.revanced.patcher.data.Context
import app.revanced.patcher.patch.*
import app.revanced.utils.Options
import app.revanced.utils.Options.setOptions
import org.junit.jupiter.api.MethodOrderer
import org.junit.jupiter.api.Order
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestMethodOrder

class PatchOptionsTestPatch : BytecodePatch() {
override fun execute(context: BytecodeContext): PatchResult {
Expand All @@ -27,15 +30,18 @@ class PatchOptionsTestPatch : BytecodePatch() {
}
}

@TestMethodOrder(MethodOrderer.OrderAnnotation::class)
internal object PatchOptionOptionsTest {
private var patches = listOf(PatchOptionsTestPatch::class.java as Class<out Patch<Context>>)

@Test
@Order(1)
fun serializeTest() {
assert(SERIALIZED_JSON == Options.serialize(patches))
}

@Test
@Order(2)
fun loadOptionsTest() {
patches.setOptions(CHANGED_JSON)

Expand All @@ -48,5 +54,4 @@ internal object PatchOptionOptionsTest {

private const val CHANGED_JSON =
"[{\"patchName\":\"PatchOptionsTestPatch\",\"options\":[{\"key\":\"key1\",\"value\":\"test\"},{\"key\":\"key2\",\"value\":false}]}]"

}

0 comments on commit 816f9d6

Please sign in to comment.