Skip to content
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2 from noms-digital-studio/increase_entity_limit
Browse files Browse the repository at this point in the history
Allow no limit to NOMIS data - to allow several days worth of data to…
  • Loading branch information
llmikeyj authored Oct 31, 2018
2 parents 507dfbb + 4f302c9 commit 16391b0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name := "pollpush"

organization := "gov.uk.justice.digital"

version := "0.1.07"
version := "0.1.08"

scalaVersion := "2.12.2"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class NomisSource @Inject() (@Named("sourceUrl") sourceUrl: String, @Named("note

case HttpResponse(_, _, entity, _) =>

Unmarshal(entity).to[Seq[SourceCaseNote]].map(PullResult(_, Some(from), Some(until), None))
Unmarshal(entity.withoutSizeLimit()).to[Seq[SourceCaseNote]].map(PullResult(_, Some(from), Some(until), None))

}.recover { case error: Throwable => PullResult(Seq(), Some(from), Some(until), Some(error)) }
}
Expand Down
8 changes: 4 additions & 4 deletions src/test/scala/NomisSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class NomisSpec extends FunSpec with BeforeAndAfterAll with GivenWhenThen with M
val minuteAgo = rightNow.minus(6000)

When("Case Notes are pulled from the API")
val result = Await.result(source.pull(minuteAgo, rightNow), 5.seconds)
val result = Await.result(source.pull(minuteAgo, rightNow), 10.seconds)

Then("the API receives a HTTP GET call with Authorization, from_datetime and returns the Case Notes")
verify(
Expand Down Expand Up @@ -100,7 +100,7 @@ class NomisSpec extends FunSpec with BeforeAndAfterAll with GivenWhenThen with M
val minuteAgo = rightNow.minus(6000)

When("Case Notes are pulled from the API")
val result = Await.result(source.pull(minuteAgo, rightNow), 5.seconds)
val result = Await.result(source.pull(minuteAgo, rightNow), 10.seconds)

Then("the API receives a HTTP GET call with Authorization, from_datetime, and noteType whitelist")
verify(
Expand All @@ -124,7 +124,7 @@ class NomisSpec extends FunSpec with BeforeAndAfterAll with GivenWhenThen with M
val minuteAgo = rightNow.minus(6000)

When("Case Notes are pulled from the API")
val result = Await.result(source.pull(minuteAgo, rightNow), 5.seconds)
val result = Await.result(source.pull(minuteAgo, rightNow), 10.seconds)

Then("the API receives a HTTP GET call with Authorization, from_datetime, and noteType whitelist")
verify(
Expand All @@ -148,7 +148,7 @@ class NomisSpec extends FunSpec with BeforeAndAfterAll with GivenWhenThen with M
val minuteAgo = rightNow.minus(6000)

When("a Case Notes pull from the API is attempted")
val result = Await.result(source.pull(minuteAgo, rightNow), 5.seconds)
val result = Await.result(source.pull(minuteAgo, rightNow), 10.seconds)

Then("the 500 error is reported")
result.error.get.toString should include("500")
Expand Down

0 comments on commit 16391b0

Please sign in to comment.