Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API-8051: Subscriptions are not being deleted by TPA #129

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/uk/gov/hmrc/apipublisher/connectors/TpaConnector.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class TpaConnector @Inject() (config: TpaConnector.Config, http: HttpClientV2)(i
protected val serviceBaseUrl: String = config.serviceBaseUrl

def deleteSubscriptions(apiContext: String, versionNbr: String)(implicit hc: HeaderCarrier): Future[Unit] = {
http.delete(url"$serviceBaseUrl/apis/$apiContext/versions/$versionNbr/subscribers")
val url = s"$serviceBaseUrl/apis/$apiContext/versions/$versionNbr/subscribers"
http.delete(url"$url")
.execute[Either[UpstreamErrorResponse, HttpResponse]]
.map {
case Right(_) => (())
Expand Down
6 changes: 3 additions & 3 deletions it/test/uk/gov/hmrc/apipublisher/PublisherFeatureSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,9 @@ class PublisherFeatureSpec extends BaseFeatureSpec with EitherValues {
val apiSubscriptionFieldsUrlVersion_1_0 = s"/definition/context/$urlEncodedApiContext/version/1.0"
val apiSubscriptionFieldsUrlVersion_2_0 = s"/definition/context/$urlEncodedApiContext/version/2.0"
val apiSubscriptionFieldsUrlVersion_3_0 = s"/definition/context/$urlEncodedApiContext/version/3.0"
val tpaVersion_1_0 = s"/apis/$urlEncodedApiContext/versions/1.0/subscribers"
val tpaVersion_2_0 = s"/apis/$urlEncodedApiContext/versions/2.0/subscribers"
val tpaVersion_3_0 = s"/apis/$urlEncodedApiContext/versions/3.0/subscribers"
val tpaVersion_1_0 = s"/apis/$apiContext/versions/1.0/subscribers"
val tpaVersion_2_0 = s"/apis/$apiContext/versions/2.0/subscribers"
val tpaVersion_3_0 = s"/apis/$apiContext/versions/3.0/subscribers"

val definitionJsonWithInvalidContext =
s"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class TpaConnectorSpec extends AsyncHmrcSpec with BeforeAndAfterAll with GuiceOn

val connector = new TpaConnector(tpaConfig, app.injector.instanceOf[HttpClientV2])

val apiContext = "hello"
val apiContext = "test/hello"
val apiVersion = "1.0"
val url = s"/apis/$apiContext/versions/$apiVersion/subscribers"
val errorResponseBody = """{"code":"INTERNAL_ERROR","message":"Something is wrong"}"""
Expand Down