Skip to content

Commit

Permalink
Merge pull request #42 from hmrc/SASS-7493
Browse files Browse the repository at this point in the history
SASS-7493 - migrated to play 3.0
  • Loading branch information
WitchellJack authored Mar 26, 2024
2 parents ea14046 + 9fce941 commit 2dd2ca5
Show file tree
Hide file tree
Showing 17 changed files with 29 additions and 74 deletions.
25 changes: 12 additions & 13 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
* limitations under the License.
*/

import uk.gov.hmrc.DefaultBuildSettings.integrationTestSettings
import uk.gov.hmrc.sbtdistributables.SbtDistributablesPlugin.publishingSettings
import uk.gov.hmrc.DefaultBuildSettings

val appName = "income-tax-state-benefits"

lazy val coverageSettings: Seq[Setting[_]] = {
lazy val coverageSettings: Seq[Setting[?]] = {
import scoverage.ScoverageKeys

val excludedPackages = Seq(
Expand All @@ -45,24 +44,24 @@ lazy val coverageSettings: Seq[Setting[_]] = {
)
}

ThisBuild / majorVersion := 0
ThisBuild / scalaVersion := "2.13.12"

lazy val microservice = Project(appName, file("."))
.enablePlugins(play.sbt.PlayScala, SbtDistributablesPlugin)
.settings(
// To resolve a bug with version 2.x.x of the scoverage plugin - https://github.com/sbt/sbt/issues/6997
libraryDependencySchemes ++= Seq("org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always)
)
.settings(
majorVersion := 0,
scalaVersion := "2.13.10",
libraryDependencies ++= AppDependencies.compile ++ AppDependencies.test,
scalacOptions += "-Wconf:cat=unused-imports&src=html/.*:s",
scalacOptions += "-Wconf:src=routes/.*:s"
)
.settings(publishingSettings: _*)
.configs(IntegrationTest extend Test)
.settings(integrationTestSettings(): _*)
.settings(resolvers += Resolver.jcenterRepo)
.settings(PlayKeys.playDefaultPort := 9377)
.disablePlugins(sbt.plugins.JUnitXmlReportPlugin)
.disablePlugins(JUnitXmlReportPlugin)
.settings(coverageSettings: _*)
.settings(coverageSettings *)


lazy val it = project
.enablePlugins(PlayScala)
.dependsOn(microservice % "test->test") // the "test->test" allows reusing test code and test dependencies
.settings(DefaultBuildSettings.itSettings())
40 changes: 0 additions & 40 deletions conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,6 @@ include "backend.conf"

appName = income-tax-state-benefits

# Provides an implementation of AuditConnector. Use `uk.gov.hmrc.play.audit.AuditModule` or create your own.
# An audit connector must be provided.
play.modules.enabled += "uk.gov.hmrc.play.audit.AuditModule"

# Provides an implementation of MetricsFilter. Use `uk.gov.hmrc.play.graphite.GraphiteMetricsModule` or create your own.
# A metric filter must be provided
play.modules.enabled += "uk.gov.hmrc.play.bootstrap.graphite.GraphiteMetricsModule"

# Provides an implementation and configures all filters required by a Platform frontend microservice.
play.modules.enabled += "uk.gov.hmrc.play.bootstrap.backend.BackendModule"

# Default http client
play.modules.enabled += "uk.gov.hmrc.play.bootstrap.HttpClientModule"

Expand Down Expand Up @@ -67,29 +56,8 @@ controllers {

}

# Metrics plugin settings - graphite reporting is configured on a per env basis
metrics {
name = ${appName}
rateUnit = SECONDS
durationUnit = SECONDS
showSamples = true
jvm = true
enabled = false
}

# Microservice specific config

auditing {
enabled = true
traceRequests = true
consumer {
baseUri {
host = localhost
port = 8100
}
}
}

mongodb {
encryption.key = "QmFyMTIzNDVCYXIxMjM0NQ=="
uri = "mongodb://localhost:27017/"${appName}
Expand All @@ -99,14 +67,6 @@ mongodb {
useEncryption = false

microservice {
metrics {
graphite {
host = graphite
port = 2003
prefix = play.${appName}.
enabled = false
}
}

services {
auth {
Expand Down
1 change: 0 additions & 1 deletion conf/prod.routes
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
-> /income-tax-state-benefits app.Routes
-> / health.Routes

GET /admin/metrics com.kenshoo.play.metrics.MetricsController.metrics
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 9 additions & 12 deletions project/AppDependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,26 @@
* limitations under the License.
*/

import play.core.PlayVersion.current
import sbt._

import sbt.*

object AppDependencies {

private val bootstrapBackendPlay28Version = "7.15.0"
private val hmrcMongoPlay28Version = "1.1.0"
private val bootstrapBackendPlay30Version = "8.5.0"
private val hmrcMongoPlay30Version = "1.7.0"

val compile: Seq[ModuleID] = Seq(
"uk.gov.hmrc" %% "bootstrap-backend-play-28" % bootstrapBackendPlay28Version,
"uk.gov.hmrc.mongo" %% "hmrc-mongo-play-28" % hmrcMongoPlay28Version,
"uk.gov.hmrc" %% "bootstrap-backend-play-30" % bootstrapBackendPlay30Version,
"uk.gov.hmrc.mongo" %% "hmrc-mongo-play-30" % hmrcMongoPlay30Version,
"com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.14.2",
"org.typelevel" %% "cats-core" % "2.9.0"
)

val test: Seq[ModuleID] = Seq(
"uk.gov.hmrc" %% "bootstrap-test-play-28" % bootstrapBackendPlay28Version % "test, it",
"com.typesafe.play" %% "play-test" % current % Test,
"uk.gov.hmrc.mongo" %% "hmrc-mongo-test-play-28" % hmrcMongoPlay28Version % Test,
"uk.gov.hmrc" %% "bootstrap-test-play-30" % bootstrapBackendPlay30Version % Test,
"uk.gov.hmrc.mongo" %% "hmrc-mongo-test-play-30" % hmrcMongoPlay30Version % Test,
"org.scalamock" %% "scalamock" % "5.2.0" % Test,
"org.scalatest" %% "scalatest" % "3.2.15" % Test,
"com.vladsch.flexmark" % "flexmark-all" % "0.64.0" % "test, it",
"com.github.tomakehurst" % "wiremock-jre8" % "2.35.0" % "test, it"
"com.vladsch.flexmark" % "flexmark-all" % "0.64.0" % Test,
"com.github.tomakehurst" % "wiremock-jre8-standalone" % "2.35.0" % Test
)
}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.7.2
sbt.version=1.9.7
8 changes: 4 additions & 4 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ ThisBuild / libraryDependencySchemes ++= Seq(
"org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always
)

addSbtPlugin("uk.gov.hmrc" % "sbt-auto-build" % "3.9.0")
addSbtPlugin("uk.gov.hmrc" % "sbt-distributables" % "2.2.0")
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.19")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.6")
addSbtPlugin("uk.gov.hmrc" % "sbt-auto-build" % "3.20.0")
addSbtPlugin("uk.gov.hmrc" % "sbt-distributables" % "2.5.0")
addSbtPlugin("org.playframework" % "sbt-plugin" % "3.0.2")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.9")
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")
4 changes: 2 additions & 2 deletions test/actions/AuthorisedActionSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package actions

import akka.actor.ActorSystem
import akka.stream.SystemMaterializer
import org.apache.pekko.actor.ActorSystem
import org.apache.pekko.stream.SystemMaterializer
import models.authorisation.Enrolment.{Agent, Individual, Nino}
import models.requests.AuthorisationRequest
import play.api.http.Status._
Expand Down
2 changes: 1 addition & 1 deletion test/support/providers/ResultBodyConsumerProvider.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package support.providers

import akka.actor.ActorSystem
import org.apache.pekko.actor.ActorSystem
import play.api.mvc.Result
import play.api.test.DefaultAwaitTimeout
import play.api.test.Helpers.await
Expand Down

0 comments on commit 2dd2ca5

Please sign in to comment.