Skip to content

Commit

Permalink
Merge pull request #55 from hmrc/APIS-4350
Browse files Browse the repository at this point in the history
APIS-4350 Removed service-locator registration
  • Loading branch information
adampridmore authored May 9, 2019
2 parents a854fac + 218360d commit c9cb414
Show file tree
Hide file tree
Showing 12 changed files with 80 additions and 278 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

42 changes: 0 additions & 42 deletions app/uk/gov/hmrc/apisubscriptionfields/model/Registration.scala

This file was deleted.

9 changes: 4 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@ import uk.gov.hmrc.versioning.SbtGitVersioning
import scala.language.postfixOps

val compile = Seq(
"uk.gov.hmrc" %% "bootstrap-play-25" % "4.9.0",
"uk.gov.hmrc" %% "simple-reactivemongo" % "7.15.0-play-25",
"uk.gov.hmrc" %% "play-hmrc-api" % "3.4.0-play-25"
"uk.gov.hmrc" %% "bootstrap-play-25" % "4.11.0",
"uk.gov.hmrc" %% "simple-reactivemongo" % "7.19.0-play-25"
)

def test(scope: String = "test,acceptance") = Seq(
"uk.gov.hmrc" %% "hmrctest" % "3.6.0-play-25" % scope,
"uk.gov.hmrc" %% "reactivemongo-test" % "4.10.0-play-25" % scope,
"uk.gov.hmrc" %% "hmrctest" % "3.8.0-play-25" % scope,
"uk.gov.hmrc" %% "reactivemongo-test" % "4.13.0-play-25" % scope,
"org.scalamock" %% "scalamock-scalatest-support" % "3.6.0" % scope,
"org.scalatest" %% "scalatest" % "3.0.4" % scope,
"org.scalatestplus.play" %% "scalatestplus-play" % "2.0.1" % scope,
Expand Down
9 changes: 0 additions & 9 deletions conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
include "backend.conf"

appName=api-subscription-fields
appUrl="http://localhost:9650"

# An ApplicationLoader that uses Guice to bootstrap the application.
play.application.loader = "uk.gov.hmrc.play.bootstrap.ApplicationLoader"
Expand Down Expand Up @@ -45,8 +44,6 @@ play.http.errorHandler = "uk.gov.hmrc.play.bootstrap.http.JsonErrorHandler"
# Additional play modules can be added here
play.modules.enabled += "play.modules.reactivemongo.ReactiveMongoHmrcModule"
play.modules.enabled += "uk.gov.hmrc.play.bootstrap.HttpClientModule"
play.modules.enabled += "uk.gov.hmrc.apisubscriptionfields.config.ConfigurationModule"
play.modules.enabled += "uk.gov.hmrc.apisubscriptionfields.config.ServiceLocatorRegistrationModule"

# Session Timeout
# ~~~~
Expand Down Expand Up @@ -174,15 +171,9 @@ Dev {
delay-response = 2 seconds

protocol = http

service-locator {
host = localhost
port = 9602
}
}
}
}

Prod {

}
61 changes: 61 additions & 0 deletions dependencyReport.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import os, urllib, json
import requests
from sys import argv

def fetchDependencies(repositoryName):
r = urllib.urlopen(os.environ['CATALOGUE_DEPENDENCIES_URL'])
j = json.load(r)
for i in range(len(j)):
if j[i]['repositoryName'] == repositoryName:
return j[i]

return {}

def findOutOfDateDependencies(dependencies):
outOfDateDependencies = []
for i in range(len(dependencies)):
dependency = dependencies[i]
latestVersion = (dependency['latestVersion']['major'],
dependency['latestVersion']['minor'],
dependency['latestVersion']['patch'])
currentVersion = (dependency['currentVersion']['major'],
dependency['currentVersion']['minor'],
dependency['currentVersion']['patch'])

if latestVersion > currentVersion:
outOfDateDependencies.append(dependency)

return outOfDateDependencies

def reportOnDependencies(dependencyType, dependencies):
print dependencyType + " needing upgrade:"
outOfDateDependencies = findOutOfDateDependencies(dependencies)
if len(outOfDateDependencies) > 0:
for i in range(len(outOfDateDependencies)):
dependency = outOfDateDependencies[i]
print ' \033[38;5;15m\033[48;5;1m{} {}.{}.{} -> {}.{}.{}\033[39;49m'.format(
dependency['name'],
dependency['currentVersion']['major'],
dependency['currentVersion']['minor'],
dependency['currentVersion']['patch'],
dependency['latestVersion']['major'],
dependency['latestVersion']['minor'],
dependency['latestVersion']['patch'])
else:
print '\033[38;5;2m No upgrades required\033[39;49m'


def generateReport(repositoryName):
print 'Generating dependency report...'
dependencies = fetchDependencies(repositoryName)

reportOnDependencies('Libraries', dependencies['libraryDependencies'])
reportOnDependencies('SBT plugins', dependencies['sbtPluginsDependencies'])
reportOnDependencies('Other dependencies', dependencies['otherDependencies'])


if __name__ == "__main__":
if 'CATALOGUE_DEPENDENCIES_URL' in os.environ:
generateReport(argv[1])
else:
print 'CATALOGUE_DEPENDENCIES_URL environment variable not set - cannot generate dependency report'
8 changes: 4 additions & 4 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ resolvers += "HMRC Releases" at "https://dl.bintray.com/hmrc/releases"

resolvers += "Typesafe Releases" at "http://repo.typesafe.com/typesafe/releases/"

addSbtPlugin("uk.gov.hmrc" % "sbt-auto-build" % "1.14.0")
addSbtPlugin("uk.gov.hmrc" % "sbt-git-versioning" % "1.16.0")
addSbtPlugin("uk.gov.hmrc" % "sbt-distributables" % "1.3.0")
addSbtPlugin("uk.gov.hmrc" % "sbt-artifactory" % "0.17.0")
addSbtPlugin("uk.gov.hmrc" % "sbt-auto-build" % "1.16.0")
addSbtPlugin("uk.gov.hmrc" % "sbt-git-versioning" % "1.19.0")
addSbtPlugin("uk.gov.hmrc" % "sbt-distributables" % "1.5.0")
addSbtPlugin("uk.gov.hmrc" % "sbt-artifactory" % "0.19.0")
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.19")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")
1 change: 1 addition & 0 deletions run_all_tests.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash

sbt clean coverage test it:test acceptance:test coverageReport
python dependencyReport.py api-subscription-fields
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ trait AcceptanceTestSpec extends FeatureSpec
override def fakeApplication(): Application = new GuiceApplicationBuilder().configure(Map(
"run.mode" -> "Stub",
"Test.microservice.services.api-subscription-fields.host" -> ExternalServicesConfig.Host,
"Test.microservice.services.api-subscription-fields.port" -> ExternalServicesConfig.Port,
"Test.microservice.services.service-locator.host" -> ExternalServicesConfig.Host,
"Test.microservice.services.service-locator.port" -> ExternalServicesConfig.Port,
"Test.microservice.services.service-locator.enabled" -> true
"Test.microservice.services.api-subscription-fields.port" -> ExternalServicesConfig.Port
))
.build()

Expand Down
Loading

0 comments on commit c9cb414

Please sign in to comment.