Skip to content

Commit 4084955

Browse files
committed
test: make repeatable
1 parent a62f08f commit 4084955

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

src/test/kotlin/integration/CommandParseTest.kt

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package integration
1919
import io.vertx.core.json.JsonObject
2020
import org.junit.jupiter.api.Test
2121
import spp.cli.Main
22+
import java.util.*
2223

2324
class CommandParseTest : CLIIntegrationTest() {
2425

@@ -30,32 +31,34 @@ class CommandParseTest : CLIIntegrationTest() {
3031
Main.main(
3132
"-v admin get-developers".split(" ").toTypedArray()
3233
)
34+
val newDev = UUID.randomUUID().toString().replace("-", "")
3335
Main.main(
34-
"-v admin add-developer test".split(" ").toTypedArray()
36+
"-v admin add-developer $newDev".split(" ").toTypedArray()
3537
)
3638
Main.main(
37-
"-v admin refresh-authorization-code test".split(" ").toTypedArray()
39+
"-v admin refresh-authorization-code $newDev".split(" ").toTypedArray()
3840
)
3941
Main.main(
4042
"-v admin get-roles".split(" ").toTypedArray()
4143
)
4244
Main.main(
4345
"-v admin get-role-permissions role_manager".split(" ").toTypedArray()
4446
)
47+
val newRole = UUID.randomUUID().toString().replace("-", "")
4548
Main.main(
46-
"-v admin add-role tester".split(" ").toTypedArray()
49+
"-v admin add-role $newRole".split(" ").toTypedArray()
4750
)
4851
Main.main(
49-
"-v admin add-role-permission tester ADD_DEVELOPER".split(" ").toTypedArray()
52+
"-v admin add-role-permission $newRole ADD_DEVELOPER".split(" ").toTypedArray()
5053
)
5154
Main.main(
52-
"-v admin add-developer-role test tester".split(" ").toTypedArray()
55+
"-v admin add-developer-role $newDev $newRole".split(" ").toTypedArray()
5356
)
5457
Main.main(
55-
"-v admin get-developer-roles test".split(" ").toTypedArray()
58+
"-v admin get-developer-roles $newDev".split(" ").toTypedArray()
5659
)
5760
Main.main(
58-
"-v admin get-developer-permissions test".split(" ").toTypedArray()
61+
"-v admin get-developer-permissions $newDev".split(" ").toTypedArray()
5962
)
6063

6164
val origOut = System.out
@@ -74,28 +77,28 @@ class CommandParseTest : CLIIntegrationTest() {
7477
"-v admin get-access-permissions".split(" ").toTypedArray()
7578
)
7679
Main.main(
77-
"-v admin get-developer-access-permissions test".split(" ").toTypedArray()
80+
"-v admin get-developer-access-permissions $newDev".split(" ").toTypedArray()
7881
)
7982
Main.main(
80-
"-v admin get-role-access-permissions tester".split(" ").toTypedArray()
83+
"-v admin get-role-access-permissions $newRole".split(" ").toTypedArray()
8184
)
8285
Main.main(
83-
"-v admin remove-role-access-permission tester $accessPermissionId".split(" ").toTypedArray()
86+
"-v admin remove-role-access-permission $newRole $accessPermissionId".split(" ").toTypedArray()
8487
)
8588
Main.main(
8689
"-v admin remove-access-permission $accessPermissionId".split(" ").toTypedArray()
8790
)
8891
Main.main(
89-
"-v admin remove-developer-role test tester".split(" ").toTypedArray()
92+
"-v admin remove-developer-role $newDev $newRole".split(" ").toTypedArray()
9093
)
9194
Main.main(
92-
"-v admin remove-role-permission tester ADD_DEVELOPER".split(" ").toTypedArray()
95+
"-v admin remove-role-permission $newRole ADD_DEVELOPER".split(" ").toTypedArray()
9396
)
9497
Main.main(
95-
"-v admin remove-role tester".split(" ").toTypedArray()
98+
"-v admin remove-role $newRole".split(" ").toTypedArray()
9699
)
97100
Main.main(
98-
"-v admin remove-developer test".split(" ").toTypedArray()
101+
"-v admin remove-developer $newDev".split(" ").toTypedArray()
99102
)
100103
Main.main(
101104
"-v add breakpoint -h 100 spp.example.webapp.model.User 48".split(" ").toTypedArray()

0 commit comments

Comments
 (0)