Skip to content

Commit a959610

Browse files
authored
Build changes
1 parent 077dccb commit a959610

File tree

7 files changed

+35
-18
lines changed

7 files changed

+35
-18
lines changed

.travis.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,13 @@ install:
3030
- docker run -it -v "$PWD":/tmp -w /tmp composer/composer:1-alpine install
3131

3232
script:
33-
- sbt coverage assembly
34-
- sbt run > log.txt &
35-
- bash <(curl -s https://raw.githubusercontent.com/s12v/wait4port/master/wait4port.sh) localhost:9911 localhost:9324
33+
- sbt coverage test coverageReport
34+
- sbt assembly
35+
- java -jar $(ls $TRAVIS_BUILD_DIR/target/scala-2.11/sns-*.jar | tail -1) > log.txt &
36+
- >
37+
bash <(curl -s https://raw.githubusercontent.com/s12v/wait4port/master/wait4port.sh)
38+
http://localhost:9911
39+
http://localhost:9324
3640
- bundle exec cucumber
3741
- >
3842
docker run -it

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ EXPOSE 9911
55

66
VOLUME /etc/sns
77

8-
ENV DB_PATH=/etc/sns/db.json VERSION=0.0.2
8+
ENV DB_PATH=/etc/sns/db.json VERSION=0.1.0
99

1010
ADD https://github.com/s12v/sns/releases/download/$VERSION/sns-$VERSION.jar /sns.jar
1111

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[![Build Status](https://travis-ci.org/s12v/sns.svg?branch=master)](https://travis-ci.org/s12v/sns)
2-
# SNS
2+
[![codecov](https://codecov.io/gh/s12v/sns/branch/master/graph/badge.svg)](https://codecov.io/gh/s12v/sns)
3+
# Fake SNS
34

45
Fake Amazon Simple Notification Service (SNS) for testing. Supports:
56
- Create/List/Delete topics
@@ -20,7 +21,7 @@ docker run -d -p 9911:9911 -v example:/etc/sns s12v/sns
2021

2122
Download the latest release from https://github.com/s12v/sns/releases and run:
2223
```
23-
DB_PATH=/tmp/db.json java -jar sns-0.0.1.jar
24+
DB_PATH=/tmp/db.json java -jar sns-0.1.0.jar
2425
```
2526
Requires Java8.
2627

build.sbt

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
name := "sns"
22

3-
version := "0.0.2"
3+
version := "0.1.0"
44

55
scalaVersion := "2.11.8"
66

7+
// sbt-assembly
78
assemblyJarName in assembly := s"sns-${version.value}.jar"
9+
test in assembly := {}
810

911
libraryDependencies ++= {
10-
val akkaVersion = "2.4.6"
12+
val akkaVersion = "2.4.7"
13+
val camelVersion = "2.17.0"
1114

1215
Seq(
1316
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
1417
"com.typesafe.akka" %% "akka-stream" % akkaVersion,
1518
"com.typesafe.akka" %% "akka-http-experimental" % akkaVersion,
1619
"com.typesafe.akka" %% "akka-http-xml-experimental" % akkaVersion,
17-
"com.typesafe.akka" %% "akka-http-spray-json-experimental" % akkaVersion,
20+
"com.typesafe.akka" %% "akka-http-spray-json-experimental" % akkaVersion
21+
,
1822
"com.typesafe.akka" %% "akka-http-testkit" % akkaVersion % Test,
1923

2024
"org.slf4j" % "slf4j-api" % "1.7.2",
2125
"ch.qos.logback" % "logback-classic" % "1.0.7",
22-
"com.typesafe.akka" %% "akka-camel" % "2.3.15",
23-
"org.apache.camel" % "camel-aws" % "2.17.0"
26+
"com.typesafe.akka" %% "akka-camel" % akkaVersion,
27+
"org.apache.camel" % "camel-aws" % camelVersion
2428
exclude("com.amazonaws", "aws-java-sdk-acm")
2529
exclude("com.amazonaws", "aws-java-sdk-api-gateway")
2630
exclude("com.amazonaws", "aws-java-sdk-autoscaling")
@@ -76,10 +80,11 @@ libraryDependencies ++= {
7680
exclude("com.amazonaws", "aws-java-sdk-elasticbeanstalk")
7781
exclude("com.amazonaws", "aws-java-sdk-ecr")
7882
,
79-
"org.apache.camel" % "camel-http" % "2.17.0",
80-
"org.apache.camel" % "camel-rabbitmq" % "2.17.0",
81-
"org.apache.camel" % "camel-slack" % "2.17.0",
82-
83-
"org.scalatest" %% "scalatest" % "2.2.6" % Test
83+
"org.apache.camel" % "camel-http" % camelVersion,
84+
"org.apache.camel" % "camel-rabbitmq" % camelVersion,
85+
"org.apache.camel" % "camel-slack" % camelVersion
86+
exclude("junit", "junit")
87+
,
88+
"org.scalatest" %% "scalatest" % "2.2.6" % Test
8489
)
8590
}

project/plugins.sbt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.3.5")
21
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.3")
2+
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.3.5")
3+
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.2")

src/main/scala/me/snov/sns/api/TopicApi.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ object TopicApi {
3838
case _ => HttpResponse(404, entity = "NotFound")
3939
}
4040
}
41-
case _ => complete(HttpResponse(400, entity = "Invalid topic name"))
41+
case _ => complete(HttpResponse(400, entity = "Invalid topic ARN"))
4242
} ~
4343
complete(HttpResponse(404, entity = "NotFound"))
4444
} ~

src/test/scala/me/snov/sns/api/TopicSpec.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ class TopicSpec extends WordSpec with Matchers with ScalatestRouteTest {
2929
}
3030
}
3131

32+
"TopicDelete validates topic name" in {
33+
Post("/", FormData(Map("Action" -> "DeleteTopic", "TopicArn" -> "f$$"))) ~> route ~> check {
34+
status shouldBe StatusCodes.BadRequest
35+
}
36+
}
37+
3238
"Sends create command to actor" in {
3339
probe.setAutoPilot(new TestActor.AutoPilot {
3440
def run(sender: ActorRef, msg: Any) = {

0 commit comments

Comments
 (0)