Skip to content

Commit

Permalink
Fix breaking change library update
Browse files Browse the repository at this point in the history
  • Loading branch information
TomJKing committed Nov 26, 2024
1 parent 92e9a86 commit 732b352
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
18 changes: 9 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ watchSources ++= (baseDirectory.value / "npm/src" ** "*").get
scalaVersion := "2.13.15"

libraryDependencies += guice
libraryDependencies += "org.scalatestplus.play" %% "scalatestplus-play" % "5.1.0" % Test
libraryDependencies += "org.scalatestplus.play" %% "scalatestplus-play" % "7.0.1" % Test

val playVersion = "3.0.3"
val playPac4jVersion = "12.0.0-PLAY3.0"
Expand All @@ -29,27 +29,27 @@ libraryDependencies ++= Seq(
"com.softwaremill.sttp.client" %% "async-http-client-backend-future" % sttpVersion,
"uk.gov.nationalarchives" %% "tdr-graphql-client" % "0.0.194",
"uk.gov.nationalarchives" %% "tdr-auth-utils" % "0.0.220",
"uk.gov.nationalarchives" %% "tdr-generated-graphql" % "0.0.391",
"uk.gov.nationalarchives" %% "tdr-metadata-validation" % "0.0.60",
"uk.gov.nationalarchives" %% "s3-utils" % "0.1.221",
"uk.gov.nationalarchives" %% "sns-utils" % "0.1.221",
"uk.gov.nationalarchives" %% "tdr-generated-graphql" % "0.0.392",
"uk.gov.nationalarchives" %% "tdr-metadata-validation" % "0.0.84",
"uk.gov.nationalarchives" %% "s3-utils" % "0.1.223",
"uk.gov.nationalarchives" %% "sns-utils" % "0.1.223",
"ch.qos.logback" % "logback-classic" % "1.5.12",
ws,
"io.opentelemetry" % "opentelemetry-api" % "1.44.1",
"io.opentelemetry" % "opentelemetry-exporter-otlp" % "1.44.1",
"io.opentelemetry" % "opentelemetry-sdk" % "1.44.1",
"io.opentelemetry" % "opentelemetry-extension-aws" % "1.20.1",
"io.opentelemetry" % "opentelemetry-sdk-extension-aws" % "1.19.0",
"io.opentelemetry.contrib" % "opentelemetry-aws-xray" % "1.40.0",
"io.opentelemetry.contrib" % "opentelemetry-aws-xray-propagator" % "1.22.0-alpha",
"io.opentelemetry.contrib" % "opentelemetry-aws-xray" % "1.41.0",
"io.opentelemetry.contrib" % "opentelemetry-aws-xray-propagator" % "1.41.0-alpha",
"com.github.tomakehurst" % "wiremock-standalone" % "3.0.1" % Test,
"org.mockito" % "mockito-core" % "5.14.2" % Test,
"org.scalatestplus" %% "mockito-3-4" % "3.2.10.0" % Test
)
libraryDependencies += "org.scala-lang.modules" %% "scala-java8-compat" % "1.0.2"

dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.3"
dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-core" % "2.17.3"
dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-databind" % "2.18.1"
dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-core" % "2.18.1"

