mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 18:46:46 +00:00
#927 fixed the failed tests, no public accounts for all getAccounts endpoints.
This commit is contained in:
parent
64aa4ddb31
commit
11bbdc045d
@ -1085,30 +1085,30 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser
|
||||
}
|
||||
|
||||
feature("Information about all the bank accounts for all banks"){
|
||||
scenario("we get only the public bank accounts", API1_2, GetBankAccountsForAllBanks) {
|
||||
accountTestsSpecificDBSetup()
|
||||
Given("We will not use an access token")
|
||||
When("the request is sent")
|
||||
val reply = getBankAccountsForAllBanks(None)
|
||||
Then("we should get a 200 ok code")
|
||||
reply.code should equal (200)
|
||||
val publicAccountsInfo = reply.body.extract[AccountsJSON]
|
||||
And("some fields should not be empty")
|
||||
publicAccountsInfo.accounts.foreach(a => {
|
||||
a.id.nonEmpty should equal (true)
|
||||
a.views_available.nonEmpty should equal (true)
|
||||
a.views_available.foreach(
|
||||
//check that all the views are public
|
||||
v => v.is_public should equal (true)
|
||||
)
|
||||
})
|
||||
|
||||
And("There are accounts from more than one bank")
|
||||
assertAccountsFromMoreThanOneBank(publicAccountsInfo)
|
||||
|
||||
And("There are no duplicate accounts")
|
||||
assertNoDuplicateAccounts(publicAccountsInfo)
|
||||
}
|
||||
// scenario("we get only the public bank accounts", API1_2, GetBankAccountsForAllBanks) {
|
||||
// accountTestsSpecificDBSetup()
|
||||
// Given("We will not use an access token")
|
||||
// When("the request is sent")
|
||||
// val reply = getBankAccountsForAllBanks(None)
|
||||
// Then("we should get a 200 ok code")
|
||||
// reply.code should equal (200)
|
||||
// val publicAccountsInfo = reply.body.extract[AccountsJSON]
|
||||
// And("some fields should not be empty")
|
||||
// publicAccountsInfo.accounts.foreach(a => {
|
||||
// a.id.nonEmpty should equal (true)
|
||||
// a.views_available.nonEmpty should equal (true)
|
||||
// a.views_available.foreach(
|
||||
// //check that all the views are public
|
||||
// v => v.is_public should equal (true)
|
||||
// )
|
||||
// })
|
||||
//
|
||||
// And("There are accounts from more than one bank")
|
||||
// assertAccountsFromMoreThanOneBank(publicAccountsInfo)
|
||||
//
|
||||
// And("There are no duplicate accounts")
|
||||
// assertNoDuplicateAccounts(publicAccountsInfo)
|
||||
// }
|
||||
scenario("we get the bank accounts the user has access to", API1_2, GetBankAccountsForAllBanks) {
|
||||
accountTestsSpecificDBSetup()
|
||||
Given("We will use an access token")
|
||||
@ -1124,8 +1124,8 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser
|
||||
})
|
||||
|
||||
//test that this call is a combination of accounts with more than public access, and accounts with public access
|
||||
And("Some accounts should have only public views")
|
||||
assertAtLeastOneAccountHasAllViewsWithCondition(accountsInfo, _.is_public)
|
||||
// And("Some accounts should have only public views")
|
||||
// assertAtLeastOneAccountHasAllViewsWithCondition(accountsInfo, _.is_public)
|
||||
And("Some accounts should have only private views")
|
||||
assertAtLeastOneAccountHasAllViewsWithCondition(accountsInfo, !_.is_public)
|
||||
|
||||
@ -1201,30 +1201,30 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser
|
||||
}
|
||||
|
||||
feature("Information about all the bank accounts for a single bank"){
|
||||
scenario("we get only the public bank accounts", API1_2, GetBankAccounts) {
|
||||
accountTestsSpecificDBSetup()
|
||||
Given("We will not use an access token")
|
||||
When("the request is sent")
|
||||
val reply = getBankAccounts(randomBank, None)
|
||||
Then("we should get a 200 ok code")
|
||||
reply.code should equal (200)
|
||||
val publicAccountsInfo = reply.body.extract[AccountsJSON]
|
||||
And("some fields should not be empty")
|
||||
publicAccountsInfo.accounts.foreach(a => {
|
||||
a.id.nonEmpty should equal (true)
|
||||
a.views_available.nonEmpty should equal (true)
|
||||
a.views_available.foreach(
|
||||
//check that all the views are public
|
||||
v => v.is_public should equal (true)
|
||||
)
|
||||
})
|
||||
|
||||
And("The accounts are only from one bank")
|
||||
assertAccountsFromOneBank(publicAccountsInfo)
|
||||
|
||||
And("There are no duplicate accounts")
|
||||
assertNoDuplicateAccounts(publicAccountsInfo)
|
||||
}
|
||||
// scenario("we get only the public bank accounts", API1_2, GetBankAccounts) {
|
||||
// accountTestsSpecificDBSetup()
|
||||
// Given("We will not use an access token")
|
||||
// When("the request is sent")
|
||||
// val reply = getBankAccounts(randomBank, None)
|
||||
// Then("we should get a 200 ok code")
|
||||
// reply.code should equal (200)
|
||||
// val publicAccountsInfo = reply.body.extract[AccountsJSON]
|
||||
// And("some fields should not be empty")
|
||||
// publicAccountsInfo.accounts.foreach(a => {
|
||||
// a.id.nonEmpty should equal (true)
|
||||
// a.views_available.nonEmpty should equal (true)
|
||||
// a.views_available.foreach(
|
||||
// //check that all the views are public
|
||||
// v => v.is_public should equal (true)
|
||||
// )
|
||||
// })
|
||||
//
|
||||
// And("The accounts are only from one bank")
|
||||
// assertAccountsFromOneBank(publicAccountsInfo)
|
||||
//
|
||||
// And("There are no duplicate accounts")
|
||||
// assertNoDuplicateAccounts(publicAccountsInfo)
|
||||
// }
|
||||
scenario("we get the bank accounts the user have access to", API1_2, GetBankAccounts) {
|
||||
accountTestsSpecificDBSetup()
|
||||
Given("We will use an access token")
|
||||
@ -1242,8 +1242,8 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser
|
||||
//test that this call is a combination of accounts with more than public access, and accounts with public access
|
||||
And("Some accounts should have only public views")
|
||||
|
||||
assertAtLeastOneAccountHasAllViewsWithCondition(accountsInfo, _.is_public)
|
||||
And("Some accounts should have only private views")
|
||||
// assertAtLeastOneAccountHasAllViewsWithCondition(accountsInfo, _.is_public)
|
||||
// And("Some accounts should have only private views")
|
||||
assertAtLeastOneAccountHasAllViewsWithCondition(accountsInfo, !_.is_public)
|
||||
|
||||
And("The accounts are only from one bank")
|
||||
|
||||
@ -26,22 +26,22 @@ class AccountTest extends V200ServerSetup with DefaultUsers {
|
||||
And("We should get a 200")
|
||||
responsePut.code should equal(200)
|
||||
|
||||
When("We make the anonymous access request")
|
||||
val requestGet = (v2_0Request / "accounts").GET
|
||||
val responseGet = makeGetRequest(requestGet)
|
||||
|
||||
Then("We should get a 200")
|
||||
responseGet.code should equal(200)
|
||||
|
||||
val isPublic: List[Boolean] =
|
||||
for {
|
||||
JObject(o) <- responseGet.body
|
||||
JField("is_public", JBool(isPublic)) <- o
|
||||
} yield {
|
||||
isPublic
|
||||
}
|
||||
And("All received accounts have to be public")
|
||||
isPublic.forall(_ == true) should equal(true)
|
||||
// When("We make the anonymous access request")
|
||||
// val requestGet = (v2_0Request / "accounts").GET
|
||||
// val responseGet = makeGetRequest(requestGet)
|
||||
//
|
||||
// Then("We should get a 200")
|
||||
// responseGet.code should equal(200)
|
||||
//
|
||||
// val isPublic: List[Boolean] =
|
||||
// for {
|
||||
// JObject(o) <- responseGet.body
|
||||
// JField("is_public", JBool(isPublic)) <- o
|
||||
// } yield {
|
||||
// isPublic
|
||||
// }
|
||||
// And("All received accounts have to be public")
|
||||
// isPublic.forall(_ == true) should equal(true)
|
||||
|
||||
When("We make the authenticated access request")
|
||||
val requestGetAll = (v2_0Request / "accounts").GET <@ (user1)
|
||||
@ -74,22 +74,22 @@ class AccountTest extends V200ServerSetup with DefaultUsers {
|
||||
And("We should get a 200")
|
||||
responsePut.code should equal(200)
|
||||
|
||||
When("We make the anonymous access request")
|
||||
val requestGet = (v2_0Request / "banks" / testBank.value / "accounts").GET
|
||||
val responseGet = makeGetRequest(requestGet)
|
||||
|
||||
Then("We should get a 200")
|
||||
responseGet.code should equal(200)
|
||||
|
||||
val isPublic: List[Boolean] =
|
||||
for {
|
||||
JObject(o) <- responseGet.body
|
||||
JField("is_public", JBool(isPublic)) <- o
|
||||
} yield {
|
||||
isPublic
|
||||
}
|
||||
And("All received accounts have to be public")
|
||||
isPublic.forall(_ == true) should equal(true)
|
||||
// When("We make the anonymous access request")
|
||||
// val requestGet = (v2_0Request / "banks" / testBank.value / "accounts").GET
|
||||
// val responseGet = makeGetRequest(requestGet)
|
||||
//
|
||||
// Then("We should get a 200")
|
||||
// responseGet.code should equal(200)
|
||||
//
|
||||
// val isPublic: List[Boolean] =
|
||||
// for {
|
||||
// JObject(o) <- responseGet.body
|
||||
// JField("is_public", JBool(isPublic)) <- o
|
||||
// } yield {
|
||||
// isPublic
|
||||
// }
|
||||
// And("All received accounts have to be public")
|
||||
// isPublic.forall(_ == true) should equal(true)
|
||||
|
||||
When("We make the authenticated access request")
|
||||
val requestGetAll = (v2_0Request / "banks" / testBank.value / "accounts").GET <@ (user1)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user