Skip to content

Commit

Permalink
Merge pull request #1022 from hmrc/DL-14575
Browse files Browse the repository at this point in the history
DL-14575: VAT API-Removed scopes and refactored Unit and func test
  • Loading branch information
diksha-diksha authored Oct 14, 2024
2 parents 2b5aa60 + 97e6846 commit 915e674
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 44 deletions.
8 changes: 1 addition & 7 deletions app/definition/ApiDefinition.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,7 @@ object APIDefinition {
implicit val formatAPIDefinition: OFormat[APIDefinition] = Json.format[APIDefinition]
}

case class Scope(key: String, name: String, description: String)

object Scope {
implicit val formatScope: OFormat[Scope] = Json.format[Scope]
}

case class Definition(scopes: Seq[Scope], api: APIDefinition)
case class Definition(api: APIDefinition)

object Definition {
implicit val formatDefinition: OFormat[Definition] = Json.format[Definition]
Expand Down
14 changes: 1 addition & 13 deletions app/definition/ApiDefinitionFactory.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,7 @@ class ApiDefinitionFactory @Inject()(appConfig: AppConfig) extends Logging{

lazy val definition: Definition =
Definition(
scopes = Seq(
Scope(
key = readScope,
name = "View your VAT information",
description = "Allow read access to VAT data"
),
Scope(
key = writeScope,
name = "Change your VAT information",
description = "Allow write access to VAT data"
)
),
api = APIDefinition(
api = APIDefinition(
name = "VAT (MTD)",
description =
"An API for providing VAT data",
Expand Down
12 changes: 0 additions & 12 deletions func/test/config/DocumentationControllerISpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,6 @@ class DocumentationControllerISpec extends IntegrationBaseSpec with FeatureToggl
val apiDefinitionJson: JsValue = Json.parse(
"""
|{
| "scopes":[
| {
| "key":"read:vat",
| "name":"View your VAT information",
| "description":"Allow read access to VAT data"
| },
| {
| "key":"write:vat",
| "name":"Change your VAT information",
| "description":"Allow write access to VAT data"
| }
| ],
| "api":{
| "name":"VAT (MTD)",
| "description":"An API for providing VAT data",
Expand Down
12 changes: 0 additions & 12 deletions test/definition/ApiDefinitionFactorySpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,6 @@ class ApiDefinitionFactorySpec extends UnitSpec {

apiDefinitionFactory.definition shouldBe
Definition(
scopes = Seq(
Scope(
key = readScope,
name = "View your VAT information",
description = "Allow read access to VAT data"
),
Scope(
key = writeScope,
name = "Change your VAT information",
description = "Allow write access to VAT data"
)
),
api = APIDefinition(
name = "VAT (MTD)",
description =
Expand Down

0 comments on commit 915e674

Please sign in to comment.