Skip to content

Commit 110ddf1

Browse files
committed
AWS V2 init
1 parent e6d8d72 commit 110ddf1

File tree

7 files changed

+20
-29
lines changed

7 files changed

+20
-29
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ crossVersion := CrossVersion.binary
77
val akkaVersion = "2.5.25"
88
val amzVersion = "2.10.65"
99

10-
scalacOptions += "-target:8"
10+
scalacOptions += "-target:jvm-1.8"
1111

1212
libraryDependencies ++= Seq(
1313
"software.amazon.awssdk" % "dynamodb" % amzVersion,

src/test/scala/akka/persistence/dynamodb/journal/AsyncDynamoDBJournalSpec.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ object AsyncDynamoDBJournalSpec {
2424
| "java.io.Serializable" = test
2525
| }
2626
|}
27-
""".stripMargin
28-
).withFallback(ConfigFactory.load())
27+
""".stripMargin).withFallback(ConfigFactory.load())
2928

3029
}
3130

src/test/scala/akka/persistence/dynamodb/journal/BackwardsCompatibilityV1Spec.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,15 @@ class BackwardsCompatibilityV1Spec extends TestKit(ActorSystem("PartialAsyncSeri
6363
"ChEIARINrO0ABXQABmEtMDAxNxARGg9PbGRGb3JtYXRFdmVudHNqJDI5NWZhMTE2LWZhOTUtNGY1Yi1hZjk2LTgwZDk4NjFhODk4ZA==",
6464
"ChEIARINrO0ABXQABmEtMDAxOBASGg9PbGRGb3JtYXRFdmVudHNqJDI5NWZhMTE2LWZhOTUtNGY1Yi1hZjk2LTgwZDk4NjFhODk4ZA==",
6565
"ChEIARINrO0ABXQABmEtMDAxORATGg9PbGRGb3JtYXRFdmVudHNqJDI5NWZhMTE2LWZhOTUtNGY1Yi1hZjk2LTgwZDk4NjFhODk4ZA==",
66-
"ChEIARINrO0ABXQABmEtMDAyMBAUGg9PbGRGb3JtYXRFdmVudHNqJDI5NWZhMTE2LWZhOTUtNGY1Yi1hZjk2LTgwZDk4NjFhODk4ZA=="
67-
)
66+
"ChEIARINrO0ABXQABmEtMDAyMBAUGg9PbGRGb3JtYXRFdmVudHNqJDI5NWZhMTE2LWZhOTUtNGY1Yi1hZjk2LTgwZDk4NjFhODk4ZA==")
6867

6968
val table = dynamoDB.getTable(tableName)
7069

7170
def createItem(number: Int, data: String): Unit = {
7271
table.putItem(
7372
new Item()
7473
.withPrimaryKey("par", persistenceId, "num", number)
75-
.withBinary("pay", Base64.getDecoder.decode(data))
76-
)
74+
.withBinary("pay", Base64.getDecoder.decode(data)))
7775
}
7876

