Skip to content

Commit

Permalink
Merge branch 'master' into with_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
seblm committed Aug 28, 2023
2 parents c7f4160 + bb06862 commit 4ff8943
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 35 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/scala-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- name: Check out the repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Start MYSQL and import DB
run: |
Expand All @@ -29,13 +29,12 @@ jobs:
mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} < ${GITHUB_WORKSPACE}/database/initDatabase.sql
- name: Set up Java
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- uses: coursier/cache-action@v6
cache: 'sbt'

- name: Build and test
working-directory: scala
run: sbt clean test
run: sbt test
2 changes: 1 addition & 1 deletion scala/.scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
maxColumn = 120
runner.dialect = scala213
version = 3.4.3
version = 3.7.12
22 changes: 11 additions & 11 deletions scala/build.sbt
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
ThisBuild / scalaVersion := "2.13.8"
ThisBuild / scalaVersion := "2.13.11"

lazy val root = (project in file("."))
.settings(
name := "lift-pass-pricing",
description := "Lift-Pass-Pricing refactoring kata",

libraryDependencies += "com.typesafe.akka" %% "akka-actor-typed" % "2.6.19",
libraryDependencies += "com.typesafe.akka" %% "akka-http" % "10.2.9",
libraryDependencies += "com.typesafe.akka" %% "akka-http-spray-json" % "10.2.9",
libraryDependencies += "com.typesafe.akka" %% "akka-stream" % "2.6.19",
libraryDependencies += "org.apache.pekko" %% "pekko-actor-typed" % "1.0.1",
libraryDependencies += "org.apache.pekko" %% "pekko-http" % "1.0.0",
libraryDependencies += "org.apache.pekko" %% "pekko-http-spray-json" % "1.0.0",
libraryDependencies += "org.apache.pekko" %% "pekko-stream" % "1.0.1",

libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.2.11" % Runtime,
libraryDependencies += "mysql" % "mysql-connector-java" % "8.0.28" % Runtime,
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.4.7" % Runtime,
libraryDependencies += "mysql" % "mysql-connector-java" % "8.0.33" % Runtime,

libraryDependencies += "com.typesafe.akka" %% "akka-actor-testkit-typed" % "2.6.19" % Test,
libraryDependencies += "com.typesafe.akka" %% "akka-http-testkit" % "10.2.9" % Test,
libraryDependencies += "com.typesafe.akka" %% "akka-stream-testkit" % "2.6.19" % Test,
libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.11" % Test
libraryDependencies += "org.apache.pekko" %% "pekko-actor-testkit-typed" % "1.0.1" % Test,
libraryDependencies += "org.apache.pekko" %% "pekko-http-testkit" % "1.0.0" % Test,
libraryDependencies += "org.scalatest" %% "scalatest-shouldmatchers" % "3.2.16" % Test,
libraryDependencies += "org.scalatest" %% "scalatest-funspec" % "3.2.16" % Test
)
2 changes: 1 addition & 1 deletion scala/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 1.6.2
sbt.version = 1.9.4
1 change: 1 addition & 0 deletions scala/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0")
5 changes: 3 additions & 2 deletions scala/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<configuration>

<!-- This is a development logging configuration that logs to standard out, for an example of a production
logging config, see the Pekko docs: https://pekko.apache.org/docs/pekko/current/typed/logging.html#logback -->
<appender name="STDOUT" target="System.out" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[%date{ISO8601}] [%level] [%logger] [%thread] [%X{akkaSource}] - %msg%n</pattern>
<pattern>[%date{ISO8601}] [%level] [%logger] [%thread] [%X{pekkoSource}] - %msg%n</pattern>
</encoder>
</appender>

Expand Down
10 changes: 5 additions & 5 deletions scala/src/main/scala/liftpasspricing/LiftPassPricing.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package liftpasspricing

import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
import akka.http.scaladsl.model.ContentTypes.`application/json`
import akka.http.scaladsl.model.HttpEntity
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.Route
import liftpasspricing.JsonFormats._
import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
import org.apache.pekko.http.scaladsl.model.ContentTypes.`application/json`
import org.apache.pekko.http.scaladsl.model.HttpEntity
import org.apache.pekko.http.scaladsl.server.Directives._
import org.apache.pekko.http.scaladsl.server.Route

import java.sql.{Connection, DriverManager}
import java.time.LocalDate
Expand Down
8 changes: 4 additions & 4 deletions scala/src/main/scala/liftpasspricing/WebServer.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package liftpasspricing

import akka.actor.typed.ActorSystem
import akka.actor.typed.scaladsl.Behaviors
import akka.http.scaladsl.Http
import akka.http.scaladsl.server.Route
import org.apache.pekko.actor.typed.ActorSystem
import org.apache.pekko.actor.typed.scaladsl.Behaviors
import org.apache.pekko.http.scaladsl.Http
import org.apache.pekko.http.scaladsl.server.Route

import scala.util.{Failure, Success}

Expand Down
5 changes: 3 additions & 2 deletions scala/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<configuration>

<!-- This is a development logging configuration that logs to standard out, for an example of a production
logging config, see the Pekko docs: https://pekko.apache.org/docs/pekko/current/typed/logging.html#logback -->
<appender name="STDOUT" target="System.out" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[%date{ISO8601}] [%level] [%logger] [%thread] [%X{akkaSource}] - %msg%n</pattern>
<pattern>[%date{ISO8601}] [%level] [%logger] [%thread] [%X{pekkoSource}] - %msg%n</pattern>
</encoder>
</appender>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package liftpasspricing

import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
import akka.http.scaladsl.model.StatusCodes.OK
import akka.http.scaladsl.server.Route
import akka.http.scaladsl.testkit.ScalatestRouteTest
import liftpasspricing.JsonFormats._
import org.apache.pekko.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
import org.apache.pekko.http.scaladsl.model.StatusCodes.OK
import org.apache.pekko.http.scaladsl.server.Route
import org.apache.pekko.http.scaladsl.testkit.ScalatestRouteTest
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers._

Expand Down

0 comments on commit 4ff8943

Please sign in to comment.