Conversation
|
| val stubsUrl: String = config.get[String]("stubs.host") | ||
|
|
||
| // TODO: name subject to change | ||
| val stubsAuth: String = config.get[String]("stubs.auth") |
There was a problem hiding this comment.
stubsAuthorizationToken
There was a problem hiding this comment.
or merge my branch into yours & you'll get these bits for free
| val appName: String = config.get[String]("appName") | ||
|
|
||
| // TODO: name subject to change, probably | ||
| val stubsUrl: String = config.get[String]("stubs.host") |
| stubs { | ||
| host = "http://localhost:10061" | ||
| auth = "Q2xpZW50SWQ6Q2xpZW50U2VjcmV0" |
There was a problem hiding this comment.
update these values to something like:
senior-accounting-officer-stubs {
host = localhost
port = 10061
authorizationToken = "Basic Q2xpZW50SWQ6Q2xpZW50U2VjcmV0"
}
| // TODO: how to deal with failed future gracefully? | ||
| // TODO: what error response should be returned? | ||
|
|
||
| def getObligation(saoSubscriptionId: String): Action[AnyContent] = Action.async { implicit request => |
There was a problem hiding this comment.
use parse.tolerantText over AnyContent
you also need the headerCarrier:
given HeaderCarrier = HeaderCarrierConverter.fromRequest(request)
There was a problem hiding this comment.
true, the way it works now malformed json wont get sent.
There was a problem hiding this comment.
what do i need the header carrier for?
| import javax.inject.Inject | ||
|
|
||
| // TODO: change name | ||
| class StubConnector @Inject() (appConfig: AppConfig, httpClient: HttpClientV2)(using ExecutionContext) { |
There was a problem hiding this comment.
Connectors will be seperate in my mind, so this can be ObligationConnector
test/uk/gov/hmrc/senioraccountingofficer/controllers/ObligationControllerSpec.scala
Show resolved
Hide resolved
test/uk/gov/hmrc/senioraccountingofficer/controllers/ObligationControllerSpec.scala
Show resolved
Hide resolved
|
you're missing the "glue" in the app/uk/gov/hmrc/senioraccountingofficer/config/Module.scala file like so for your connector:
if you move to using a trait in your connector, see my PR, it makes the testing a little easier. |
No description provided.