disablePlugins(PlayLogback)
scalacOptions ++= Seq("-language:implicitConversions")
Expand Down
4 changes: 2 additions & 2 deletions test/controllers/HomepageControllerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class HomepageControllerSpec extends FrontEndTestHelper {
val controller = new HomepageController(getAuthorisedSecurityComponents, getValidJudgmentUserKeycloakConfiguration, consignmentService)

val consignmentId = UUID.fromString("6c5756a9-dd7a-437c-9396-33b227e53768")
val addConsignment = AddConsignment(Option(consignmentId), None)
val addConsignment = AddConsignment(Option(consignmentId), None, "Consignment-Ref")
val client = graphqlConfig.getClient[Data, Variables]()
val dataString = client.GraphqlData(Option(Data(addConsignment))).asJson.printWith(Printer(dropNullValues = false, ""))

Expand Down Expand Up @@ -190,7 +190,7 @@ class HomepageControllerSpec extends FrontEndTestHelper {
val controller = new HomepageController(getAuthorisedSecurityComponents, getValidStandardUserKeycloakConfiguration, consignmentService)

val consignmentId = UUID.fromString("6c5756a9-dd7a-437c-9396-33b227e53768")
val addConsignment = AddConsignment(Option(consignmentId), None)
val addConsignment = AddConsignment(Option(consignmentId), None, "Consignment-Ref")
val client = graphqlConfig.getClient[Data, Variables]()
val dataString = client.GraphqlData(Option(Data(addConsignment))).asJson.printWith(Printer(dropNullValues = false, ""))

Expand Down
2 changes: 1 addition & 1 deletion test/controllers/SeriesDetailsControllerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class SeriesDetailsControllerSpec extends FrontEndTestHelper {
val consignmentStatusService = new ConsignmentStatusService(graphQLConfiguration)
val consignmentId = UUID.fromString("c2efd3e6-6664-4582-8c28-dcf891f60e68")
val seriesId = UUID.fromString("c2efd3e6-6664-4582-8c28-dcf891f60e68")
val consignmentResponse: ac.AddConsignment = new ac.AddConsignment(Some(consignmentId), Some(seriesId))
val consignmentResponse: ac.AddConsignment = new ac.AddConsignment(Some(consignmentId), Some(seriesId), "Consignment-Ref")
val data: client.GraphqlData = client.GraphqlData(Some(ac.Data(consignmentResponse)), List())
val dataString: String = data.asJson.printWith(Printer(dropNullValues = false, ""))
wiremockServer.stubFor(
Expand Down
8 changes: 4 additions & 4 deletions test/services/ConsignmentServiceSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class ConsignmentServiceSpec extends AnyWordSpec with MockitoSugar with BeforeAn
val noUserTypeToken = mock[Token]
when(noUserTypeToken.bearerAccessToken).thenReturn(bearerAccessToken)

val response = GraphQlResponse(Some(new addConsignment.Data(addConsignment.AddConsignment(Some(consignmentId), seriesId))), Nil)
val response = GraphQlResponse(Some(new addConsignment.Data(addConsignment.AddConsignment(Some(consignmentId), seriesId, "Consignment-Ref"))), Nil)
val expectedVariables = Some(addConsignment.Variables(AddConsignmentInput(seriesId, "standard")))
when(addConsignmentClient.getResult(bearerAccessToken, addConsignment.document, expectedVariables))
.thenReturn(Future.successful(response))
Expand All @@ -151,7 +151,7 @@ class ConsignmentServiceSpec extends AnyWordSpec with MockitoSugar with BeforeAn
when(standardUserToken.isStandardUser).thenReturn(true)
when(standardUserToken.bearerAccessToken).thenReturn(bearerAccessToken)

val response = GraphQlResponse(Some(new addConsignment.Data(addConsignment.AddConsignment(Some(consignmentId), seriesId))), Nil)
val response = GraphQlResponse(Some(new addConsignment.Data(addConsignment.AddConsignment(Some(consignmentId), seriesId, "Consignment-Ref"))), Nil)
val expectedVariables = Some(addConsignment.Variables(AddConsignmentInput(seriesId, "standard")))
when(addConsignmentClient.getResult(bearerAccessToken, addConsignment.document, expectedVariables))
.thenReturn(Future.successful(response))
Expand All @@ -165,7 +165,7 @@ class ConsignmentServiceSpec extends AnyWordSpec with MockitoSugar with BeforeAn
val judgmentUserToken: Token = mock[Token]
when(judgmentUserToken.isJudgmentUser).thenReturn(true)
when(judgmentUserToken.bearerAccessToken).thenReturn(bearerAccessToken)
val response = GraphQlResponse(Some(new addConsignment.Data(addConsignment.AddConsignment(Some(consignmentId), None))), Nil)
val response = GraphQlResponse(Some(new addConsignment.Data(addConsignment.AddConsignment(Some(consignmentId), None, "Consignment-Ref"))), Nil)
val expectedVariables = Some(addConsignment.Variables(AddConsignmentInput(None, "judgment")))
when(addConsignmentClient.getResult(bearerAccessToken, addConsignment.document, expectedVariables))
.thenReturn(Future.successful(response))
Expand All @@ -176,7 +176,7 @@ class ConsignmentServiceSpec extends AnyWordSpec with MockitoSugar with BeforeAn
}

"return the created consignment" in {
val response = GraphQlResponse(Some(new addConsignment.Data(addConsignment.AddConsignment(Some(consignmentId), seriesId))), Nil)
val response = GraphQlResponse(Some(new addConsignment.Data(addConsignment.AddConsignment(Some(consignmentId), seriesId, "Consignment-Ref"))), Nil)
when(addConsignmentClient.getResult(bearerAccessToken, addConsignment.document, Some(addConsignment.Variables(AddConsignmentInput(seriesId, "standard")))))
.thenReturn(Future.successful(response))

Expand Down

0 comments on commit 732b352

Please sign in to comment.