Removed tests. included watch patterns for ktor auto reloading. Returned proper responses upon transaction failures.
This commit is contained in:
parent
76bf6f2847
commit
9252b2fee5
@ -1,4 +1,3 @@
|
|||||||
val kotlin_version: String by project
|
|
||||||
val logback_version: String by project
|
val logback_version: String by project
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
@ -33,6 +32,4 @@ dependencies {
|
|||||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.1")
|
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.1")
|
||||||
implementation("org.slf4j:slf4j-api:2.0.16")
|
implementation("org.slf4j:slf4j-api:2.0.16")
|
||||||
implementation("com.zaxxer:HikariCP:6.0.0")
|
implementation("com.zaxxer:HikariCP:6.0.0")
|
||||||
testImplementation("io.ktor:ktor-server-test-host-jvm")
|
|
||||||
testImplementation("org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version")
|
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ class NeftRequestProcessor {
|
|||||||
|
|
||||||
if (!isDCCBCodeMigrated(dccbCode)) {
|
if (!isDCCBCodeMigrated(dccbCode)) {
|
||||||
logDCCBCodeNotMigrated(transactionNumber)
|
logDCCBCodeNotMigrated(transactionNumber)
|
||||||
return OutwardNeftResponse(0, "dccb code not migrated", null, null)
|
return OutwardNeftResponse(0, "DCCB NOT MIGRATED", null, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
val teller = TellerDao().getTeller(dccbCode, branchCode)
|
val teller = TellerDao().getTeller(dccbCode, branchCode)
|
||||||
@ -42,7 +42,7 @@ class NeftRequestProcessor {
|
|||||||
executeAndProcessTransaction(transactionNumber, transactionRequest, transactionPair)
|
executeAndProcessTransaction(transactionNumber, transactionRequest, transactionPair)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
logger.error("TXN: #{} FAILED REASON: {}", transactionNumber, e.toString())
|
logger.error("TXN: #{} FAILED REASON: {}", transactionNumber, e.toString())
|
||||||
OutwardNeftResponse(0, e.message ?: "", null, null)
|
OutwardNeftResponse(0, "ERROR OCCURRED DURING PROCESSING", null, null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ class NeftRequestProcessor {
|
|||||||
OutwardNeftResponse(1, "transaction successful", transferQueueNumber, neftQueueNumber)
|
OutwardNeftResponse(1, "transaction successful", transferQueueNumber, neftQueueNumber)
|
||||||
} else {
|
} else {
|
||||||
logTransactionFailure(transactionNumber, transferResponse, neftResponse)
|
logTransactionFailure(transactionNumber, transferResponse, neftResponse)
|
||||||
OutwardNeftResponse(0, "transaction failed", null, null)
|
OutwardNeftResponse(0, "TRANSACTION FAILED", null, null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ ktor {
|
|||||||
environment = ${KTOR_ENV}
|
environment = ${KTOR_ENV}
|
||||||
deployment {
|
deployment {
|
||||||
port = 8083
|
port = 8083
|
||||||
|
watch = [ classes ]
|
||||||
}
|
}
|
||||||
application {
|
application {
|
||||||
modules = [ net.ipksindia.ApplicationKt.module ]
|
modules = [ net.ipksindia.ApplicationKt.module ]
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
package net.ipksindia
|
|
||||||
|
|
||||||
import io.ktor.client.request.*
|
|
||||||
import io.ktor.client.statement.*
|
|
||||||
import io.ktor.http.*
|
|
||||||
import io.ktor.server.testing.*
|
|
||||||
import kotlin.test.*
|
|
||||||
import net.ipksindia.plugins.*
|
|
||||||
|
|
||||||
class ApplicationTest {
|
|
||||||
@Test
|
|
||||||
fun testRoot() = testApplication {
|
|
||||||
application {
|
|
||||||
configureRouting()
|
|
||||||
}
|
|
||||||
client.get("/").apply {
|
|
||||||
assertEquals(HttpStatusCode.OK, status)
|
|
||||||
assertEquals("Hello World!", bodyAsText())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user