7977
for {

src/test/scala/akka/persistence/dynamodb/journal/FailureReportingSpec.scala

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class FailureReportingSpec extends TestKit(ActorSystem("FailureReportingSpec"))
6262
.withFallback(ConfigFactory.load())
6363
implicit val system = ActorSystem("FailureReportingSpec-test1", config)
6464
try
65-
EventFilter[ResourceNotFoundException](pattern = ".*ThisTableDoesNotExist.*", occurrences = 1).intercept {
65+
EventFilter[ResourceNotFoundException](pattern = ".*ThisTableDoesNotExist.*", occurrences = 1).intercept {
6666
Persistence(system).journalFor("")
6767
}
6868
finally system.terminate()
@@ -75,13 +75,13 @@ class FailureReportingSpec extends TestKit(ActorSystem("FailureReportingSpec"))
7575
implicit val system = ActorSystem("FailureReportingSpec-test2", config)
7676
try {
7777
val journal =
78-
EventFilter[ResourceNotFoundException](pattern = ".*ThisTableDoesNotExist.*", occurrences = 1).intercept {
79-
EventFilter.error(pattern = ".*requests will fail.*ThisTableDoesNotExist.*", occurrences = 1).intercept {
78+
EventFilter[ResourceNotFoundException](pattern = ".*ThisTableDoesNotExist.*", occurrences = 1).intercept {
79+
EventFilter.error(pattern = ".*requests will fail.*ThisTableDoesNotExist.*", occurrences = 1).intercept {
8080
Persistence(system).journalFor("")
8181
}
8282
}
83-
EventFilter[ResourceNotFoundException](pattern = ".*BatchGetItemRequest.*", occurrences = 1).intercept {
84-
EventFilter[DynamoDBJournalFailure](pattern = s".*failed.*read-highest-sequence-number.*$persistenceId.*", occurrences = 1).intercept {
83+
EventFilter[ResourceNotFoundException](pattern = ".*BatchGetItemRequest.*", occurrences = 1).intercept {
84+
EventFilter[DynamoDBJournalFailure](pattern = s".*failed.*read-highest-sequence-number.*$persistenceId.*", occurrences = 1).intercept {
8585
journal ! ReplayMessages(0, Long.MaxValue, 0, persistenceId, testActor)
8686
expectMsgType[ReplayMessagesFailure]
8787
}
@@ -95,7 +95,7 @@ class FailureReportingSpec extends TestKit(ActorSystem("FailureReportingSpec"))
9595
.withFallback(ConfigFactory.load())
9696
implicit val system = ActorSystem("FailureReportingSpec-test3", config)
9797
try
98-
EventFilter.info(pattern = ".*protocol:https.*", occurrences = 1).intercept {
98+
EventFilter.info(pattern = ".*protocol:https.*", occurrences = 1).intercept {
9999
Persistence(system).journalFor("")
100100
}
101101
finally system.terminate()
@@ -116,7 +116,7 @@ akka.loggers = ["akka.testkit.TestEventListener"]
116116
try {
117117
val probe = TestProbe()
118118
system.eventStream.subscribe(probe.ref, classOf[Logging.LogEvent])
119-
EventFilter[ResourceNotFoundException](pattern = ".*akka-persistence.*", occurrences = 1).intercept {
119+
EventFilter[ResourceNotFoundException](pattern = ".*akka-persistence.*", occurrences = 1).intercept {
120120
Persistence(system).journalFor("")
121121
}
122122
probe.expectMsgType[Logging.Error].message.toString should include("DescribeTableRequest(akka-persistence)")
@@ -132,21 +132,21 @@ akka.loggers = ["akka.testkit.TestEventListener"]
132132
implicit val system = ActorSystem("FailureReportingSpec-test5", config)
133133
try {
134134
val journal =
135-
EventFilter[ResourceNotFoundException](pattern = ".*ThisTableDoesNotExist.*", occurrences = 1).intercept {
136-
EventFilter.error(pattern = ".*requests will fail.*ThisTableDoesNotExist.*", occurrences = 1).intercept {
135+
EventFilter[ResourceNotFoundException](pattern = ".*ThisTableDoesNotExist.*", occurrences = 1).intercept {
136+
EventFilter.error(pattern = ".*requests will fail.*ThisTableDoesNotExist.*", occurrences = 1).intercept {
137137
Persistence(system).journalFor("")
138138
}
139139
}
140140

141141
val msgs = (1 to 3).map(i => persistentRepr(f"w-$i"))
142142

143-
EventFilter[ResourceNotFoundException](pattern = ".*ThisTableDoesNotExist.*", occurrences = 1).intercept {
143+
EventFilter[ResourceNotFoundException](pattern = ".*ThisTableDoesNotExist.*", occurrences = 1).intercept {
144144
journal ! WriteMessages(AtomicWrite(msgs(0)) :: Nil, testActor, 42)
145145
expectMsgType[WriteMessagesFailed].cause shouldBe a[DynamoDBJournalFailure]
146146
expectFailure[DynamoDBJournalFailure]("ThisTableDoesNotExist", msgs(0))
147147
}
148148

149-
EventFilter[ResourceNotFoundException](pattern = ".*ThisTableDoesNotExist.*", occurrences = 1).intercept {
149+
EventFilter[ResourceNotFoundException](pattern = ".*ThisTableDoesNotExist.*", occurrences = 1).intercept {
150150
journal ! WriteMessages(AtomicWrite(msgs(1)) :: AtomicWrite(msgs(2)) :: Nil, testActor, 42)
151151
expectMsgType[WriteMessagesFailed].cause shouldBe a[DynamoDBJournalFailure]
152152
expectFailure[DynamoDBJournalFailure]("ThisTableDoesNotExist", msgs(1))

src/test/scala/akka/persistence/dynamodb/journal/PartialAsyncSerializationSpec.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ object PartialAsyncSerializationSpec {
2727
| "akka.persistence.dynamodb.journal.SerializeAsync" = test
2828
| }
2929
|}
30-
""".stripMargin
31-
).withFallback(ConfigFactory.load())
30+
""".stripMargin).withFallback(ConfigFactory.load())
3231
}
3332

3433
class PartialAsyncSerializationSpec extends TestKit(ActorSystem("PartialAsyncSerializationSpec", PartialAsyncSerializationSpec.config))

src/test/scala/akka/persistence/dynamodb/snapshot/DynamoDBUtils.scala

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,15 @@ trait DynamoDBUtils {
3737
.withAttributeDefinitions(
3838
new AttributeDefinition().withAttributeName(Key).withAttributeType("S"),
3939
new AttributeDefinition().withAttributeName(SequenceNr).withAttributeType("N"),
40-
new AttributeDefinition().withAttributeName(Timestamp).withAttributeType("N")
41-
)
40+
new AttributeDefinition().withAttributeName(Timestamp).withAttributeType("N"))
4241
.withKeySchema(
4342
new KeySchemaElement().withAttributeName(Key).withKeyType(KeyType.HASH),
44-
new KeySchemaElement().withAttributeName(SequenceNr).withKeyType(KeyType.RANGE)
45-
)
43+
new KeySchemaElement().withAttributeName(SequenceNr).withKeyType(KeyType.RANGE))
4644
.withLocalSecondaryIndexes(
4745
new LocalSecondaryIndex()
4846
.withIndexName(TimestampIndex).withKeySchema(
4947
new KeySchemaElement().withAttributeName(Key).withKeyType(KeyType.HASH),
50-
new KeySchemaElement().withAttributeName(Timestamp).withKeyType(KeyType.RANGE)
51-
).withProjection(new Projection().withProjectionType(ProjectionType.ALL))
52-
)
48+
new KeySchemaElement().withAttributeName(Timestamp).withKeyType(KeyType.RANGE)).withProjection(new Projection().withProjectionType(ProjectionType.ALL)))
5349

5450
def ensureSnapshotTableExists(read: Long = 10L, write: Long = 10L): Unit = {
5551
val create = schema

src/test/scala/akka/persistence/dynamodb/snapshot/SnapshotStoreTckSpec.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ import com.typesafe.config.{ Config, ConfigFactory }
1414
import scala.collection.immutable.Seq
1515

1616
class SnapshotStoreTckSpec extends SnapshotStoreSpec(
17-
ConfigFactory.load()
18-
) with DynamoDBUtils {
17+
ConfigFactory.load()) with DynamoDBUtils {
1918
override def beforeAll(): Unit = {
2019
super.beforeAll()
2120
ensureSnapshotTableExists()

0 commit comments

Comments
 (0)