File tree Expand file tree Collapse file tree 5 files changed +31
-19
lines changed
src/main/kotlin/by/jprof/telegram/bot/utils/aws_junit5
src/test/kotlin/by/jprof/telegram/bot/votes/dynamodb/dao Expand file tree Collapse file tree 5 files changed +31
-19
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ enableFeaturePreview("VERSION_CATALOGS")
33rootProject.name = " jprof_by_bot"
44
55include(" :utils:dynamodb" )
6+ include(" :utils:aws-junit5" )
67include(" :votes" )
78include(" :votes:dynamodb" )
89include(" :votes:tgbotapi-extensions" )
Original file line number Diff line number Diff line change 1+ plugins {
2+ kotlin(" jvm" )
3+ }
4+
5+ dependencies {
6+ api(libs.aws.junit5.dynamo.v2)
7+ }
Original file line number Diff line number Diff line change 1+ package by.jprof.telegram.bot.utils.aws_junit5
2+
3+ import me.madhead.aws_junit5.common.AWSEndpoint
4+
5+ class Endpoint : AWSEndpoint {
6+ override fun url (): String {
7+ return System .getenv(" DYNAMODB_URL" )
8+ }
9+
10+ override fun region (): String {
11+ return System .getenv(" AWS_DEFAULT_REGION" )
12+ }
13+
14+ override fun accessKey (): String {
15+ return System .getenv(" AWS_ACCESS_KEY_ID" )
16+ }
17+
18+ override fun secretKey (): String {
19+ return System .getenv(" AWS_SECRET_ACCESS_KEY" )
20+ }
21+ }
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ dependencies {
1111 testImplementation(libs.junit.jupiter.api)
1212 testImplementation(libs.junit.jupiter.params)
1313 testImplementation(libs.aws.junit5.dynamo.v2)
14+ testImplementation(project.projects.utils.awsJunit5)
1415 testRuntimeOnly(libs.junit.jupiter.engine)
1516}
1617
Original file line number Diff line number Diff line change 11package by.jprof.telegram.bot.votes.dynamodb.dao
22
3+ import by.jprof.telegram.bot.utils.aws_junit5.Endpoint
34import by.jprof.telegram.bot.votes.model.Votes
45import kotlinx.coroutines.runBlocking
56import me.madhead.aws_junit5.common.AWSClient
6- import me.madhead.aws_junit5.common.AWSEndpoint
77import me.madhead.aws_junit5.dynamo.v2.DynamoDB
88import org.junit.jupiter.api.*
99import org.junit.jupiter.api.extension.ExtendWith
@@ -46,22 +46,4 @@ internal class VotesDAOTest {
4646 " User2" to " -" ,
4747 )
4848 )
49-
50- class Endpoint : AWSEndpoint {
51- override fun url (): String {
52- return System .getenv(" DYNAMODB_URL" )
53- }
54-
55- override fun region (): String {
56- return System .getenv(" AWS_DEFAULT_REGION" )
57- }
58-
59- override fun accessKey (): String {
60- return System .getenv(" AWS_ACCESS_KEY_ID" )
61- }
62-
63- override fun secretKey (): String {
64- return System .getenv(" AWS_SECRET_ACCESS_KEY" )
65- }
66- }
6749}
You can’t perform that action at this time.
0 commit comments