From 2ef48af1b339ab729a05d69cb0c8c1ee1e3ab486 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Thu, 4 May 2023 02:24:33 +0200 Subject: [PATCH] fix(tests): set order of tests --- .../app/revanced/patcher/options/PatchOptionOptionsTest.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/test/kotlin/app/revanced/patcher/options/PatchOptionOptionsTest.kt b/src/test/kotlin/app/revanced/patcher/options/PatchOptionOptionsTest.kt index e89c91c..68759ee 100644 --- a/src/test/kotlin/app/revanced/patcher/options/PatchOptionOptionsTest.kt +++ b/src/test/kotlin/app/revanced/patcher/options/PatchOptionOptionsTest.kt @@ -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 { @@ -27,15 +30,18 @@ class PatchOptionsTestPatch : BytecodePatch() { } } +@TestMethodOrder(MethodOrderer.OrderAnnotation::class) internal object PatchOptionOptionsTest { private var patches = listOf(PatchOptionsTestPatch::class.java as Class>) @Test + @Order(1) fun serializeTest() { assert(SERIALIZED_JSON == Options.serialize(patches)) } @Test + @Order(2) fun loadOptionsTest() { patches.setOptions(CHANGED_JSON) @@ -48,5 +54,4 @@ internal object PatchOptionOptionsTest { private const val CHANGED_JSON = "[{\"patchName\":\"PatchOptionsTestPatch\",\"options\":[{\"key\":\"key1\",\"value\":\"test\"},{\"key\":\"key2\",\"value\":false}]}]" - } \ No newline at end of file