Skip to content

Commit

Permalink
Add more integration tests to suite
Browse files Browse the repository at this point in the history
  • Loading branch information
lijamie98 committed Oct 31, 2023
1 parent 8f0c30c commit 384621f
Show file tree
Hide file tree
Showing 16 changed files with 92 additions and 4,753 deletions.
13 changes: 9 additions & 4 deletions integration-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,15 @@ dependencies {
testImplementation(libs.dotenv)
}

tasks {
bootJar { enabled = false }
}
tasks { bootJar { enabled = false } }

apply(from = "$rootDir/scripts.gradle.kts")

@Suppress("UNCHECKED_CAST")
val enableTestConcurrency = extra["enableTestConcurrency"] as (Test) -> Unit

tasks.test {
enableTestConcurrency(this)
exclude("**/org/stellar/anchor/platform/*Test.class")
}
exclude("**/org/stellar/anchor/platform/subtest/**")
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ open class AbstractIntegrationTest(private val config: TestConfig) {
}

val testProfileRunner = TestProfileExecutor(config)
lateinit var sep6Tests: Sep6Tests
lateinit var platformApiCustodyTests: PlatformApiCustodyTests
lateinit var stellarObserverTests: StellarObserverTests
lateinit var custodyApiTests: CustodyApiTests
lateinit var eventProcessingServerTests: EventProcessingServerTests
lateinit var sep24E2eTests: Sep24End2EndTests
lateinit var sep24RpcE2eTests: Sep24RpcEnd2EndTests
lateinit var sep24CustodyE2eTests: Sep24CustodyEnd2EndTests
Expand All @@ -58,17 +55,14 @@ open class AbstractIntegrationTest(private val config: TestConfig) {
// Get JWT
val jwt = auth()

sep6Tests = Sep6Tests(toml)
platformApiCustodyTests = PlatformApiCustodyTests(config, toml, jwt)
stellarObserverTests = StellarObserverTests()
custodyApiTests = CustodyApiTests(config, toml, jwt)
sep24E2eTests = Sep24End2EndTests(config, jwt)
sep24CustodyE2eTests = Sep24CustodyEnd2EndTests(config, jwt)
sep24RpcE2eTests = Sep24RpcEnd2EndTests(config, jwt)
sep24CustodyRpcE2eTests = Sep24CustodyRpcEnd2EndTests(config, jwt)
sep31RpcE2eTests = Sep31RpcEnd2EndTests(config, toml, jwt)
sep31CustodyRpcE2eTests = Sep31CustodyRpcEnd2EndTests(config, toml, jwt)
eventProcessingServerTests = EventProcessingServerTests(config, toml, jwt)
}

private suspend fun auth(): String {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import java.time.format.DateTimeFormatter
import java.util.*
import java.util.concurrent.TimeUnit
import okhttp3.OkHttpClient
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.*
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertThrows
import org.junit.jupiter.api.parallel.Execution
import org.junit.jupiter.api.parallel.ExecutionMode
import org.skyscreamer.jsonassert.JSONAssert
import org.stellar.anchor.api.callback.GetCustomerRequest
import org.stellar.anchor.api.callback.GetFeeRequest
Expand All @@ -25,10 +25,11 @@ import org.stellar.anchor.platform.TestConfig
import org.stellar.anchor.platform.callback.RestCustomerIntegration
import org.stellar.anchor.platform.callback.RestFeeIntegration
import org.stellar.anchor.platform.callback.RestRateIntegration
import org.stellar.anchor.platform.test.testCustomer1Json
import org.stellar.anchor.platform.test.testCustomer2Json
import org.stellar.anchor.util.GsonUtils

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@Execution(ExecutionMode.SAME_THREAD)
@TestMethodOrder(MethodOrderer.OrderAnnotation::class)
class CallbackApiTests : SepTests(TestConfig(testProfileName = "default")) {

companion object {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
package org.stellar.anchor.platform.test
package org.stellar.anchor.platform.subtest

import org.junit.jupiter.api.Test
import org.stellar.anchor.api.event.AnchorEvent
import org.stellar.anchor.event.EventService.EventQueue.TRANSACTION
import org.stellar.anchor.platform.TestConfig
import org.stellar.anchor.platform.config.PropertyEventConfig
import org.stellar.anchor.platform.event.DefaultEventService
import org.stellar.anchor.util.GsonUtils
import org.stellar.anchor.util.Sep1Helper

class EventProcessingServerTests(config: TestConfig, toml: Sep1Helper.TomlContent, jwt: String) {
class EventProcessingServerTests : SepTests(TestConfig(testProfileName = "default")) {
companion object {
val eventConfig =
GsonUtils.getInstance().fromJson(eventConfigJson, PropertyEventConfig::class.java)!!
}

@Test
fun testOk() {
val eventService = DefaultEventService(eventConfig)
val session = eventService.createSession("testOk", TRANSACTION)
val quoteEvent = GsonUtils.getInstance().fromJson(testQuoteEvent, AnchorEvent::class.java)

session.publish(quoteEvent)
}
fun testAll() {
println("Performing event processing server tests...")
testOk()
}
}

val testQuoteEvent =
Expand Down
Loading

0 comments on commit 384621f

Please sign in to comment.