mirror of
https://github.com/revanced/revanced-cli.git
synced 2025-01-21 08:27:31 +01:00
fix(tests): set order of tests
This commit is contained in:
parent
da2c91874d
commit
2ef48af1b3
@ -5,7 +5,10 @@ import app.revanced.patcher.data.Context
|
|||||||
import app.revanced.patcher.patch.*
|
import app.revanced.patcher.patch.*
|
||||||
import app.revanced.utils.Options
|
import app.revanced.utils.Options
|
||||||
import app.revanced.utils.Options.setOptions
|
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.Test
|
||||||
|
import org.junit.jupiter.api.TestMethodOrder
|
||||||
|
|
||||||
class PatchOptionsTestPatch : BytecodePatch() {
|
class PatchOptionsTestPatch : BytecodePatch() {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
@ -27,15 +30,18 @@ class PatchOptionsTestPatch : BytecodePatch() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMethodOrder(MethodOrderer.OrderAnnotation::class)
|
||||||
internal object PatchOptionOptionsTest {
|
internal object PatchOptionOptionsTest {
|
||||||
private var patches = listOf(PatchOptionsTestPatch::class.java as Class<out Patch<Context>>)
|
private var patches = listOf(PatchOptionsTestPatch::class.java as Class<out Patch<Context>>)
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Order(1)
|
||||||
fun serializeTest() {
|
fun serializeTest() {
|
||||||
assert(SERIALIZED_JSON == Options.serialize(patches))
|
assert(SERIALIZED_JSON == Options.serialize(patches))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Order(2)
|
||||||
fun loadOptionsTest() {
|
fun loadOptionsTest() {
|
||||||
patches.setOptions(CHANGED_JSON)
|
patches.setOptions(CHANGED_JSON)
|
||||||
|
|
||||||
@ -48,5 +54,4 @@ internal object PatchOptionOptionsTest {
|
|||||||
|
|
||||||
private const val CHANGED_JSON =
|
private const val CHANGED_JSON =
|
||||||
"[{\"patchName\":\"PatchOptionsTestPatch\",\"options\":[{\"key\":\"key1\",\"value\":\"test\"},{\"key\":\"key2\",\"value\":false}]}]"
|
"[{\"patchName\":\"PatchOptionsTestPatch\",\"options\":[{\"key\":\"key1\",\"value\":\"test\"},{\"key\":\"key2\",\"value\":false}]}]"
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user