diff --git a/README.md b/README.md index ec8dbbf..bb94222 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ - # api-platform-outbound-soap -This is a placeholder README.md for a new repository +This service allows other HMRC services to send messages to external SOAP web services. ### License diff --git a/app/uk/gov/hmrc/apiplatformoutboundsoap/config/AppConfig.scala b/app/uk/gov/hmrc/apiplatformoutboundsoap/config/AppConfig.scala index 918e248..119326a 100644 --- a/app/uk/gov/hmrc/apiplatformoutboundsoap/config/AppConfig.scala +++ b/app/uk/gov/hmrc/apiplatformoutboundsoap/config/AppConfig.scala @@ -1,3 +1,19 @@ +/* + * Copyright 2020 HM Revenue & Customs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package uk.gov.hmrc.apiplatformoutboundsoap.config import javax.inject.{Inject, Singleton} diff --git a/app/uk/gov/hmrc/apiplatformoutboundsoap/controllers/MicroserviceHelloWorldController.scala b/app/uk/gov/hmrc/apiplatformoutboundsoap/controllers/MicroserviceHelloWorldController.scala index ef50221..6eb1a31 100644 --- a/app/uk/gov/hmrc/apiplatformoutboundsoap/controllers/MicroserviceHelloWorldController.scala +++ b/app/uk/gov/hmrc/apiplatformoutboundsoap/controllers/MicroserviceHelloWorldController.scala @@ -1,3 +1,19 @@ +/* + * Copyright 2020 HM Revenue & Customs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package uk.gov.hmrc.apiplatformoutboundsoap.controllers import javax.inject.{Inject, Singleton} diff --git a/build.sbt b/build.sbt index 37c1374..82608fb 100644 --- a/build.sbt +++ b/build.sbt @@ -5,12 +5,26 @@ val appName = "api-platform-outbound-soap" val silencerVersion = "1.7.0" +lazy val scoverageSettings = { + import scoverage.ScoverageKeys + Seq( + // Semicolon-separated list of regexs matching classes to exclude + ScoverageKeys.coverageExcludedPackages := """uk\.gov\.hmrc\.BuildInfo;.*\.Routes;.*\.RoutesPrefix;.*Filters?;MicroserviceAuditConnector;Module;GraphiteStartUp;.*\.Reverse[^.]*""", + ScoverageKeys.coverageMinimum := 90, + ScoverageKeys.coverageFailOnMinimum := true, + ScoverageKeys.coverageHighlighting := true, + parallelExecution in Test := false + ) +} + lazy val microservice = Project(appName, file(".")) .enablePlugins(play.sbt.PlayScala, SbtAutoBuildPlugin, SbtGitVersioning, SbtDistributablesPlugin) .settings( majorVersion := 0, scalaVersion := "2.12.11", + PlayKeys.playDefaultPort := 6703, libraryDependencies ++= AppDependencies.compile ++ AppDependencies.test, + scoverageSettings, // *************** // Use the silencer plugin to suppress warnings scalacOptions += "-P:silencer:pathFilters=routes", diff --git a/conf/application.conf b/conf/application.conf index 2c18858..ceab3fa 100644 --- a/conf/application.conf +++ b/conf/application.conf @@ -1,3 +1,16 @@ +# Copyright 2020 HM Revenue & Customs +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. include "backend.conf" @@ -119,4 +132,3 @@ microservice { } } } - diff --git a/project/AppDependencies.scala b/project/AppDependencies.scala index d56cf28..a747aa6 100644 --- a/project/AppDependencies.scala +++ b/project/AppDependencies.scala @@ -1,6 +1,4 @@ import play.core.PlayVersion.current -import play.sbt.PlayImport._ -import sbt.Keys.libraryDependencies import sbt._ object AppDependencies { diff --git a/project/plugins.sbt b/project/plugins.sbt index 0fbd7f7..1048cca 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -13,3 +13,6 @@ addSbtPlugin("uk.gov.hmrc" % "sbt-distributables" % "2.0.0") addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.7.5") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.0") + +addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0") diff --git a/run_all_tests.sh b/run_all_tests.sh new file mode 100755 index 0000000..b501d47 --- /dev/null +++ b/run_all_tests.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +sbt clean compile coverage test coverageReport diff --git a/scalastyle-config.xml b/scalastyle-config.xml new file mode 100644 index 0000000..5636469 --- /dev/null +++ b/scalastyle-config.xml @@ -0,0 +1,99 @@ + + Scalastyle standard configuration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/uk/gov/hmrc/apiplatformoutboundsoap/controllers/MicroserviceHelloWorldControllerSpec.scala b/test/uk/gov/hmrc/apiplatformoutboundsoap/controllers/MicroserviceHelloWorldControllerSpec.scala index 0fced8c..0645489 100644 --- a/test/uk/gov/hmrc/apiplatformoutboundsoap/controllers/MicroserviceHelloWorldControllerSpec.scala +++ b/test/uk/gov/hmrc/apiplatformoutboundsoap/controllers/MicroserviceHelloWorldControllerSpec.scala @@ -1,3 +1,19 @@ +/* + * Copyright 2020 HM Revenue & Customs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package uk.gov.hmrc.apiplatformoutboundsoap.controllers import org.scalatest.matchers.should.Matchers