Skip to content

Commit

Permalink
Merge pull request #41 from hmrc/APIS-2888
Browse files Browse the repository at this point in the history
APIS-2888
  • Loading branch information
edjannoo authored Nov 23, 2017
2 parents 847c2b6 + 436c3a9 commit 564e924
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class FieldsDefinitionController @Inject() (service: FieldsDefinitionService) ex
}

def getAllFieldsDefinitions: Action[AnyContent] = Action.async { implicit request =>
Logger.debug(s"[getAllFieldsDefinitions]")
Logger.debug("[getAllFieldsDefinitions]")
service.getAll map (defs => Ok(Json.toJson(defs))) recover recovery
}

Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ lazy val acceptanceTestSettings =
)

lazy val scoverageSettings: Seq[Setting[_]] = Seq(
coverageExcludedPackages := "<empty>;Reverse.*;model.*;.*config.*;.*(AuthService|BuildInfo|Routes).*",
coverageExcludedPackages := "<empty>;Reverse.*;.*model.*;.*config.*;.*(AuthService|BuildInfo|Routes).*;.*.application;.*.definition",
coverageMinimum := 93,
coverageFailOnMinimum := true,
coverageHighlighting := true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ class FieldsDefinitionControllerPutSpec extends UnitSpec
status(result) shouldBe OK
}
}

"error when request is invalid" in {
val json = Json.parse("{}")
testSubmitResult(mkRequest(json)) { result =>
status(result) shouldBe UNPROCESSABLE_ENTITY
}
}
}

private def testSubmitResult(request: Request[JsValue])(test: Future[Result] => Unit) {
Expand Down

0 comments on commit 564e924

Please sign in to comment.