From a704261f5f65e6e3d8ca09ac4039d61c9dffa7a8 Mon Sep 17 00:00:00 2001 From: Petar Bozin Date: Fri, 16 Jun 2017 10:45:01 +0200 Subject: [PATCH] All tests fail: akka fails to serialize ViewImpl due to kryo problem --- pom.xml | 2 +- src/main/scala/bootstrap/liftweb/Boot.scala | 12 +- .../code/actorsystem/ObpActorConfig.scala | 48 +- src/main/scala/code/api/util/APIUtil.scala | 6 +- .../scala/code/api/v2_1_0/APIMethods210.scala | 14 +- .../scala/code/model/dataAccess/view.scala | 4 +- .../remotedata/RemotedataViewsActor.scala | 6 +- src/main/scala/code/views/MapperViews.scala | 4 +- src/test/scala/code/AppTest.scala | 2 +- src/test/scala/code/api/directloginTest.scala | 30 +- src/test/scala/code/api/oauthTest.scala | 38 +- .../scala/code/api/v1_2_0/API12Test.scala | 1154 +++++++-------- .../scala/code/api/v1_2_1/API121Test.scala | 1265 +++++++++-------- .../code/api/v1_3_0/PhysicalCardsTest.scala | 12 +- src/test/scala/code/api/v1_4_0/AtmsTest.scala | 8 +- .../scala/code/api/v1_4_0/BranchesTest.scala | 8 +- .../scala/code/api/v1_4_0/CustomerTest.scala | 26 +- .../v1_4_0/MappedCustomerMessagesTest.scala | 6 +- .../scala/code/api/v1_4_0/ProductsTest.scala | 8 +- .../api/v1_4_0/TransactionRequestsTest.scala | 70 +- .../scala/code/api/v2_0_0/AccountTest.scala | 18 +- .../code/api/v2_0_0/CreateUserTest.scala | 8 +- .../scala/code/api/v2_0_0/CustomerTest.scala | 26 +- .../code/api/v2_0_0/EntitlementTests.scala | 10 +- .../api/v2_0_0/TransactionRequestsTest.scala | 157 +- .../code/api/v2_1_0/CreateBranchTest.scala | 10 +- .../api/v2_1_0/CreateCounterpartyTest.scala | 6 +- .../v2_1_0/CreateTransactionTypeTest.scala | 20 +- .../scala/code/api/v2_1_0/CustomerTest.scala | 26 +- .../code/api/v2_1_0/EntitlementTests.scala | 16 +- .../api/v2_1_0/TransactionRequestsTest.scala | 104 +- .../scala/code/api/v2_2_0/API2_2_0Test.scala | 54 +- .../scala/code/api/v3_0_0/API3_0_0Test.scala | 54 +- .../scala/code/api/v3_0_0/AccountTest.scala | 24 +- .../code/atms/MappedAtmsProviderTest.scala | 6 +- .../BankAccountCreationListenerTest.scala | 6 +- .../BankAccountCreationTest.scala | 16 +- .../branches/MappedBranchesProviderTest.scala | 6 +- .../code/crm/MappedCrmEventProviderTest.scala | 2 +- .../customer/MappedCustomerInfoTest.scala | 10 +- .../scala/code/management/ImporterTest.scala | 42 +- .../products/MappedProductsProviderTest.scala | 6 +- .../sandbox/PostCounterpartyMetadata.scala | 2 +- .../scala/code/sandbox/PostCustomer.scala | 2 +- .../code/sandbox/SandboxDataLoadingTest.scala | 60 +- src/test/scala/code/setup/DefaultUsers.scala | 53 +- .../setup/LocalMappedConnectorTestSetup.scala | 2 +- .../scala/code/setup/SendServerRequests.scala | 2 +- src/test/scala/code/setup/ServerSetup.scala | 2 +- ...onnectorSetupWithStandardPermissions.scala | 2 +- src/test/scala/code/util/OAuthClient.scala | 2 +- 51 files changed, 1756 insertions(+), 1721 deletions(-) diff --git a/pom.xml b/pom.xml index 82e2cb0fb..0fed99651 100644 --- a/pom.xml +++ b/pom.xml @@ -307,7 +307,7 @@ com.github.romix.akka akka-kryo-serialization_${scala.version} - 0.5.2 + 0.5.1 com.github.cb372 diff --git a/src/main/scala/bootstrap/liftweb/Boot.scala b/src/main/scala/bootstrap/liftweb/Boot.scala index dfac48c01..41d55daeb 100644 --- a/src/main/scala/bootstrap/liftweb/Boot.scala +++ b/src/main/scala/bootstrap/liftweb/Boot.scala @@ -382,12 +382,12 @@ class Boot extends MdcLoggable { TransactionStatusScheduler.start(delay) } - APIUtil.akkaSanityCheck() match { - case Full(c) if c == true => logger.info(s"remotedata.secret matched = $c") - case Full(c) if c == false => throw new Exception(ErrorMessages.RemoteDataSecretMatchError) - case Empty => throw new Exception(ErrorMessages.RemoteDataSecretObtainError) - case _ => throw new Exception(s"Unexpected error occurs during Akka sanity check!") - } + //APIUtil.akkaSanityCheck() match { + // case Full(c) if c == true => logger.info(s"remotedata.secret matched = $c") + // case Full(c) if c == false => throw new Exception(ErrorMessages.RemoteDataSecretMatchError) + // case Empty => throw new Exception(ErrorMessages.RemoteDataSecretObtainError) + // case _ => throw new Exception(s"Unexpected error occurs during Akka sanity check!") + //} } diff --git a/src/main/scala/code/actorsystem/ObpActorConfig.scala b/src/main/scala/code/actorsystem/ObpActorConfig.scala index 4892bc24b..bbc68d044 100644 --- a/src/main/scala/code/actorsystem/ObpActorConfig.scala +++ b/src/main/scala/code/actorsystem/ObpActorConfig.scala @@ -24,24 +24,35 @@ object ObpActorConfig { provider = "akka.remote.RemoteActorRefProvider" allow-java-serialization = off kryo { - type = "graph" - idstrategy = "default" - buffer-size = 65536 - max-buffer-size = -1 - use-manifests = false - use-unsafe = true - post-serialization-transformations = "off" - #post-serialization-transformations = "lz4,aes" - #encryption { - # aes { - # mode = "AES/CBC/PKCS5Padding" - # key = j68KkRjq21ykRGAQ - # IV-length = 16 - # } - #} - implicit-registration-logging = false - kryo-trace = false - resolve-subclasses = true + setIgnoreSyntheticFields = true + type = "graph" + idstrategy = "default" + buffer-size = 65536 + max-buffer-size = -1 + use-manifests = false + use-unsafe = false + post-serialization-transformations = "off" + #post-serialization-transformations = "lz4,aes" + #encryption { + # aes { + # mode = "AES/CBC/PKCS5Padding" + # key = j68KkRjq21ykRGAQ + # IV-length = 16 + # } + #} + implicit-registration-logging = false + kryo-trace = true + resolve-subclasses = true + #mappings = { + # "akka.actor.ActorSelectionMessage" = 40 + # "scala.collection.immutnnnnable.Vector" = 41 + # "akka.actor.SelectChildName" = 42 + # "code.views.RemotedataViewsCaseClasses" = 43 + # "code.views.RemotedataViewsCaseClasses$createOwnerView" = 44 + # "code.model.AccountId" = 45 + # "code.model.BankId" = 46 + # "net.liftweb.mapper.MappedString$$Lambda" = 47 + #} } serializers { kryo = "com.romix.akka.serialization.kryo.KryoSerializer" @@ -51,6 +62,7 @@ object ObpActorConfig { "net.liftweb.common.Empty" = kryo, "net.liftweb.common.Box" = kryo, "net.liftweb.common.ParamFailure" = kryo, + "net.liftweb.mapper.MappedString" = kryo, "code.api.APIFailure" = kryo, "code.model.BankAccount" = kryo, "code.model.View" = kryo, diff --git a/src/main/scala/code/api/util/APIUtil.scala b/src/main/scala/code/api/util/APIUtil.scala index 4dd001a5a..728e63488 100644 --- a/src/main/scala/code/api/util/APIUtil.scala +++ b/src/main/scala/code/api/util/APIUtil.scala @@ -277,7 +277,7 @@ object APIUtil extends MdcLoggable { def registeredApplication(consumerKey: String): Boolean = { Consumers.consumers.vend.getConsumerByConsumerKey(consumerKey) match { - case Full(application) => application.isActive + case Full(application) => application.isActive.get case _ => false } } @@ -523,10 +523,10 @@ object APIUtil extends MdcLoggable { } if(parsedDate.isDefined){ - Full(parsedDate.get) + parsedDate } else if(fallBackParsedDate.isDefined){ - Full(fallBackParsedDate.get) + fallBackParsedDate } else{ Failure(FilterDateFormatError) diff --git a/src/main/scala/code/api/v2_1_0/APIMethods210.scala b/src/main/scala/code/api/v2_1_0/APIMethods210.scala index afe5d5c2e..b4eeb8fde 100644 --- a/src/main/scala/code/api/v2_1_0/APIMethods210.scala +++ b/src/main/scala/code/api/v2_1_0/APIMethods210.scala @@ -1729,19 +1729,19 @@ trait APIMethods210 { setFilterPart1 <- Full(parameters += OBPLimit(limit) +=OBPOffset(offset) += OBPFromDate(startDate)+= OBPToDate(endDate)) setFilterPart2 <- if (!consumerId.isEmpty) - Full(parameters += OBPConsumerId(consumerId.get)) + Full(parameters += OBPConsumerId(consumerId.getOrElse(""))) else if (!userId.isEmpty) - Full(parameters += OBPUserId(userId.get)) + Full(parameters += OBPUserId(userId.getOrElse(""))) else if (!url.isEmpty) - Full(parameters += OBPUrl(url.get)) + Full(parameters += OBPUrl(url.getOrElse(""))) else if (!appName.isEmpty) - Full(parameters += OBPAppName(appName.get)) + Full(parameters += OBPAppName(appName.getOrElse(""))) else if (!implementedInVersion.isEmpty) - Full(parameters += OBPImplementedInVersion(implementedInVersion.get)) + Full(parameters += OBPImplementedInVersion(implementedInVersion.getOrElse(""))) else if (!implementedByPartialFunction.isEmpty) - Full(parameters += OBPImplementedByPartialFunction(implementedByPartialFunction.get)) + Full(parameters += OBPImplementedByPartialFunction(implementedByPartialFunction.getOrElse(""))) else if (!verb.isEmpty) - Full(parameters += OBPVerb(verb.get)) + Full(parameters += OBPVerb(verb.getOrElse(""))) else Full(parameters) diff --git a/src/main/scala/code/model/dataAccess/view.scala b/src/main/scala/code/model/dataAccess/view.scala index 15a242233..cc3a32b34 100644 --- a/src/main/scala/code/model/dataAccess/view.scala +++ b/src/main/scala/code/model/dataAccess/view.scala @@ -56,7 +56,7 @@ class ViewImpl extends View with LongKeyedMapper[ViewImpl] with ManyToMany with def getSingleton = ViewImpl def primaryKeyField = id_ - object users_ extends MappedManyToMany(ViewPrivileges, ViewPrivileges.view, ViewPrivileges.user, ResourceUser) + //object users_ extends MappedManyToMany(ViewPrivileges, ViewPrivileges.view, ViewPrivileges.user, ResourceUser) object bankPermalink extends MappedString(this, 255) object accountPermalink extends MappedString(this, 255) @@ -67,7 +67,7 @@ class ViewImpl extends View with LongKeyedMapper[ViewImpl] with ManyToMany with object description_ extends MappedString(this, 255) object permalink_ extends MappedString(this, 255) - def users : List[User] = users_.toList + def users : List[User] = List.empty //users_.toList //Important! If you add a field, be sure to handle it here in this function def setFromViewData(viewData : ViewSpecification) = { diff --git a/src/main/scala/code/remotedata/RemotedataViewsActor.scala b/src/main/scala/code/remotedata/RemotedataViewsActor.scala index aca329da9..5f31af69b 100644 --- a/src/main/scala/code/remotedata/RemotedataViewsActor.scala +++ b/src/main/scala/code/remotedata/RemotedataViewsActor.scala @@ -103,8 +103,10 @@ class RemotedataViewsActor extends Actor with ObpActorHelper with MdcLoggable { sender ! extractResult(mapper.getNonPublicBankAccounts(user)) case cc.createOwnerView(bankId, accountId, description) => - logger.debug("createOwnerView(" + bankId +", "+ accountId +", "+ description +")") - sender ! extractResult(mapper.createOwnerView(bankId, accountId, description)) + logger.info("createOwnerView(" + bankId +", "+ accountId +", "+ description +")") + val res = extractResult(mapper.createOwnerView(bankId, accountId, description)) + println("------------------------------------> res=" + res) + sender ! res.asInstanceOf[code.model.View] case cc.createPublicView(bankId, accountId, description) => logger.debug("createPublicView(" + bankId +", "+ accountId +", "+ description +")") diff --git a/src/main/scala/code/views/MapperViews.scala b/src/main/scala/code/views/MapperViews.scala index 78689b9ac..2705cc9fe 100644 --- a/src/main/scala/code/views/MapperViews.scala +++ b/src/main/scala/code/views/MapperViews.scala @@ -413,10 +413,12 @@ object MapperViews extends Views with MdcLoggable { } def createOwnerView(bankId: BankId, accountId: AccountId, description: String = "Owner View") : Box[View] = { - getExistingView(bankId, accountId, "Owner") match { + val res = getExistingView(bankId, accountId, "Owner") match { case Empty => createDefaultOwnerView(bankId, accountId, description) case Full(v) => Full(v) } + println("============================================> res=" + res) + res } def getOwners(view: View) : Set[User] = { diff --git a/src/test/scala/code/AppTest.scala b/src/test/scala/code/AppTest.scala index b4f0c2e60..bf269f6fc 100644 --- a/src/test/scala/code/AppTest.scala +++ b/src/test/scala/code/AppTest.scala @@ -12,7 +12,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. -You must have received a copy of the GNU Affero General Public License +you should have received a copy of the GNU Affero General Public License along with this program. If not, see . Email: contact@tesobe.com diff --git a/src/test/scala/code/api/directloginTest.scala b/src/test/scala/code/api/directloginTest.scala index d24a7cc33..615146a12 100644 --- a/src/test/scala/code/api/directloginTest.scala +++ b/src/test/scala/code/api/directloginTest.scala @@ -96,7 +96,7 @@ class directloginTest extends ServerSetup with BeforeAndAfter { //setupUserAndConsumer Given("the app we are testing is registered and active") - Then("We must be able to find it") + Then("We should be able to find it") //val consumers = OBPConsumer.findAll() //assert(registeredApplication(KEY) == true) @@ -104,7 +104,7 @@ class directloginTest extends ServerSetup with BeforeAndAfter { val request = directLoginRequest val response = makePostRequestAdditionalHeader(request, "", List(accessControlOriginHeader)) - Then("We must get a 400 - Bad Request") + Then("We should get a 400 - Bad Request") response.code must equal(400) assertResponse(response, ErrorMessages.DirectLoginMissingParameters) } @@ -114,14 +114,14 @@ class directloginTest extends ServerSetup with BeforeAndAfter { //setupUserAndConsumer Given("the app we are testing is registered and active") - Then("We must be able to find it") + Then("We should be able to find it") //assert(registeredApplication(KEY) == true) When("we try to login with an invalid username/password") val request = directLoginRequest val response = makePostRequestAdditionalHeader(request, "", invalidUsernamePasswordHeaders) - Then("We must get a 401 - Unauthorized") + Then("We should get a 401 - Unauthorized") response.code must equal(401) assertResponse(response, ErrorMessages.InvalidLoginCredentials) } @@ -131,7 +131,7 @@ class directloginTest extends ServerSetup with BeforeAndAfter { val request = directLoginRequest val response = makePostRequestAdditionalHeader(request, "", invalidUsernamePasswordCharaterHeaders) - Then("We must get a 400 - Invalid Characters") + Then("We should get a 400 - Invalid Characters") response.code must equal(400) assertResponse(response, ErrorMessages.InvalidValueCharacters) } @@ -148,13 +148,13 @@ class directloginTest extends ServerSetup with BeforeAndAfter { response = makePostRequestAdditionalHeader(request, "", validUsernameInvalidPasswordHeaders) response = makePostRequestAdditionalHeader(request, "", validUsernameInvalidPasswordHeaders) - Then("We must get a 401 - the username has been locked") + Then("We should get a 401 - the username has been locked") response.code must equal(401) assertResponse(response, ErrorMessages.UsernameHasBeenLocked) Then("We login in with the valid username and valid passpord, the username still be locked ") response = makePostRequestAdditionalHeader(request, "", validHeaders) - Then("We must get a 401 - the username has been locked") + Then("We should get a 401 - the username has been locked") response.code must equal(401) assertResponse(response, ErrorMessages.UsernameHasBeenLocked) @@ -167,7 +167,7 @@ class directloginTest extends ServerSetup with BeforeAndAfter { When("We try to login with username/password") val request = directLoginRequest val response = makePostRequestAdditionalHeader(request, "", disabledConsumerKeyHeaders) - Then("We must get a 401") + Then("We should get a 401") response.code must equal(401) assertResponse(response, ErrorMessages.InvalidConsumerKey) } @@ -177,14 +177,14 @@ class directloginTest extends ServerSetup with BeforeAndAfter { //setupUserAndConsumer Given("the app we are testing is registered and active") - Then("We must be able to find it") + Then("We should be able to find it") //assert(registeredApplication(KEY) == true) When("we try to login with a missing DirectLogin header") val request = directLoginRequest val response = makePostRequest(request,"") - Then("We must get a 400 - Bad Request") + Then("We should get a 400 - Bad Request") response.code must equal(400) assertResponse(response, ErrorMessages.DirectLoginMissingParameters) } @@ -194,14 +194,14 @@ class directloginTest extends ServerSetup with BeforeAndAfter { //setupUserAndConsumer Given("the app we are testing is registered and active") - Then("We must be able to find it") + Then("We should be able to find it") //assert(registeredApplication(KEY) == true) When("the consumer key is invalid") val request = directLoginRequest val response = makePostRequestAdditionalHeader(request, "", invalidConsumerKeyHeaders) - Then("We must get a 401 - Unauthorized") + Then("We should get a 401 - Unauthorized") response.code must equal(401) assertResponse(response, ErrorMessages.InvalidConsumerKey) } @@ -211,14 +211,14 @@ class directloginTest extends ServerSetup with BeforeAndAfter { //setupUserAndConsumer Given("the app we are testing is registered and active") - Then("We must be able to find it") + Then("We should be able to find it") //assert(registeredApplication(KEY) == true) When("the header and credentials are good") val request = directLoginRequest val response = makePostRequestAdditionalHeader(request, "", validHeaders) var token = "INVALID" - Then("We must get a 200 - OK and a token") + Then("We should get a 200 - OK and a token") response.code must equal(200) response.body match { case JObject(List(JField(name, JString(value)))) => @@ -235,7 +235,7 @@ class directloginTest extends ServerSetup with BeforeAndAfter { val request2 = baseRequest / "obp" / "v2.0.0" / "my" / "accounts" val response2 = makeGetRequest(request2, validHeadersWithToken) - Then("We must get a 200 - OK and an empty list of accounts") + Then("We should get a 200 - OK and an empty list of accounts") response2.code must equal(200) response2.body match { case JArray(List()) => diff --git a/src/test/scala/code/api/oauthTest.scala b/src/test/scala/code/api/oauthTest.scala index e945bd6be..d36389301 100644 --- a/src/test/scala/code/api/oauthTest.scala +++ b/src/test/scala/code/api/oauthTest.scala @@ -12,7 +12,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. -You must have received a copy of the GNU Affero General Public License +you should have received a copy of the GNU Affero General Public License along with this program. If not, see . Email: contact@tesobe.com @@ -196,7 +196,7 @@ class OAuthTest extends ServerSetup { Given("The application is registered and does not have a callback URL") When("the request is sent") val reply = getRequestToken(consumer, oob) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) And("we can extract the token form the body") val requestToken = extractToken(reply.body) @@ -205,7 +205,7 @@ class OAuthTest extends ServerSetup { Given("The application is registered and have a callback URL") When("the request is sent") val reply = getRequestToken(consumer, "localhost:8080/app") - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) And("we can extract the token form the body") val requestToken = extractToken(reply.body) @@ -214,23 +214,23 @@ class OAuthTest extends ServerSetup { Given("The application not registered") When("the request is sent") val reply = getRequestToken(notRegisteredConsumer, oob) - Then("we must get a 401 code") + Then("We should get a 401 code") reply.code must equal (401) } scenario("we don't get a request token since the application is not registered even with a callback URL", RequestToken, Oauth) { Given("The application not registered") When("the request is sent") val reply = getRequestToken(notRegisteredConsumer, "localhost:8080/app") - Then("we must get a 401 code") + Then("We should get a 401 code") reply.code must equal (401) } scenario("We don't get a request token since the application is not enabled", RequestToken, Oauth) { Given("The application is not enabled") When("The request is sent") val reply = getRequestToken(disabledConsumer, oob) - Then("We must get a 401 code") + Then("We should get a 401 code") reply.code must equal (401) - And("We must get message") + And("We should get message") reply.body must equal (ErrorMessages.InvalidConsumerCredentials) } } @@ -245,7 +245,7 @@ class OAuthTest extends ServerSetup { case Full(v) => v case Empty => null } - Then("we must get a verifier") + Then("We should get a verifier") verifier must not equal (null) } scenario("the user login and is asked to enter the verifier manually", Verifier, Oauth){ @@ -254,21 +254,21 @@ class OAuthTest extends ServerSetup { val requestToken = extractToken(reply.body) When("the browser is launched to login") val verifier = getVerifier(requestToken.value, user1.username.get, user1Password) - Then("we must get a verifier") + Then("We should get a verifier") verifier.isEmpty must equal (false) } scenario("the user cannot login because there is no token", Verifier, Oauth){ Given("there will be no token") When("the browser is launched to login") val verifier = getVerifier(user1.username.get, user1Password) - Then("we must not get a verifier") + Then("We should not get a verifier") verifier.isEmpty must equal (true) } scenario("the user cannot login because the token does not exist", Verifier, Oauth){ Given("we will use a random request token") When("the browser is launched to login") val verifier = getVerifier(randomString(4), user1.username.get, user1Password) - Then("we must not get a verifier") + Then("We should not get a verifier") verifier.isEmpty must equal (true) } } @@ -282,7 +282,7 @@ class OAuthTest extends ServerSetup { } When("when we ask for an access token") val accessToken = getAccessToken(consumer, requestToken, verifier) - Then("we must get an access token") + Then("We should get an access token") extractToken(accessToken.body) } scenario("we get an access token with a callback", AccessToken, Oauth){ @@ -294,7 +294,7 @@ class OAuthTest extends ServerSetup { } When("when we ask for an access token") val accessToken = getAccessToken(consumer, requestToken, verifier) - Then("we must get an access token") + Then("We should get an access token") extractToken(accessToken.body) } scenario("we don't get an access token because the verifier is wrong", AccessToken, Oauth){ @@ -303,7 +303,7 @@ class OAuthTest extends ServerSetup { val requestToken = extractToken(reply.body) When("when we ask for an access token") val accessTokenReply = getAccessToken(consumer, requestToken, randomString(5)) - Then("we must get a 401") + Then("We should get a 401") accessTokenReply.code must equal (401) } scenario("we don't get an access token because the request token is wrong", AccessToken, Oauth){ @@ -316,7 +316,7 @@ class OAuthTest extends ServerSetup { When("when we ask for an access token with a request token") val randomRequestToken = Token(randomString(5), randomString(5)) val accessTokenReply = getAccessToken(consumer, randomRequestToken, verifier) - Then("we must get a 401") + Then("We should get a 401") accessTokenReply.code must equal (401) } scenario("we don't get an access token because the requestToken and the verifier are wrong", AccessToken, Oauth){ @@ -325,7 +325,7 @@ class OAuthTest extends ServerSetup { When("when we ask for an access token with a request token") val randomRequestToken = Token(randomString(5), randomString(5)) val accessTokenReply = getAccessToken(consumer, randomRequestToken, randomString(5)) - Then("we must get a 401") + Then("We should get a 401") accessTokenReply.code must equal (401) } } @@ -346,14 +346,14 @@ class OAuthTest extends ServerSetup { verifier = getVerifier(requestToken.value, user1.username.get, invalidPassword) verifier = getVerifier(requestToken.value, user1.username.get, invalidPassword) - Then("we must get a locked account verifier") + Then("We should get a locked account verifier") verifier.asInstanceOf[Failure].msg.contains(ErrorMessages.UsernameHasBeenLocked) Then("We login in with valid username and password, it will still be failed") verifier = getVerifier(requestToken.value, user1.username.get, user1Password) - Then("we must get a locked account verifier") + Then("We should get a locked account verifier") verifier.asInstanceOf[Failure].msg.contains(ErrorMessages.UsernameHasBeenLocked) Then("We unlock the username") @@ -371,7 +371,7 @@ class OAuthTest extends ServerSetup { Then("we set the valid username, valid password and try to login") val verifier = getVerifier(requestToken.value, user2.username.get, user2Password) - Then("we must get a message: " + accountValidationError) + Then("We should get a message: " + accountValidationError) verifier.contains(accountValidationError) must equal (true) } } diff --git a/src/test/scala/code/api/v1_2_0/API12Test.scala b/src/test/scala/code/api/v1_2_0/API12Test.scala index 6929bb3b0..0f1fa5519 100644 --- a/src/test/scala/code/api/v1_2_0/API12Test.scala +++ b/src/test/scala/code/api/v1_2_0/API12Test.scala @@ -12,7 +12,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. -You must have received a copy of the GNU Affero General Public License +you should have received a copy of the GNU Affero General Public License along with this program. If not, see . Email: contact@tesobe.com @@ -35,7 +35,7 @@ import java.util.Date import _root_.net.liftweb.json.JsonAST.JObject -import code.api.{DefaultUsers, User1AllPrivileges} +import code.setup.{DefaultUsers, User1AllPrivileges} import code.api.util.APIUtil import org.scalatest._ import _root_.net.liftweb.util._ @@ -50,7 +50,7 @@ import _root_.net.liftweb.json.JsonAST.JObject import net.liftweb.json.JsonDSL._ import scala.util.Random._ -import code.api.APIResponse +import code.setup.APIResponse import code.model.{Consumer => OBPConsumer, Token => OBPToken, _} import code.setup.{APIResponse, DefaultUsers, User1AllPrivileges} import code.views.Views @@ -637,7 +637,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { Given("We will not use an access token") When("the request is sent") val reply = getAPIInfo - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val apiInfo = reply.body.extract[APIInfoJSON] apiInfo.version must equal ("1.2") @@ -650,7 +650,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { Given("We will not use an access token") When("the request is sent") val reply = getBanksInfo - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val banksInfo = reply.body.extract[BanksJSON] banksInfo.banks.foreach(b => { @@ -664,7 +664,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { Given("We will not use an access token") When("the request is sent") val reply = getBankInfo(randomBank) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val bankInfo = reply.body.extract[BankJSON] bankInfo.id.nonEmpty must equal (true) @@ -674,9 +674,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { Given("We will not use an access token and request a random bankId") When("the request is sent") val reply = getBankInfo(randomString(5)) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -715,10 +715,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { Given("We will not use an access token") When("the request is sent") val reply = getBankAccounts(randomBank, None) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val publicAccountsInfo = reply.body.extract[AccountsJSON] - And("some fields must not be empty") + And("some fields should not be empty") publicAccountsInfo.accounts.foreach(a => { a.id.nonEmpty must equal (true) a.views_available.nonEmpty must equal (true) @@ -738,10 +738,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { Given("We will use an access token") When("the request is sent") val reply = getBankAccounts(randomBank, user1) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val accountsInfo = reply.body.extract[AccountsJSON] - And("some fields must not be empty") + And("some fields should not be empty") accountsInfo.accounts.foreach(a => { a.id.nonEmpty must equal (true) a.views_available.nonEmpty must equal (true) @@ -752,7 +752,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { // more than public access. This test therefore does not test that condition as the v1.2 API // call is being kept that way to avoid breaking any existing applications using it. This API // call is fixed in v1.2.1 - And("Some accounts must have private views") + And("Some accounts should have private views") assertViewExistsWithCondition(accountsInfo, !_.is_public) And("The accounts are only from one bank") @@ -768,10 +768,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { Given("We will not use an access token") When("the request is sent") val reply = getPublicAccounts(randomBank) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val publicAccountsInfo = reply.body.extract[AccountsJSON] - And("some fields must not be empty") + And("some fields should not be empty") publicAccountsInfo.accounts.foreach(a => { a.id.nonEmpty must equal (true) a.views_available.nonEmpty must equal (true) @@ -794,16 +794,16 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { Given("We will use an access token") When("the request is sent") val reply = getPrivateAccounts(randomBank, user1) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) - And("some fields must not be empty") + And("some fields should not be empty") val privateAccountsInfo = reply.body.extract[AccountsJSON] privateAccountsInfo.accounts.foreach(a => { a.id.nonEmpty must equal (true) a.views_available.nonEmpty must equal (true) }) - And("All accounts must have at least one private view") + And("All accounts should have at least one private view") assertAllAccountsHaveAViewWithCondition(privateAccountsInfo, !_.is_public) And("The accounts are only from one bank") @@ -816,9 +816,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { Given("We will not use an access token") When("the request is sent") val reply = getPrivateAccounts(randomBank, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -832,9 +832,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val view = bankAccount.views_available.toList(randomPosition) When("the request is sent") val reply = getPublicBankAccountDetails(bankId, bankAccount.id, view.id) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) - And("some fields must not be empty") + And("some fields should not be empty") val publicAccountDetails = reply.body.extract[ModeratedAccountJSON] publicAccountDetails.id.nonEmpty must equal (true) publicAccountDetails.bank_id.nonEmpty must equal (true) @@ -849,10 +849,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val view = bankAccount.views_available.toList(randomPosition) When("the request is sent") val reply = getPrivateBankAccountDetails(bankId, bankAccount.id, view.id, user1) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val privateAccountDetails = reply.body.extract[ModeratedAccountJSON] - And("some fields must not be empty") + And("some fields should not be empty") privateAccountDetails.id.nonEmpty must equal (true) privateAccountDetails.bank_id.nonEmpty must equal (true) privateAccountDetails.views_available.nonEmpty must equal (true) @@ -866,7 +866,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getAccountViews(bankId, bankAccount.id, user1) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) reply.body.extract[ViewsJSON] } @@ -877,9 +877,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getAccountViews(bankId, bankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -889,9 +889,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getAccountViews(bankId, bankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -904,10 +904,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val view = randomView(true, "") When("the request is sent") val reply = postView(bankId, bankAccount.id, view, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") reply.code must equal (201) reply.body.extract[ViewJSON] - And("we must get a new view") + And("We should get a new view") val viewsAfter = getAccountViews(bankId, bankAccount.id, user1).body.extract[ViewsJSON].views viewsBefore.size must equal (viewsAfter.size -1) } @@ -919,9 +919,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val view = randomView(true, "") When("the request is sent") val reply = postView(bankId, bankAccount.id, view, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -932,9 +932,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val view = randomView(true, "") When("the request is sent") val reply = postView(bankId, bankAccount.id, view, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -944,9 +944,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val view = randomView(true, "") When("the request is sent") val reply = postView(bankId, randomString(3), view, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -958,9 +958,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postView(bankId, bankAccount.id, view, user1) When("the request is sent") val reply = postView(bankId, bankAccount.id, view, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -1010,7 +1010,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("We use a valid access token and valid put json") val reply = putView(bankId, bankAccount.id, createdView.id, viewUpdateJson(createdView), user1) - Then("We must get back the updated view") + Then("We should get back the updated view") reply.code must equal (200) val updatedView = reply.body.extract[ViewJSON] updatedView.can_see_images must equal(true) @@ -1035,7 +1035,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("we try to update that view") val reply = putView(bankId, bankAccount.id, nonExistantViewId, someViewUpdateJson(), user1) - Then("We must get a 404") + Then("We should get a 404") reply.code must equal(404) } @@ -1050,10 +1050,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("we don't use an access token") val reply = putView(bankId, bankAccount.id, createdView.id, viewUpdateJson(createdView), None) - Then("we must get a 400") + Then("We should get a 400") reply.code must equal(400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1068,10 +1068,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("we try to update a view without having sufficient privileges to do so") val reply = putView(bankId, bankAccount.id, createdView.id, viewUpdateJson(createdView), user3) - Then("we must get a 400") + Then("We should get a 400") reply.code must equal(400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -1087,9 +1087,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val viewsBefore = getAccountViews(bankId, bankAccount.id, user1).body.extract[ViewsJSON].views When("the request is sent") val reply = deleteView(bankId, bankAccount.id, view.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") reply.code must equal (204) - And("the views must be updated") + And("the views should beupdated") val viewsAfter = getAccountViews(bankId, bankAccount.id, user1).body.extract[ViewsJSON].views viewsBefore.size must equal (viewsAfter.size +1) } @@ -1101,9 +1101,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = deleteView(bankId, bankAccount.id, view, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1114,9 +1114,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = deleteView(bankId, bankAccount.id, view, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1126,9 +1126,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = deleteView(bankId, bankAccount.id, randomString(3), user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -1140,7 +1140,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getAccountPermissions(bankId, bankAccount.id, user1) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) reply.body.extract[PermissionsJSON] @@ -1175,9 +1175,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getAccountPermissions(bankId, bankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1187,9 +1187,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getAccountPermissions(bankId, bankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -1203,10 +1203,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val userID = permission.user.id When("the request is sent") val reply = getUserAccountPermission(bankId, bankAccount.id, userID, user1) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val viewsInfo = reply.body.extract[ViewsJSON] - And("some fields must not be empty") + And("some fields should not be empty") viewsInfo.views.foreach(v => v.id.nonEmpty must equal (true)) } @@ -1218,9 +1218,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val userID = permission.user.id When("the request is sent") val reply = getUserAccountPermission(bankId, bankAccount.id, userID, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1230,9 +1230,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getUserAccountPermission(bankId, bankAccount.id, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -1245,10 +1245,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent") val userId = resourceUser2.idGivenByProvider val reply = grantUserAccessToView(bankId, bankAccount.id, userId, randomViewPermalink(bankId, bankAccount), user1) - Then("we must get a 201 ok code") + Then("We should get a 201 ok code") reply.code must equal (201) val viewInfo = reply.body.extract[ViewJSON] - And("some fields must not be empty") + And("some fields should not be empty") viewInfo.id.nonEmpty must equal (true) } @@ -1258,9 +1258,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = grantUserAccessToView(bankId, bankAccount.id, randomString(5), randomViewPermalink(bankId, bankAccount), user1) - Then("we must get a 400 ok code") + Then("We should get a 400 ok code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1271,9 +1271,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val userId = resourceUser2.idGivenByProvider When("the request is sent") val reply = grantUserAccessToView(bankId, bankAccount.id, userId, randomString(5), user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1284,9 +1284,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val userId = resourceUser2.idGivenByProvider When("the request is sent") val reply = grantUserAccessToView(bankId, bankAccount.id, userId, randomViewPermalink(bankId, bankAccount), user3) - Then("we must get a 400 ok code") + Then("We should get a 400 ok code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -1300,12 +1300,12 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val viewsIdsToGrant = randomViewsIdsToGrant(bankId, bankAccount.id) When("the request is sent") val reply = grantUserAccessToViews(bankId, bankAccount.id, userId, viewsIdsToGrant, user1) - Then("we must get a 201 ok code") + Then("We should get a 201 ok code") reply.code must equal (201) val viewsInfo = reply.body.extract[ViewsJSON] - And("some fields must not be empty") + And("some fields should not be empty") viewsInfo.views.foreach(v => v.id.nonEmpty must equal (true)) - And("the granted views must be the same") + And("the granted views should bethe same") viewsIdsToGrant.toSet must equal(viewsInfo.views.map(_.id).toSet) //we revoke access to the granted views for the next tests revokeUserAccessToAllViews(bankId, bankAccount.id, userId, user1) @@ -1319,9 +1319,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val viewsIdsToGrant= randomViewsIdsToGrant(bankId, bankAccount.id) When("the request is sent") val reply = grantUserAccessToViews(bankId, bankAccount.id, userId, viewsIdsToGrant, user1) - Then("we must get a 400 ok code") + Then("We should get a 400 ok code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1333,9 +1333,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val viewsIdsToGrant= List(randomString(3),randomString(3)) When("the request is sent") val reply = grantUserAccessToViews(bankId, bankAccount.id, userId, viewsIdsToGrant, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1347,9 +1347,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val viewsIdsToGrant= randomViewsIdsToGrant(bankId, bankAccount.id) ++ List(randomString(3),randomString(3)) When("the request is sent") val reply = grantUserAccessToViews(bankId, bankAccount.id, userId, viewsIdsToGrant, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1361,9 +1361,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val viewsIdsToGrant= randomViewsIdsToGrant(bankId, bankAccount.id) ++ List(randomString(3),randomString(3)) When("the request is sent") val reply = grantUserAccessToViews(bankId, bankAccount.id, userId, viewsIdsToGrant, user3) - Then("we must get a 400 ok code") + Then("We should get a 400 ok code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -1380,7 +1380,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val viewsBefore = getUserAccountPermission(bankId, bankAccount.id, userId, user1).body.extract[ViewsJSON].views.length When("the request is sent") val reply = revokeUserAccessToView(bankId, bankAccount.id, userId, viewId, user1) - Then("we must get a 204 no content code") + Then("We should get a 204 no content code") reply.code must equal (204) val viewsAfter = getUserAccountPermission(bankId, bankAccount.id, userId, user1).body.extract[ViewsJSON].views.length viewsAfter must equal(viewsBefore -1) @@ -1398,7 +1398,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val viewsBefore = getUserAccountPermission(bankId, bankAccount.id, userId1, user1).body.extract[ViewsJSON].views.length When("the request is sent") val reply = revokeUserAccessToView(bankId, bankAccount.id, userId1, viewId, user1) - Then("we must get a 204 no content code") + Then("We should get a 204 no content code") reply.code must equal (204) val viewsAfter = getUserAccountPermission(bankId, bankAccount.id, userId1, user1).body.extract[ViewsJSON].views.length viewsAfter must equal(viewsBefore -1) @@ -1424,7 +1424,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val viewUsersBefore = Views.views.vend.getOwners(view).toList When("the request is sent") val reply = revokeUserAccessToView(bankId, bankAccount.id, viewUsersBefore(0).idGivenByProvider, viewId.value, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) val viewUsersAfter = Views.views.vend.getOwners(view).toList viewUsersAfter.length must equal(viewUsersBefore.length) @@ -1436,7 +1436,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = revokeUserAccessToView(bankId, bankAccount.id, randomString(5), randomViewPermalink(bankId, bankAccount), user1) - Then("we must get a 400 ok code") + Then("We should get a 400 ok code") reply.code must equal (400) } @@ -1447,7 +1447,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val userId =resourceUser2.idGivenByProvider When("the request is sent") val reply = revokeUserAccessToView(bankId, bankAccount.id, userId, randomString(5), user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) } @@ -1458,7 +1458,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val userId = resourceUser2.idGivenByProvider When("the request is sent") val reply = revokeUserAccessToView(bankId, bankAccount.id, userId, randomViewPermalink(bankId, bankAccount), user3) - Then("we must get a 400 ok code") + Then("We should get a 400 ok code") reply.code must equal (400) } } @@ -1474,7 +1474,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { grantUserAccessToViews(bankId, bankAccount.id, userId, viewsIdsToGrant, user1) When("the request is sent") val reply = revokeUserAccessToAllViews(bankId, bankAccount.id, userId, user1) - Then("we must get a 204 no content code") + Then("We should get a 204 no content code") reply.code must equal (204) } scenario("we cannot revoke the access to a user that does not exist", API1_2, DeletePermissions) { @@ -1483,7 +1483,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = revokeUserAccessToAllViews(bankId, bankAccount.id, randomString(5), user1) - Then("we must get a 400 ok code") + Then("We should get a 400 ok code") reply.code must equal (400) } @@ -1497,7 +1497,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { grantUserAccessToViews(bankId, bankAccount.id, userId, viewsIdsToGrant, user1) When("the request is sent") val reply = revokeUserAccessToAllViews(bankId, bankAccount.id, userId, user3) - Then("we must get a 400 ok code") + Then("We should get a 400 ok code") reply.code must equal (400) } } @@ -1509,10 +1509,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getTheOtherBankAccounts(bankId, bankAccount.id, randomViewPermalink(bankId, bankAccount), user1) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) val accountsJson = reply.body.extract[OtherAccountsJSON] - And("some fields must not be empty") + And("some fields should not be empty") accountsJson.other_accounts.foreach( a => a.id.nonEmpty must equal (true) ) @@ -1524,9 +1524,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getTheOtherBankAccounts(bankId, bankAccount.id, randomViewPermalink(bankId, bankAccount), None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1536,9 +1536,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getTheOtherBankAccounts(bankId, bankAccount.id, randomViewPermalink(bankId, bankAccount), user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1548,9 +1548,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getTheOtherBankAccounts(bankId, bankAccount.id, randomString(5), user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -1564,10 +1564,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val otherBankAccount = randomOtherBankAccount(bankId, bankAccount.id, view) When("the request is sent") val reply = getTheOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) val accountJson = reply.body.extract[OtherAccountJSON] - And("some fields must not be empty") + And("some fields should not be empty") accountJson.id.nonEmpty must equal (true) } @@ -1579,9 +1579,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val otherBankAccount = randomOtherBankAccount(bankId, bankAccount.id, view) When("the request is sent") val reply = getTheOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1593,9 +1593,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val otherBankAccount = randomOtherBankAccount(bankId, bankAccount.id, view) When("the request is sent") val reply = getTheOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1606,9 +1606,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val otherBankAccount = randomOtherBankAccount(bankId, bankAccount.id, randomViewPermalink(bankId, bankAccount)) When("the request is sent") val reply = getTheOtherBankAccount(bankId, bankAccount.id, randomString(5), otherBankAccount.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1619,9 +1619,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = getTheOtherBankAccount(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -1635,9 +1635,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val otherBankAccount = randomOtherBankAccount(bankId, bankAccount.id, view) When("the request is sent") val reply = getMetadataOfOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) - And("some fields must not be empty") + And("some fields should not be empty") reply.body.extract[OtherAccountMetadataJSON] } @@ -1649,9 +1649,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val otherBankAccount = randomOtherBankAccount(bankId, bankAccount.id, view) When("the request is sent") val reply = getMetadataOfOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1663,9 +1663,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val otherBankAccount = randomOtherBankAccount(bankId, bankAccount.id, view) When("the request is sent") val reply = getMetadataOfOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1677,9 +1677,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val otherBankAccount = randomOtherBankAccount(bankId, bankAccount.id, view) When("the request is sent") val reply = getMetadataOfOneOtherBankAccount(bankId, bankAccount.id, randomString(5), otherBankAccount.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1690,9 +1690,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = getMetadataOfOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -1706,7 +1706,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val otherBankAccount = randomOtherBankAccount(bankId, bankAccount.id, view) When("the request is sent") val reply = getThePublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) reply.body.extract[AliasJSON] } @@ -1719,9 +1719,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val otherBankAccount = randomOtherBankAccount(bankId, bankAccount.id, view) When("the request is sent") val reply = getThePublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1733,9 +1733,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val otherBankAccount = randomOtherBankAccount(bankId, bankAccount.id, view) When("the request is sent") val reply = getThePublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1747,9 +1747,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val otherBankAccount = randomOtherBankAccount(bankId, bankAccount.id, view) When("the request is sent") val reply = getThePublicAliasForOneOtherBankAccount(bankId, bankAccount.id, randomString(5), otherBankAccount.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1761,9 +1761,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val otherBankAccount = randomOtherBankAccount(bankId, bankAccount.id, view) When("the request is sent") val reply = getThePublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -1778,10 +1778,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent") val randomAlias = randomString(5) val postReply = postAPublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[SuccessMessage] - And("the alias must be changed") + And("the alias should bechanged") val getReply = getThePublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must equal (theAliasAfterThePost.alias) @@ -1796,11 +1796,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomAlias = randomString(5) When("the request is sent") val postReply = postAPublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the alias must not be changed") + And("the alias should not be changed") val getReply = getThePublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must not equal (theAliasAfterThePost.alias) @@ -1815,11 +1815,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomAlias = randomString(5) When("the request is sent") val postReply = postAPublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the alias must not be changed") + And("the alias should not be changed") val getReply = getThePublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must not equal (theAliasAfterThePost.alias) @@ -1834,11 +1834,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomAlias = randomString(5) When("the request is sent") val postReply = postAPublicAliasForOneOtherBankAccount(bankId, bankAccount.id, randomString(5), otherBankAccount.id, randomAlias, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the alias must not be changed") + And("the alias should not be changed") val getReply = getThePublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must not equal (theAliasAfterThePost.alias) @@ -1852,9 +1852,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomAlias = randomString(5) When("the request is sent") val postReply = postAPublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), randomAlias, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -1869,10 +1869,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent") val randomAlias = randomString(5) val putReply = updateThePublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") putReply.code must equal (200) putReply.body.extract[SuccessMessage] - And("the alias must be changed") + And("the alias should bechanged") val getReply = getThePublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must equal (theAliasAfterThePost.alias) @@ -1887,11 +1887,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomAlias = randomString(5) When("the request is sent") val putReply = updateThePublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, None) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the alias must not be changed") + And("the alias should not be changed") val getReply = getThePublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must not equal (theAliasAfterThePost.alias) @@ -1906,9 +1906,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomAlias = randomString(5) When("the request is sent") val putReply = updateThePublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1920,9 +1920,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomAlias = randomString(5) When("the request is sent") val putReply = updateThePublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), randomAlias, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -1938,9 +1938,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postAPublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user1) When("the delete request is sent") val deleteReply = deleteThePublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) - And("the public alias must be null") + And("the public alias should benull") val getReply = getThePublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterTheDelete : AliasJSON = getReply.body.extract[AliasJSON] theAliasAfterTheDelete.alias must equal (null) @@ -1955,9 +1955,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postAPublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user1) When("the delete request is sent") val deleteReply = deleteThePublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the public alias must not be null") + And("the public alias should not be null") val getReply = getThePublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterTheDelete : AliasJSON = getReply.body.extract[AliasJSON] theAliasAfterTheDelete.alias must not equal (null) @@ -1972,9 +1972,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postAPublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user1) When("the delete request is sent") val deleteReply = deleteThePublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the public alias must not be null") + And("the public alias should not be null") val getReply = getThePublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterTheDelete : AliasJSON = getReply.body.extract[AliasJSON] theAliasAfterTheDelete.alias must not equal (null) @@ -1987,7 +1987,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomAlias = randomString(5) When("the delete request is sent") val deleteReply = deleteThePublicAliasForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } } @@ -2001,7 +2001,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val otherBankAccount = randomOtherBankAccount(bankId, bankAccount.id, view) When("the request is sent") val reply = getThePrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) reply.body.extract[AliasJSON] } @@ -2014,9 +2014,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val otherBankAccount = randomOtherBankAccount(bankId, bankAccount.id, view) When("the request is sent") val reply = getThePrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -2028,9 +2028,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val otherBankAccount = randomOtherBankAccount(bankId, bankAccount.id, view) When("the request is sent") val reply = getThePrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -2042,9 +2042,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val otherBankAccount = randomOtherBankAccount(bankId, bankAccount.id, view) When("the request is sent") val reply = getThePrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, randomString(5), otherBankAccount.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -2056,9 +2056,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent") val reply = getThePrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -2073,10 +2073,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent") val randomAlias = randomString(5) val postReply = postAPrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[SuccessMessage] - And("the alias must be changed") + And("the alias should bechanged") val getReply = getThePrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must equal (theAliasAfterThePost.alias) @@ -2091,11 +2091,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomAlias = randomString(5) When("the request is sent") val postReply = postAPrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the alias must not be changed") + And("the alias should not be changed") val getReply = getThePrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must not equal (theAliasAfterThePost.alias) @@ -2110,11 +2110,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomAlias = randomString(5) When("the request is sent") val postReply = postAPrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the alias must not be changed") + And("the alias should not be changed") val getReply = getThePrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must not equal (theAliasAfterThePost.alias) @@ -2129,11 +2129,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomAlias = randomString(5) When("the request is sent") val postReply = postAPrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, randomString(5), otherBankAccount.id, randomAlias, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the alias must not be changed") + And("the alias should not be changed") val getReply = getThePrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must not equal (theAliasAfterThePost.alias) @@ -2147,9 +2147,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomAlias = randomString(5) When("the request is sent") val postReply = postAPrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), randomAlias, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -2164,10 +2164,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent") val randomAlias = randomString(5) val putReply = updateThePrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") putReply.code must equal (200) putReply.body.extract[SuccessMessage] - And("the alias must be changed") + And("the alias should bechanged") val getReply = getThePrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must equal (theAliasAfterThePost.alias) @@ -2182,11 +2182,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomAlias = randomString(5) When("the request is sent") val putReply = updateThePrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, None) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the alias must not be changed") + And("the alias should not be changed") val getReply = getThePrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must not equal (theAliasAfterThePost.alias) @@ -2201,9 +2201,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomAlias = randomString(5) When("the request is sent") val putReply = updateThePrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -2215,9 +2215,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomAlias = randomString(5) When("the request is sent") val putReply = updateThePrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), randomAlias, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -2233,9 +2233,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postAPrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user1) When("the delete request is sent") val deleteReply = deleteThePrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) - And("the Private alias must be null") + And("the Private alias should benull") val getReply = getThePrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterTheDelete : AliasJSON = getReply.body.extract[AliasJSON] theAliasAfterTheDelete.alias must equal (null) @@ -2250,9 +2250,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postAPrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user1) When("the delete request is sent") val deleteReply = deleteThePrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the Private alias must not be null") + And("the Private alias should not be null") val getReply = getThePrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterTheDelete : AliasJSON = getReply.body.extract[AliasJSON] theAliasAfterTheDelete.alias must not equal (null) @@ -2267,9 +2267,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postAPrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user1) When("the delete request is sent") val deleteReply = deleteThePrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the Private alias must not be null") + And("the Private alias should not be null") val getReply = getThePrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterTheDelete : AliasJSON = getReply.body.extract[AliasJSON] theAliasAfterTheDelete.alias must not equal (null) @@ -2282,7 +2282,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomAlias = randomString(5) When("the delete request is sent") val deleteReply = deleteThePrivateAliasForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } } @@ -2297,10 +2297,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent") val randomInfo = randomString(20) val postReply = postMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomInfo, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[SuccessMessage] - And("the information must be changed") + And("the information should bechanged") val moreInfo = getMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomInfo must equal (moreInfo) } @@ -2314,11 +2314,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomInfo = randomString(20) When("the request is sent") val postReply = postMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomInfo, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the information must not be changed") + And("the information should not be changed") val moreInfo = getMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomInfo must not equal (moreInfo) } @@ -2332,11 +2332,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomInfo = randomString(20) When("the request is sent") val postReply = postMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomInfo, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the information must not be changed") + And("the information should not be changed") val moreInfo = getMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomInfo must not equal (moreInfo) } @@ -2350,11 +2350,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomInfo = randomString(20) When("the request is sent") val postReply = postMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, randomString(5), otherBankAccount.id, randomInfo, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the information must not be changed") + And("the information should not be changed") val moreInfo = getMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomInfo must not equal (moreInfo) } @@ -2367,9 +2367,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomInfo = randomString(20) When("the request is sent") val postReply = postMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), randomInfo, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -2384,10 +2384,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent") val randomInfo = randomString(20) val putReply = updateMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomInfo, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") putReply.code must equal (200) putReply.body.extract[SuccessMessage] - And("the information must be changed") + And("the information should bechanged") val moreInfo = getMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomInfo must equal (moreInfo) } @@ -2401,11 +2401,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomInfo = randomString(20) When("the request is sent") val putReply = updateMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomInfo, None) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the information must not be changed") + And("the information should not be changed") val moreInfo = getMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomInfo must not equal (moreInfo) } @@ -2419,9 +2419,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomInfo = randomString(20) When("the request is sent") val putReply = updateMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomInfo, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -2433,9 +2433,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomInfo = randomString(20) When("the request is sent") val putReply = updateMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), randomInfo, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -2451,9 +2451,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomInfo, user1) When("the delete request is sent") val deleteReply = deleteMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) - And("the info must be null") + And("the info should be null") val infoAfterDelete = getMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) infoAfterDelete must equal (null) } @@ -2468,9 +2468,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomInfo, user1) When("the delete request is sent") val deleteReply = deleteMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the info must not be null") + And("the info should not be null") val infoAfterDelete = getMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) infoAfterDelete must not equal (null) } @@ -2485,9 +2485,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomInfo, user1) When("the delete request is sent") val deleteReply = deleteMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the info must not be null") + And("the info should not be null") val infoAfterDelete = getMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) infoAfterDelete must not equal (null) } @@ -2500,7 +2500,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomInfo = randomString(20) When("the delete request is sent") val deleteReply = deleteMoreInfoForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } } @@ -2515,10 +2515,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent") val randomURL = randomString(20) val postReply = postUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[SuccessMessage] - And("the url must be changed") + And("the url should bechanged") val url = getUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must equal (url) } @@ -2532,11 +2532,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomURL = randomString(20) When("the request is sent") val postReply = postUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the url must not be changed") + And("the url should not be changed") val url = getUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must not equal (url) } @@ -2550,11 +2550,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomURL = randomString(20) When("the request is sent") val postReply = postUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the url must not be changed") + And("the url should not be changed") val url = getUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must not equal (url) } @@ -2568,11 +2568,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomURL = randomString(20) When("the request is sent") val postReply = postUrlForOneOtherBankAccount(bankId, bankAccount.id, randomString(5), otherBankAccount.id, randomURL, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the url must not be changed") + And("the url should not be changed") val url = getUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must not equal (url) } @@ -2585,9 +2585,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomURL = randomString(20) When("the request is sent") val postReply = postUrlForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), randomURL, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -2602,10 +2602,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent") val randomURL = randomString(20) val putReply = updateUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") putReply.code must equal (200) putReply.body.extract[SuccessMessage] - And("the url must be changed") + And("the url should bechanged") val url = getUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must equal (url) } @@ -2619,11 +2619,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomURL = randomString(20) When("the request is sent") val putReply = updateUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, None) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the url must not be changed") + And("the url should not be changed") val url = getUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must not equal (url) } @@ -2637,9 +2637,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomURL = randomString(20) When("the request is sent") val putReply = updateUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -2651,9 +2651,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomURL = randomString(20) When("the request is sent") val putReply = updateUrlForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), randomURL, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -2669,9 +2669,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user1) When("the delete request is sent") val deleteReply = deleteUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) - And("the url must be null") + And("the url should benull") val urlAfterDelete = getUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) urlAfterDelete must equal (null) } @@ -2686,9 +2686,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user1) When("the delete request is sent") val deleteReply = deleteUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the url must not be null") + And("the url should not be null") val urlAfterDelete = getUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) urlAfterDelete must not equal (null) } @@ -2703,9 +2703,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user1) When("the delete request is sent") val deleteReply = deleteUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the url must not be null") + And("the url should not be null") val urlAfterDelete = getUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) urlAfterDelete must not equal (null) } @@ -2718,7 +2718,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomURL = randomString(20) When("the delete request is sent") val deleteReply = deleteUrlForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } } @@ -2733,10 +2733,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent") val randomImageURL = randomString(20) val postReply = postImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomImageURL, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[SuccessMessage] - And("the image url must be changed") + And("the image url should bechanged") val url = getImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomImageURL must equal (url) } @@ -2750,11 +2750,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomImageURL = randomString(20) When("the request is sent") val postReply = postImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomImageURL, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the image url must not be changed") + And("the image url should not be changed") val url = getImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomImageURL must not equal (url) } @@ -2768,11 +2768,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomImageURL = randomString(20) When("the request is sent") val postReply = postImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomImageURL, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the image url must not be changed") + And("the image url should not be changed") val url = getImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomImageURL must not equal (url) } @@ -2786,11 +2786,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomImageURL = randomString(20) When("the request is sent") val postReply = postImageUrlForOneOtherBankAccount(bankId, bankAccount.id, randomString(5), otherBankAccount.id, randomImageURL, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the image url must not be changed") + And("the image url should not be changed") val url = getImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomImageURL must not equal (url) } @@ -2803,9 +2803,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomImageURL = randomString(20) When("the request is sent") val postReply = postImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), randomImageURL, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -2820,10 +2820,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent") val randomImageURL = randomString(20) val putReply = updateImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomImageURL, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") putReply.code must equal (200) putReply.body.extract[SuccessMessage] - And("the image url must be changed") + And("the image url should bechanged") val url = getImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomImageURL must equal (url) } @@ -2837,11 +2837,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomImageURL = randomString(20) When("the request is sent") val putReply = updateImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomImageURL, None) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the image url must not be changed") + And("the image url should not be changed") val url = getImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomImageURL must not equal (url) } @@ -2855,9 +2855,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomImageURL = randomString(20) When("the request is sent") val putReply = updateImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomImageURL, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -2869,9 +2869,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomImageURL = randomString(20) When("the request is sent") val putReply = updateImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), randomImageURL, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -2887,9 +2887,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomImageURL, user1) When("the delete request is sent") val deleteReply = deleteImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) - And("the image url must be null") + And("the image url should benull") val urlAfterDelete = getImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) urlAfterDelete must equal (null) } @@ -2904,9 +2904,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomImageURL, user1) When("the delete request is sent") val deleteReply = deleteImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the image url must not be null") + And("the image url should not be null") val urlAfterDelete = getImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) urlAfterDelete must not equal (null) } @@ -2921,9 +2921,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomImageURL, user1) When("the delete request is sent") val deleteReply = deleteImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the image url must not be null") + And("the image url should not be null") val urlAfterDelete = getImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) urlAfterDelete must not equal (null) } @@ -2936,7 +2936,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomImageURL = randomString(20) When("the delete request is sent") val deleteReply = deleteImageUrlForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } } @@ -2951,10 +2951,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent") val randomURL = randomString(20) val postReply = postOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[SuccessMessage] - And("the open corporates url must be changed") + And("the open corporates url should bechanged") val url = getOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must equal (url) } @@ -2968,11 +2968,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomURL = randomString(20) When("the request is sent") val postReply = postOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the open corporates url must not be changed") + And("the open corporates url should not be changed") val url = getOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must not equal (url) } @@ -2986,11 +2986,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomURL = randomString(20) When("the request is sent") val postReply = postOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the open corporates url must not be changed") + And("the open corporates url should not be changed") val url = getOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must not equal (url) } @@ -3004,11 +3004,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomURL = randomString(20) When("the request is sent") val postReply = postOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, randomString(5), otherBankAccount.id, randomURL, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the open corporates url must not be changed") + And("the open corporates url should not be changed") val url = getOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must not equal (url) } @@ -3021,9 +3021,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomURL = randomString(20) When("the request is sent") val postReply = postOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), randomURL, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -3038,10 +3038,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent") val randomURL = randomString(20) val putReply = updateOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") putReply.code must equal (200) putReply.body.extract[SuccessMessage] - And("the open corporates url must be changed") + And("the open corporates url should bechanged") val url = getOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must equal (url) } @@ -3055,11 +3055,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomURL = randomString(20) When("the request is sent") val putReply = updateOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, None) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the open corporates url must not be changed") + And("the open corporates url should not be changed") val url = getOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must not equal (url) } @@ -3073,9 +3073,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomURL = randomString(20) When("the request is sent") val putReply = updateOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3087,9 +3087,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomURL = randomString(20) When("the request is sent") val putReply = updateOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), randomURL, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -3105,9 +3105,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user1) When("the delete request is sent") val deleteReply = deleteOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) - And("the open corporates url must be null") + And("the open corporates url should benull") val urlAfterDelete = getOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) urlAfterDelete must equal (null) } @@ -3122,9 +3122,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user1) When("the delete request is sent") val deleteReply = deleteOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the open corporates url must not be null") + And("the open corporates url should not be null") val urlAfterDelete = getOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) urlAfterDelete must not equal (null) } @@ -3139,9 +3139,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user1) When("the delete request is sent") val deleteReply = deleteOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the open corporates url must not be null") + And("the open corporates url should not be null") val urlAfterDelete = getOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) urlAfterDelete must not equal (null) } @@ -3154,7 +3154,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomURL = randomString(20) When("the delete request is sent") val deleteReply = deleteOpenCorporatesUrlForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } } @@ -3169,10 +3169,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the request is sent") val postReply = postCorporateLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[SuccessMessage] - And("the corporate location must be changed") + And("the corporate location should bechanged") val location = getCorporateLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomLoc.latitude must equal (location.latitude) randomLoc.longitude must equal (location.longitude) @@ -3187,9 +3187,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the request is sent") val postReply = postCorporateLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3202,9 +3202,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { var randomLoc = JSONFactory.createLocationPlainJSON(400,200) When("the request is sent") val postReply = postCorporateLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3217,9 +3217,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the request is sent") val postReply = postCorporateLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3232,9 +3232,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the request is sent") val postReply = postCorporateLocationForOneOtherBankAccount(bankId, bankAccount.id, randomString(5), otherBankAccount.id, randomLoc, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3246,9 +3246,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the request is sent") val postReply = postCorporateLocationForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -3263,10 +3263,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent") val randomLoc = randomLocation val putReply = updateCorporateLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") putReply.code must equal (200) putReply.body.extract[SuccessMessage] - And("the corporate location must be changed") + And("the corporate location should bechanged") val location = getCorporateLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomLoc.latitude must equal (location.latitude) randomLoc.longitude must equal (location.longitude) @@ -3281,9 +3281,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { var randomLoc = JSONFactory.createLocationPlainJSON(400,200) When("the request is sent") val putReply = updateCorporateLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3296,9 +3296,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the request is sent") val putReply = updateCorporateLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, None) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3311,9 +3311,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the request is sent") val putReply = updateCorporateLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3325,9 +3325,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the request is sent") val putReply = updateCorporateLocationForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -3343,9 +3343,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postCorporateLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) When("the delete request is sent") val deleteReply = deleteCorporateLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) - And("the corporate location must be null") + And("the corporate location should benull") val locationAfterDelete = getCorporateLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) locationAfterDelete must equal (null) } @@ -3360,9 +3360,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postCorporateLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) When("the delete request is sent") val deleteReply = deleteCorporateLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the corporate location must not be null") + And("the corporate location should not be null") val locationAfterDelete = getCorporateLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) locationAfterDelete must not equal (null) } @@ -3377,9 +3377,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postCorporateLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) When("the delete request is sent") val deleteReply = deleteCorporateLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the corporate location must not be null") + And("the corporate location should not be null") val locationAfterDelete = getCorporateLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) locationAfterDelete must not equal (null) } @@ -3392,7 +3392,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the delete request is sent") val deleteReply = deleteCorporateLocationForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } } @@ -3407,10 +3407,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the request is sent") val postReply = postPhysicalLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[SuccessMessage] - And("the physical location must be changed") + And("the physical location should bechanged") val location = getPhysicalLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomLoc.latitude must equal (location.latitude) randomLoc.longitude must equal (location.longitude) @@ -3425,9 +3425,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { var randomLoc = JSONFactory.createLocationPlainJSON(400,200) When("the request is sent") val postReply = postPhysicalLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3440,9 +3440,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the request is sent") val postReply = postPhysicalLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3455,9 +3455,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the request is sent") val postReply = postPhysicalLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3470,9 +3470,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the request is sent") val postReply = postPhysicalLocationForOneOtherBankAccount(bankId, bankAccount.id, randomString(5), otherBankAccount.id, randomLoc, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3484,9 +3484,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the request is sent") val postReply = postPhysicalLocationForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -3501,10 +3501,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent") val randomLoc = randomLocation val putReply = updatePhysicalLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") putReply.code must equal (200) putReply.body.extract[SuccessMessage] - And("the physical location must be changed") + And("the physical location should bechanged") val location = getPhysicalLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomLoc.latitude must equal (location.latitude) randomLoc.longitude must equal (location.longitude) @@ -3519,9 +3519,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { var randomLoc = JSONFactory.createLocationPlainJSON(400,200) When("the request is sent") val putReply = updatePhysicalLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3534,9 +3534,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the request is sent") val putReply = updatePhysicalLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, None) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3549,9 +3549,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the request is sent") val putReply = updatePhysicalLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3563,9 +3563,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the request is sent") val putReply = updatePhysicalLocationForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -3581,9 +3581,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postPhysicalLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) When("the delete request is sent") val deleteReply = deletePhysicalLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) - And("the physical location must be null") + And("the physical location should benull") val locationAfterDelete = getPhysicalLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) locationAfterDelete must equal (null) } @@ -3598,9 +3598,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postPhysicalLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) When("the delete request is sent") val deleteReply = deletePhysicalLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the physical location must not be null") + And("the physical location should not be null") val locationAfterDelete = getPhysicalLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) locationAfterDelete must not equal (null) } @@ -3615,9 +3615,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postPhysicalLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) When("the delete request is sent") val deleteReply = deletePhysicalLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the physical location must not be null") + And("the physical location should not be null") val locationAfterDelete = getPhysicalLocationForOneOtherBankAccount(bankId, bankAccount.id, view, otherBankAccount.id, user1) locationAfterDelete must not equal (null) } @@ -3630,7 +3630,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the delete request is sent") val deleteReply = deletePhysicalLocationForOneOtherBankAccount(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } } @@ -3643,10 +3643,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = getTransactions(bankId,bankAccount.id,view, user1) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val transactions = reply.body.extract[TransactionsJSON] - And("transactions array must not be empty") + And("transactions array should not be empty") transactions.transactions.size must not equal (0) } @@ -3656,7 +3656,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent") val bankId = randomBank val reply = getTransactions(bankId,randomString(5),randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } @@ -3666,7 +3666,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val bankId = randomBank val bankAccount : AccountJSON = randomPrivateAccount(bankId) val reply = getTransactions(bankId,bankAccount.id,randomString(5), user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) } } @@ -3684,7 +3684,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent with a wrong value for param obp_sort_direction") val params = ("obp_sort_direction", "foo") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } scenario("we get all the transactions sorted by ASC", API1_2, GetTransactions, GetTransactionsWithParams) { @@ -3695,10 +3695,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent with the value ASC for param obp_sort_by") val params = ("obp_sort_direction", "ASC") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val transactions = reply.body.extract[TransactionsJSON] - And("transactions array must not be empty") + And("transactions array should not be empty") transactions.transactions.size must not equal (0) val transaction1 = transactions.transactions(0) val transaction2 = transactions.transactions(1) @@ -3712,10 +3712,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent with the value asc for param obp_sort_by") val params = ("obp_sort_direction", "asc") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val transactions = reply.body.extract[TransactionsJSON] - And("transactions array must not be empty") + And("transactions array should not be empty") transactions.transactions.size must not equal (0) val transaction1 = transactions.transactions(0) val transaction2 = transactions.transactions(1) @@ -3729,10 +3729,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent with the value DESC for param obp_sort_by") val params = ("obp_sort_direction", "DESC") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val transactions = reply.body.extract[TransactionsJSON] - And("transactions array must not be empty") + And("transactions array should not be empty") transactions.transactions.size must not equal (0) val transaction1 = transactions.transactions(0) val transaction2 = transactions.transactions(1) @@ -3746,10 +3746,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent with the value desc for param obp_sort_by") val params = ("obp_sort_direction", "desc") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val transactions = reply.body.extract[TransactionsJSON] - And("transactions array must not be empty") + And("transactions array should not be empty") transactions.transactions.size must not equal (0) val transaction1 = transactions.transactions(0) val transaction2 = transactions.transactions(1) @@ -3764,7 +3764,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent with a wrong value for param obp_limit") val params = ("obp_limit", "foo") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } scenario("we don't get transactions due to wrong value (0) for obp_limit parameter", API1_2, GetTransactions, GetTransactionsWithParams) { @@ -3775,7 +3775,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent with a wrong value for param obp_limit") val params = ("obp_limit", "0") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } scenario("we don't get transactions due to wrong value (-100) for obp_limit parameter", API1_2, GetTransactions, GetTransactionsWithParams) { @@ -3786,7 +3786,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent with a wrong value for param obp_limit") val params = ("obp_limit", "-100") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } scenario("we get only 5 transactions due to the obp_limit parameter value", API1_2, GetTransactions, GetTransactionsWithParams) { @@ -3797,10 +3797,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent with the value ASC for parameter obp_limit") val params = ("obp_limit", "5") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val transactions = reply.body.extract[TransactionsJSON] - And("transactions size must be equal to 5") + And("transactions size should be equal to 5") transactions.transactions.size must equal (5) } scenario("we don't get transactions due to wrong value for obp_from_date parameter", API1_2, GetTransactions, GetTransactionsWithParams) { @@ -3811,7 +3811,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent with a wrong value for param obp_from_date") val params = ("obp_from_date", "foo") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } scenario("we get transactions from a previous date with the right format", API1_2, GetTransactions, GetTransactionsWithParams) { @@ -3828,9 +3828,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val formatedPastDate = defaultFormat.format(pastDate) val params = ("obp_from_date", formatedPastDate) :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) - And("transactions size must not be empty") + And("transactions size should not be empty") val transactions = reply.body.extract[TransactionsJSON] transactions.transactions.size must not equal (0) } @@ -3848,9 +3848,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val formatedPastDate = rollbackFormat.format(pastDate) val params = ("obp_from_date", formatedPastDate) :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) - And("transactions size must not be empty") + And("transactions size should not be empty") val transactions = reply.body.extract[TransactionsJSON] transactions.transactions.size must not equal (0) } @@ -3868,9 +3868,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val formatedFutureDate = defaultFormat.format(futureDate) val params = ("obp_from_date", formatedFutureDate) :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) - And("transactions size must not be empty") + And("transactions size should not be empty") val transactions = reply.body.extract[TransactionsJSON] transactions.transactions.size must equal (0) } @@ -3882,7 +3882,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent with a wrong value for param obp_to_date") val params = ("obp_to_date", "foo") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } scenario("we get transactions from a previous (obp_to_date) date with the right format", API1_2, GetTransactions, GetTransactionsWithParams) { @@ -3895,9 +3895,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val formatedCurrentDate = defaultFormat.format(currentDate) val params = ("obp_to_date", formatedCurrentDate) :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) - And("transactions size must not be empty") + And("transactions size should not be empty") val transactions = reply.body.extract[TransactionsJSON] transactions.transactions.size must not equal (0) } @@ -3911,9 +3911,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val formatedCurrentDate = defaultFormat.format(currentDate) val params = ("obp_to_date", formatedCurrentDate) :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) - And("transactions size must not be empty") + And("transactions size should not be empty") val transactions = reply.body.extract[TransactionsJSON] transactions.transactions.size must not equal (0) } @@ -3931,9 +3931,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val formatedPastDate = defaultFormat.format(pastDate) val params = ("obp_to_date", formatedPastDate) :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) - And("transactions size must be empty") + And("transactions size should be empty") val transactions = reply.body.extract[TransactionsJSON] transactions.transactions.size must equal (0) } @@ -3945,7 +3945,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent with a wrong value for param obp_offset") val params = ("obp_offset", "foo") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } scenario("we don't get transactions due to the (2000) for obp_offset parameter", API1_2, GetTransactions, GetTransactionsWithParams) { @@ -3956,9 +3956,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent with a wrong value for param obp_offset") val params = ("obp_offset", "2000") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) - And("transactions size must be empty") + And("transactions size should be empty") val transactions = reply.body.extract[TransactionsJSON] transactions.transactions.size must equal (0) } @@ -3970,7 +3970,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent with a wrong value for param obp_offset") val params = ("obp_offset", "-100") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } scenario("we get only 5 transactions due to the obp_offset parameter value", API1_2, GetTransactions, GetTransactionsWithParams) { @@ -3981,10 +3981,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent with the value ASC for parameter obp_offset") val params = ("obp_offset", "5") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val transactions = reply.body.extract[TransactionsJSON] - And("transactions size must be equal to 5") + And("transactions size should be equal to 5") transactions.transactions.size must equal (5) } } @@ -3998,7 +3998,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTransaction(bankId, bankAccount.id, view, transaction.id, user1) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) reply.body.extract[TransactionJSON] } @@ -4011,7 +4011,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTransaction(bankId, bankAccount.id, view, transaction.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } @@ -4023,7 +4023,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTransaction(bankId, bankAccount.id, view, transaction.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } @@ -4035,7 +4035,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTransaction(bankId, randomString(5), view, transaction.id, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } @@ -4047,7 +4047,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTransaction(bankId, bankAccount.id, randomString(5), transaction.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) } @@ -4058,7 +4058,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = getTransaction(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } @@ -4073,7 +4073,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) reply.body.extract[TransactionNarrativeJSON] } @@ -4086,9 +4086,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -4100,9 +4100,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -4114,9 +4114,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getNarrativeForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -4127,9 +4127,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -4144,10 +4144,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent") val randomNarrative = randomString(20) val postReply = postNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomNarrative, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[SuccessMessage] - And("the narrative must be added") + And("the narrative should be added") val getReply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val theNarrativeAfterThePost : TransactionNarrativeJSON = getReply.body.extract[TransactionNarrativeJSON] randomNarrative must equal (theNarrativeAfterThePost.narrative) @@ -4162,9 +4162,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomNarrative = randomString(20) When("the request is sent") val postReply = postNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomNarrative, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) And("the narrative must not be added") val getReply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) @@ -4181,9 +4181,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomNarrative = randomString(20) When("the request is sent") val postReply = postNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomNarrative, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) And("the narrative must not be added") val getReply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) @@ -4200,9 +4200,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomNarrative = randomString(20) When("the request is sent") val postReply = postNarrativeForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, randomNarrative, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) And("the narrative must not be added") val getReply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) @@ -4218,9 +4218,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomNarrative = randomString(20) When("the request is sent") val postReply = postNarrativeForOneTransaction(bankId, bankAccount.id, view, randomString(5), randomNarrative, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -4235,10 +4235,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent") val randomNarrative = randomString(20) val putReply = updateNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomNarrative, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") putReply.code must equal (200) putReply.body.extract[SuccessMessage] - And("the narrative must be changed") + And("the narrative should be changed") val getReply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val narrativeAfterThePost : TransactionNarrativeJSON = getReply.body.extract[TransactionNarrativeJSON] randomNarrative must equal (narrativeAfterThePost.narrative) @@ -4253,11 +4253,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomNarrative = randomString(20) When("the request is sent") val putReply = updateNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomNarrative, None) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the narrative must not be changed") + And("the narrative should not be changed") val getReply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val narrativeAfterThePost : TransactionNarrativeJSON = getReply.body.extract[TransactionNarrativeJSON] randomNarrative must not equal (narrativeAfterThePost.narrative) @@ -4272,11 +4272,11 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomNarrative = randomString(20) When("the request is sent") val putReply = updateNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomNarrative, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the narrative must not be changed") + And("the narrative should not be changed") val getReply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val narrativeAfterThePost : TransactionNarrativeJSON = getReply.body.extract[TransactionNarrativeJSON] randomNarrative must not equal (narrativeAfterThePost.narrative) @@ -4291,9 +4291,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomNarrative = randomString(20) When("the request is sent") val putReply = updateNarrativeForOneTransaction(bankId, bankAccount.id, view, transactionId, randomNarrative, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -4309,9 +4309,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomNarrative, user1) When("the delete request is sent") val deleteReply = deleteNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) - And("the narrative must be null") + And("the narrative should be null") val getReply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val narrativeAfterTheDelete : TransactionNarrativeJSON = getReply.body.extract[TransactionNarrativeJSON] narrativeAfterTheDelete.narrative must equal (null) @@ -4327,9 +4327,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomNarrative, user1) When("the delete request is sent") val deleteReply = deleteNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the public narrative must not be null") + And("the public narrative should not be null") val getReply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val narrativeAfterTheDelete : TransactionNarrativeJSON = getReply.body.extract[TransactionNarrativeJSON] narrativeAfterTheDelete.narrative must not equal (null) @@ -4345,9 +4345,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomNarrative, user1) When("the delete request is sent") val deleteReply = deleteNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the narrative must not be null") + And("the narrative should not be null") val getReply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val narrativeAfterTheDelete : TransactionNarrativeJSON = getReply.body.extract[TransactionNarrativeJSON] narrativeAfterTheDelete.narrative must not equal (null) @@ -4361,7 +4361,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomNarrative = randomString(20) When("the delete request is sent") val deleteReply = deleteNarrativeForOneTransaction(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } } @@ -4375,7 +4375,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getCommentsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) reply.body.extract[TransactionCommentsJSON] } @@ -4388,9 +4388,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getCommentsForOneTransaction(bankId, bankAccount.id, view, transaction.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -4402,9 +4402,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getCommentsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -4416,9 +4416,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getCommentsForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -4429,9 +4429,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = getCommentsForOneTransaction(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -4446,10 +4446,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent") val randomComment = PostTransactionCommentJSON(randomString(20)) val postReply = postCommentForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomComment, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[TransactionCommentJSON] - And("the comment must be added") + And("the comment should be added") val getReply = getCommentsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val theCommentsAfterThePost = getReply.body.extract[TransactionCommentsJSON].comments val theComment = theCommentsAfterThePost.find(_.value == randomComment.value) @@ -4467,9 +4467,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomComment = PostTransactionCommentJSON(randomString(20)) When("the request is sent") val postReply = postCommentForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomComment, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) And("the comment must not be added") val getReply = getCommentsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) @@ -4491,9 +4491,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomComment = PostTransactionCommentJSON(randomString(20)) When("the request is sent") val postReply = postCommentForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomComment, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) And("the comment must not be added") val getReply = getCommentsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) @@ -4514,9 +4514,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomComment = PostTransactionCommentJSON(randomString(20)) When("the request is sent") val postReply = postCommentForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, randomComment, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) And("the comment must not be added") val getReply = getCommentsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) @@ -4536,9 +4536,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomComment = PostTransactionCommentJSON(randomString(20)) When("the request is sent") val postReply = postCommentForOneTransaction(bankId, bankAccount.id, view, randomString(5), randomComment, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -4555,7 +4555,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val postedComment = postedReply.body.extract[TransactionCommentJSON] When("the delete request is sent") val deleteReply = deleteCommentForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedComment.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) } @@ -4570,7 +4570,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val postedComment = postedReply.body.extract[TransactionCommentJSON] When("the delete request is sent") val deleteReply = deleteCommentForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedComment.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -4585,7 +4585,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val postedComment = postedReply.body.extract[TransactionCommentJSON] When("the delete request is sent") val deleteReply = deleteCommentForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedComment.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -4600,7 +4600,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val postedComment = postedReply.body.extract[TransactionCommentJSON] When("the delete request is sent") val deleteReply = deleteCommentForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedComment.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -4612,7 +4612,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the delete request is sent") val deleteReply = deleteCommentForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -4627,7 +4627,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val postedComment = postedReply.body.extract[TransactionCommentJSON] When("the delete request is sent") val deleteReply = deleteCommentForOneTransaction(bankId, bankAccount.id, view, randomString(5), postedComment.id, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -4642,7 +4642,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val postedComment = postedReply.body.extract[TransactionCommentJSON] When("the delete request is sent") val deleteReply = deleteCommentForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, postedComment.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") deleteReply.code must equal (404) } } @@ -4656,7 +4656,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTagsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) reply.body.extract[TransactionTagsJSON] } @@ -4669,9 +4669,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTagsForOneTransaction(bankId, bankAccount.id, view, transaction.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -4683,9 +4683,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTagsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -4697,9 +4697,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTagsForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -4710,9 +4710,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = getTagsForOneTransaction(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -4727,10 +4727,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent") val randomTag = PostTransactionTagJSON(randomString(5)) val postReply = postTagForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomTag, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[TransactionTagJSON] - And("the tag must be added") + And("the tag should be added") val getReply = getTagsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val theTagsAfterThePost = getReply.body.extract[TransactionTagsJSON].tags val theTag = theTagsAfterThePost.find(_.value == randomTag.value) @@ -4747,9 +4747,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomTag = PostTransactionTagJSON(randomString(5)) When("the request is sent") val postReply = postTagForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomTag, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) And("the tag must not be added") val getReply = getTagsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) @@ -4770,9 +4770,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomTag = PostTransactionTagJSON(randomString(5)) When("the request is sent") val postReply = postTagForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomTag, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) And("the tag must not be added") val getReply = getTagsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) @@ -4793,9 +4793,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomTag = PostTransactionTagJSON(randomString(5)) When("the request is sent") val postReply = postTagForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, randomTag, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) And("the tag must not be added") val getReply = getTagsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) @@ -4815,9 +4815,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomTag = PostTransactionTagJSON(randomString(5)) When("the request is sent") val postReply = postTagForOneTransaction(bankId, bankAccount.id, view, randomString(5), randomTag, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -4834,7 +4834,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val postedTag = postedReply.body.extract[TransactionTagJSON] When("the delete request is sent") val deleteReply = deleteTagForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedTag.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) } @@ -4849,7 +4849,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val postedTag = postedReply.body.extract[TransactionTagJSON] When("the delete request is sent") val deleteReply = deleteTagForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedTag.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -4864,7 +4864,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val postedTag = postedReply.body.extract[TransactionTagJSON] When("the delete request is sent") val deleteReply = deleteTagForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedTag.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -4879,7 +4879,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val postedTag = postedReply.body.extract[TransactionTagJSON] When("the delete request is sent") val deleteReply = deleteTagForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedTag.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -4891,7 +4891,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the delete request is sent") val deleteReply = deleteTagForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -4906,7 +4906,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val postedTag = postedReply.body.extract[TransactionTagJSON] When("the delete request is sent") val deleteReply = deleteTagForOneTransaction(bankId, bankAccount.id, view, randomString(5), postedTag.id, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -4921,7 +4921,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val postedTag = postedReply.body.extract[TransactionTagJSON] When("the delete request is sent") val deleteReply = deleteTagForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, postedTag.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") deleteReply.code must equal (404) } } @@ -4935,7 +4935,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getImagesForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) reply.body.extract[TransactionImagesJSON] } @@ -4948,9 +4948,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getImagesForOneTransaction(bankId, bankAccount.id, view, transaction.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -4962,9 +4962,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getImagesForOneTransaction(bankId, bankAccount.id, view, transaction.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -4976,9 +4976,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getImagesForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -4989,9 +4989,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = getImagesForOneTransaction(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -5006,10 +5006,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent") val randomImage = PostTransactionImageJSON(randomString(5),"http://www.mysuperimage.com") val postReply = postImageForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomImage, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[TransactionImageJSON] - And("the image must be added") + And("the image should be added") val getReply = getImagesForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val theImagesAfterThePost = getReply.body.extract[TransactionImagesJSON].images val theImage = theImagesAfterThePost.find(_.URL == randomImage.URL) @@ -5026,9 +5026,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomImage = PostTransactionImageJSON(randomString(5),"http://www.mysuperimage.com/"+randomString(5)) When("the request is sent") val postReply = postImageForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomImage, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) And("the image must not be added") val getReply = getImagesForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) @@ -5049,9 +5049,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomImage = PostTransactionImageJSON(randomString(5),"http://www.mysuperimage.com") When("the request is sent") val postReply = postImageForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomImage, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) And("the image must not be added") val getReply = getImagesForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) @@ -5072,9 +5072,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomImage = PostTransactionImageJSON(randomString(5),"http://www.mysuperimage.com/"+randomString(5)) When("the request is sent") val postReply = postImageForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, randomImage, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) And("the image must not be added") val getReply = getImagesForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) @@ -5094,9 +5094,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomImage = PostTransactionImageJSON(randomString(5),"http://www.mysuperimage.com") When("the request is sent") val postReply = postImageForOneTransaction(bankId, bankAccount.id, view, randomString(5), randomImage, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -5113,7 +5113,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val postedImage = postedReply.body.extract[TransactionImageJSON] When("the delete request is sent") val deleteReply = deleteImageForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedImage.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) } @@ -5128,7 +5128,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val postedImage = postedReply.body.extract[TransactionImageJSON] When("the delete request is sent") val deleteReply = deleteImageForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedImage.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -5143,7 +5143,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val postedImage = postedReply.body.extract[TransactionImageJSON] When("the delete request is sent") val deleteReply = deleteImageForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedImage.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -5158,7 +5158,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val postedImage = postedReply.body.extract[TransactionImageJSON] When("the delete request is sent") val deleteReply = deleteImageForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedImage.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -5170,7 +5170,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the delete request is sent") val deleteReply = deleteImageForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -5185,7 +5185,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val postedImage = postedReply.body.extract[TransactionImageJSON] When("the delete request is sent") val deleteReply = deleteImageForOneTransaction(bankId, bankAccount.id, view, randomString(5), postedImage.id, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -5200,7 +5200,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val postedImage = postedReply.body.extract[TransactionImageJSON] When("the delete request is sent") val deleteReply = deleteImageForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, postedImage.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") deleteReply.code must equal (404) } } @@ -5216,7 +5216,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) When("the request is sent") val reply = getWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) } @@ -5230,9 +5230,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) When("the request is sent") val reply = getWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5246,9 +5246,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) When("the request is sent") val reply = getWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5262,9 +5262,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) When("the request is sent") val reply = getWhereForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5275,9 +5275,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = getWhereForOneTransaction(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -5292,10 +5292,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the request is sent") val postReply = postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[SuccessMessage] - And("the where must be posted") + And("the where should be posted") val location = getWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1).body.extract[TransactionWhereJSON] randomLoc.latitude must equal (location.where.latitude) randomLoc.longitude must equal (location.where.longitude) @@ -5311,9 +5311,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { var randomLoc = JSONFactory.createLocationPlainJSON(400,200) When("the request is sent") val postReply = postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5326,9 +5326,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the request is sent") val postReply = postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5341,9 +5341,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the request is sent") val postReply = postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5356,9 +5356,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the request is sent") val postReply = postWhereForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, randomLoc, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5370,9 +5370,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the request is sent") val postReply = postWhereForOneTransaction(bankId, bankAccount.id, view, randomString(5), randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -5387,10 +5387,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { When("the request is sent") val randomLoc = randomLocation val putReply = updateWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") putReply.code must equal (200) putReply.body.extract[SuccessMessage] - And("the where must be changed") + And("the where should be changed") val location = getWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1).body.extract[TransactionWhereJSON] randomLoc.latitude must equal (location.where.latitude) randomLoc.longitude must equal (location.where.longitude) @@ -5405,9 +5405,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { var randomLoc = JSONFactory.createLocationPlainJSON(400,200) When("the request is sent") val putReply = updateWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5420,9 +5420,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { var randomLoc = randomLocation When("the request is sent") val putReply = updateWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, None) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5435,9 +5435,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the request is sent") val putReply = updateWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5449,9 +5449,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the request is sent") val putReply = updateWhereForOneTransaction(bankId, bankAccount.id, view, randomString(5), randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -5467,9 +5467,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) When("the delete request is sent") val deleteReply = deleteWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) - And("the where must be null") + And("the where should be null") val locationAfterDelete = getWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1).body.extract[TransactionWhereJSON] locationAfterDelete.where must equal (null) } @@ -5484,9 +5484,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) When("the delete request is sent") val deleteReply = deleteWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - // And("the where must not be null") + // And("the where should not be null") } scenario("we will not delete the where for a random transaction because the user does not have enough privileges", API1_2, DeleteWhere) { @@ -5499,9 +5499,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) When("the delete request is sent") val deleteReply = deleteWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - // And("the where must not be null") + // And("the where should not be null") } scenario("we will not delete the where for one random transaction because the user did not post the geo tag", API1_2, DeleteWhere) { @@ -5514,7 +5514,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) When("the delete request is sent") val deleteReply = deleteWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -5526,7 +5526,7 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val randomLoc = randomLocation When("the delete request is sent") val deleteReply = deleteWhereForOneTransaction(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } } @@ -5540,10 +5540,10 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTheOtherBankAccountOfOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) val accountJson = reply.body.extract[OtherAccountJSON] - And("some fields must not be empty") + And("some fields should not be empty") accountJson.id.nonEmpty must equal (true) } @@ -5555,9 +5555,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTheOtherBankAccountOfOneTransaction(bankId, bankAccount.id, view, transaction.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5569,9 +5569,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTheOtherBankAccountOfOneTransaction(bankId, bankAccount.id, view, transaction.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5583,9 +5583,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTheOtherBankAccountOfOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5596,9 +5596,9 @@ class API1_2Test extends User1AllPrivileges with DefaultUsers { val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = getTheOtherBankAccount(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } diff --git a/src/test/scala/code/api/v1_2_1/API121Test.scala b/src/test/scala/code/api/v1_2_1/API121Test.scala index 7eb2eee85..00f51534c 100644 --- a/src/test/scala/code/api/v1_2_1/API121Test.scala +++ b/src/test/scala/code/api/v1_2_1/API121Test.scala @@ -12,7 +12,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. -You must have received a copy of the GNU Affero General Public License +you should have received a copy of the GNU Affero General Public License along with this program. If not, see . Email: contact@tesobe.com @@ -41,6 +41,7 @@ import net.liftweb.json.JsonAST.JString import net.liftweb.json.JsonDSL._ import net.liftweb.json._ import net.liftweb.util.Helpers._ +import net.liftweb.common.{Box, Full} import _root_.net.liftweb.util.{Props, _} import code.setup.{APIResponse, DefaultUsers, PrivateUser2Accounts, User1AllPrivileges} import org.scalatest.Tag @@ -703,18 +704,18 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val reply = getTransaction( fromAccount.bankId.value, fromAccount.accountId.value, view, transId, user1) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal(200) val transJson = reply.body.extract[TransactionJSON] val fromAccountTransAmt = transJson.details.value.amount - //the from account transaction must have a negative value + //the from account transaction should have a negative value //since money left the account - And("the json we receive back must have a transaction amount equal to the amount specified to pay") + And("the json we receive back should have a transaction amount equal to the amount specified to pay") fromAccountTransAmt must equal((-amt).toString) val expectedNewFromBalance = beforeFromBalance - amt - And("the account sending the payment must have a new_balance amount equal to the previous balance minus the amount paid") + And("the account sending the payment should have a new_balance amount equal to the previous balance minus the amount paid") transJson.details.new_balance.amount must equal(expectedNewFromBalance.toString) getFromAccount.balance must equal(expectedNewFromBalance) val toAccountTransactionsReq = getTransactions(toAccount.bankId.value, toAccount.accountId.value, view, user1) @@ -722,16 +723,16 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val toAccountTransactions = toAccountTransactionsReq.body.extract[TransactionsJSON] val newestToAccountTransaction = toAccountTransactions.transactions(0) - //here amt must be positive (unlike in the transaction in the "from" account") - And("the newest transaction for the account receiving the payment must have the proper amount") + //here amt should be positive (unlike in the transaction in the "from" account") + And("the newest transaction for the account receiving the payment should have the proper amount") newestToAccountTransaction.details.value.amount must equal(amt.toString) - And("the account receiving the payment must have the proper balance") + And("the account receiving the payment should have the proper balance") val expectedNewToBalance = beforeToBalance + amt newestToAccountTransaction.details.new_balance.amount must equal(expectedNewToBalance.toString) getToAccount.balance must equal(expectedNewToBalance) - And("there must now be 2 new transactions in the database (one for the sender, one for the receiver") + And("there should now be 2 new transactions in the database (one for the sender, one for the receiver") transactionCount(fromAccount, toAccount) must equal(totalTransactionsBefore + 2) } } @@ -766,13 +767,13 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val payJson = MakePaymentJson(toAccount.bankId.value, toAccount.accountId.value, amt.toString) val postResult = postTransaction(fromAccount.bankId.value, fromAccount.accountId.value, view, payJson, user2) - Then("we must get a 400") + Then("We should get a 400") postResult.code must equal(400) - And("the number of transactions for each account must remain unchanged") + And("the number of transactions for each account should remain unchanged") totalTransactionsBefore must equal(transactionCount(fromAccount, toAccount)) - And("the balances of each account must remain unchanged") + And("the balances of each account should remain unchanged") beforeFromBalance must equal(getFromAccount.balance) beforeToBalance must equal(getToAccount.balance) } @@ -806,13 +807,13 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val payJson = MakePaymentJson(toAccount.bankId.value, toAccount.accountId.value, amt.toString) val postResult = postTransaction(fromAccount.bankId.value, fromAccount.accountId.value, view, payJson, None) - Then("we must get a 400") + Then("We should get a 400") postResult.code must equal(400) - And("the number of transactions for each account must remain unchanged") + And("the number of transactions for each account should remain unchanged") totalTransactionsBefore must equal(transactionCount(fromAccount, toAccount)) - And("the balances of each account must remain unchanged") + And("the balances of each account should remain unchanged") beforeFromBalance must equal(getFromAccount.balance) beforeToBalance must equal(getToAccount.balance) } @@ -848,13 +849,13 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val payJson = MakePaymentJson(toAccount.bankId.value, toAccount.accountId.value, amt.toString) val postResult = postTransaction(fromAccount.bankId.value, fromAccount.accountId.value, view, payJson, user1) - Then("we must get a 400") + Then("We should get a 400") postResult.code must equal(400) - And("the number of transactions for each account must remain unchanged") + And("the number of transactions for each account should remain unchanged") totalTransactionsBefore must equal(transactionCount(fromAccount, toAccount)) - And("the balances of each account must remain unchanged") + And("the balances of each account should remain unchanged") beforeFromBalance must equal(getFromAccount.balance) beforeToBalance must equal(getToAccount.balance) } @@ -891,13 +892,13 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val payJson = MakePaymentJson(toAccount.bankId.value, toAccount.accountId.value, amt.toString) val postResult = postTransaction(fromAccount.bankId.value, fromAccount.accountId.value, view, payJson, user1) - Then("we must get a 400") + Then("We should get a 400") postResult.code must equal(400) - And("the number of transactions for each account must remain unchanged") + And("the number of transactions for each account should remain unchanged") totalTransactionsBefore must equal(transactionCount(fromAccount, toAccount)) - And("the balances of each account must remain unchanged") + And("the balances of each account should remain unchanged") beforeFromBalance must equal(getFromAccount.balance) beforeToBalance must equal(getToAccount.balance) } @@ -926,13 +927,13 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val payJson = MakePaymentJson(bankId.value, "ACCOUNTTHATDOESNOTEXIST232321321", amt.toString) val postResult = postTransaction(fromAccount.bankId.value, fromAccount.accountId.value, view, payJson, user1) - Then("we must get a 400") + Then("We should get a 400") postResult.code must equal(400) - And("the number of transactions for the sender's account must remain unchanged") + And("the number of transactions for the sender's account should remain unchanged") totalTransactionsBefore must equal(transactionCount(fromAccount)) - And("the balance of the sender's account must remain unchanged") + And("the balance of the sender's account should remain unchanged") beforeFromBalance must equal(getFromAccount.balance) } @@ -966,13 +967,13 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val payJson = MakePaymentJson(toAccount.bankId.value, toAccount.accountId.value, amt.toString) val postResult = postTransaction(fromAccount.bankId.value, fromAccount.accountId.value, view, payJson, user1) - Then("we must get a 400") + Then("We should get a 400") postResult.code must equal(400) - And("the number of transactions for each account must remain unchanged") + And("the number of transactions for each account should remain unchanged") totalTransactionsBefore must equal(transactionCount(fromAccount, toAccount)) - And("the balances of each account must remain unchanged") + And("the balances of each account should remain unchanged") beforeFromBalance must equal(getFromAccount.balance) beforeToBalance must equal(getToAccount.balance) } @@ -991,7 +992,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser Given("We will not use an access token") When("the request is sent") val reply = getAPIInfo - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val apiInfo = reply.body.extract[APIInfoJSON] apiInfo.version must equal ("1.2.1") @@ -1004,7 +1005,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser Given("We will not use an access token") When("the request is sent") val reply = getBanksInfo - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val banksInfo = reply.body.extract[BanksJSON] banksInfo.banks.foreach(b => { @@ -1018,7 +1019,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser Given("We will not use an access token") When("the request is sent") val reply = getBankInfo(randomBank) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val bankInfo = reply.body.extract[BankJSON] bankInfo.id.nonEmpty must equal (true) @@ -1028,9 +1029,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser Given("We will not use an access token and request a random bankId") When("the request is sent") val reply = getBankInfo(randomString(5)) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -1086,10 +1087,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser Given("We will not use an access token") When("the request is sent") val reply = getBankAccountsForAllBanks(None) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val publicAccountsInfo = reply.body.extract[AccountsJSON] - And("some fields must not be empty") + And("some fields should not be empty") publicAccountsInfo.accounts.foreach(a => { a.id.nonEmpty must equal (true) a.views_available.nonEmpty must equal (true) @@ -1110,19 +1111,19 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser Given("We will use an access token") When("the request is sent") val reply = getBankAccountsForAllBanks(user1) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val accountsInfo = reply.body.extract[AccountsJSON] - And("some fields must not be empty") + And("some fields should not be empty") accountsInfo.accounts.foreach(a => { a.id.nonEmpty must equal (true) a.views_available.nonEmpty must equal (true) }) //test that this call is a combination of accounts with more than public access, and accounts with public access - And("Some accounts must have only public views") + And("Some accounts should have only public views") assertAtLeastOneAccountHasAllViewsWithCondition(accountsInfo, _.is_public) - And("Some accounts must have only private views") + And("Some accounts should have only private views") assertAtLeastOneAccountHasAllViewsWithCondition(accountsInfo, !_.is_public) And("There are accounts from more than one bank") @@ -1139,10 +1140,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser Given("We will not use an access token") When("the request is sent") val reply = getPublicAccountsForAllBanks() - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val publicAccountsInfo = reply.body.extract[AccountsJSON] - And("some fields must not be empty") + And("some fields should not be empty") publicAccountsInfo.accounts.foreach(a => { a.id.nonEmpty must equal (true) a.views_available.nonEmpty must equal (true) @@ -1166,16 +1167,16 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser Given("We will use an access token") When("the request is sent") val reply = getPrivateAccountsForAllBanks(user1) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) - And("some fields must not be empty") + And("some fields should not be empty") val privateAccountsInfo = reply.body.extract[AccountsJSON] privateAccountsInfo.accounts.foreach(a => { a.id.nonEmpty must equal (true) a.views_available.nonEmpty must equal (true) }) - And("All accounts must have at least one private view") + And("All accounts should have at least one private view") assertAllAccountsHaveAViewWithCondition(privateAccountsInfo, !_.is_public) And("There are accounts from more than one bank") @@ -1189,9 +1190,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser Given("We will not use an access token") When("the request is sent") val reply = getPrivateAccountsForAllBanks(None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -1202,10 +1203,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser Given("We will not use an access token") When("the request is sent") val reply = getBankAccounts(randomBank, None) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val publicAccountsInfo = reply.body.extract[AccountsJSON] - And("some fields must not be empty") + And("some fields should not be empty") publicAccountsInfo.accounts.foreach(a => { a.id.nonEmpty must equal (true) a.views_available.nonEmpty must equal (true) @@ -1226,20 +1227,20 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser Given("We will use an access token") When("the request is sent") val reply = getBankAccounts(randomBank, user1) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val accountsInfo = reply.body.extract[AccountsJSON] - And("some fields must not be empty") + And("some fields should not be empty") accountsInfo.accounts.foreach(a => { a.id.nonEmpty must equal (true) a.views_available.nonEmpty must equal (true) }) //test that this call is a combination of accounts with more than public access, and accounts with public access - And("Some accounts must have only public views") + And("Some accounts should have only public views") assertAtLeastOneAccountHasAllViewsWithCondition(accountsInfo, _.is_public) - And("Some accounts must have only private views") + And("Some accounts should have only private views") assertAtLeastOneAccountHasAllViewsWithCondition(accountsInfo, !_.is_public) And("The accounts are only from one bank") @@ -1256,10 +1257,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser Given("We will not use an access token") When("the request is sent") val reply = getPublicAccounts(randomBank) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val publicAccountsInfo = reply.body.extract[AccountsJSON] - And("some fields must not be empty") + And("some fields should not be empty") publicAccountsInfo.accounts.foreach(a => { a.id.nonEmpty must equal (true) a.views_available.nonEmpty must equal (true) @@ -1283,16 +1284,16 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser Given("We will use an access token") When("the request is sent") val reply = getPrivateAccounts(randomBank, user1) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) - And("some fields must not be empty") + And("some fields should not be empty") val privateAccountsInfo = reply.body.extract[AccountsJSON] privateAccountsInfo.accounts.foreach(a => { a.id.nonEmpty must equal (true) a.views_available.nonEmpty must equal (true) }) - And("All accounts must have at least one private view") + And("All accounts should have at least one private view") assertAllAccountsHaveAViewWithCondition(privateAccountsInfo, !_.is_public) And("The accounts are only from one bank") @@ -1306,9 +1307,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser Given("We will not use an access token") When("the request is sent") val reply = getPrivateAccounts(randomBank, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -1322,9 +1323,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val view = bankAccount.views_available.toList(randomPosition) When("the request is sent") val reply = getPublicBankAccountDetails(bankId, bankAccount.id, view.id) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) - And("some fields must not be empty") + And("some fields should not be empty") val publicAccountDetails = reply.body.extract[ModeratedAccountJSON] publicAccountDetails.id.nonEmpty must equal (true) publicAccountDetails.bank_id.nonEmpty must equal (true) @@ -1339,10 +1340,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val view = bankAccount.views_available.toList(randomPosition) When("the request is sent") val reply = getPrivateBankAccountDetails(bankId, bankAccount.id, view.id, user1) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val privateAccountDetails = reply.body.extract[ModeratedAccountJSON] - And("some fields must not be empty") + And("some fields should not be empty") privateAccountDetails.id.nonEmpty must equal (true) privateAccountDetails.bank_id.nonEmpty must equal (true) privateAccountDetails.views_available.nonEmpty must equal (true) @@ -1356,7 +1357,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getAccountViews(bankId, bankAccount.id, user1) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) reply.body.extract[ViewsJSONV121] } @@ -1367,9 +1368,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getAccountViews(bankId, bankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1379,9 +1380,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getAccountViews(bankId, bankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -1394,10 +1395,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val view = randomView(true, "") When("the request is sent") val reply = postView(bankId, bankAccount.id, view, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") reply.code must equal (201) reply.body.extract[ViewJSONV121] - And("we must get a new view") + And("We should get a new view") val viewsAfter = getAccountViews(bankId, bankAccount.id, user1).body.extract[ViewsJSONV121].views viewsBefore.size must equal (viewsAfter.size -1) } @@ -1409,9 +1410,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val view = randomView(true, "") When("the request is sent") val reply = postView(bankId, bankAccount.id, view, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1422,9 +1423,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val view = randomView(true, "") When("the request is sent") val reply = postView(bankId, bankAccount.id, view, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1434,9 +1435,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val view = randomView(true, "") When("the request is sent") val reply = postView(bankId, randomString(3), view, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1448,9 +1449,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postView(bankId, bankAccount.id, view, user1) When("the request is sent") val reply = postView(bankId, bankAccount.id, view, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1470,9 +1471,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val reply = postView(bankId, bankAccount.id, viewWithEmptyName, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -1522,7 +1523,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("We use a valid access token and valid put json") val reply = putView(bankId, bankAccount.id, createdView.id, viewUpdateJson(createdView), user1) - Then("We must get back the updated view") + Then("We should get back the updated view") reply.code must equal (200) val updatedView = reply.body.extract[ViewJSONV121] updatedView.can_see_images must equal(true) @@ -1547,7 +1548,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("we try to update that view") val reply = putView(bankId, bankAccount.id, nonExistantViewId, someViewUpdateJson(), user1) - Then("We must get a 404") + Then("We should get a 404") reply.code must equal(404) } @@ -1562,10 +1563,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("we don't use an access token") val reply = putView(bankId, bankAccount.id, createdView.id, viewUpdateJson(createdView), None) - Then("we must get a 400") + Then("We should get a 400") reply.code must equal(400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1580,10 +1581,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("we try to update a view without having sufficient privileges to do so") val reply = putView(bankId, bankAccount.id, createdView.id, viewUpdateJson(createdView), user3) - Then("we must get a 400") + Then("We should get a 400") reply.code must equal(400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -1597,9 +1598,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val viewsBefore = getAccountViews(bankId, bankAccount.id, user1).body.extract[ViewsJSONV121].views When("the request is sent") val reply = deleteView(bankId, bankAccount.id, view.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") reply.code must equal (204) - And("the views must be updated") + And("the views should beupdated") val viewsAfter = getAccountViews(bankId, bankAccount.id, user1).body.extract[ViewsJSONV121].views viewsBefore.size must equal (viewsAfter.size +1) } @@ -1620,7 +1621,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("We attempt to delete the view") val reply = deleteView(bankId, bankAccount.id, ownerView.get.id, user1) - Then("We must get a 400 code") + Then("We should get a 400 code") reply.code must equal(400) And("the owner view must still exist") @@ -1634,9 +1635,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = deleteView(bankId, bankAccount.id, view, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1647,9 +1648,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = deleteView(bankId, bankAccount.id, view, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1659,9 +1660,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = deleteView(bankId, bankAccount.id, randomString(3), user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -1673,7 +1674,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getAccountPermissions(bankId, bankAccount.id, user1) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val permissions = reply.body.extract[PermissionsJSON] @@ -1706,9 +1707,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getAccountPermissions(bankId, bankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1718,9 +1719,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getAccountPermissions(bankId, bankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -1734,10 +1735,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val userID = permission.user.id When("the request is sent") val reply = getUserAccountPermission(bankId, bankAccount.id, userID, user1) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val viewsInfo = reply.body.extract[ViewsJSONV121] - And("some fields must not be empty") + And("some fields should not be empty") viewsInfo.views.foreach(v => v.id.nonEmpty must equal (true)) } @@ -1749,9 +1750,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val userID = permission.user.id When("the request is sent") val reply = getUserAccountPermission(bankId, bankAccount.id, userID, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1761,9 +1762,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getUserAccountPermission(bankId, bankAccount.id, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -1777,10 +1778,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val viewsBefore = getUserAccountPermission(bankId, bankAccount.id, userId, user1).body.extract[ViewsJSONV121].views.length When("the request is sent") val reply = grantUserAccessToView(bankId, bankAccount.id, userId, randomViewPermalink(bankId, bankAccount), user1) - Then("we must get a 201 ok code") + Then("We should get a 201 ok code") reply.code must equal (201) val viewInfo = reply.body.extract[ViewJSONV121] - And("some fields must not be empty") + And("some fields should not be empty") viewInfo.id.nonEmpty must equal (true) val viewsAfter = getUserAccountPermission(bankId, bankAccount.id, userId, user1).body.extract[ViewsJSONV121].views.length viewsAfter must equal(viewsBefore + 1) @@ -1792,9 +1793,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = grantUserAccessToView(bankId, bankAccount.id, randomString(5), randomViewPermalink(bankId, bankAccount), user1) - Then("we must get a 400 ok code") + Then("We should get a 400 ok code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1806,9 +1807,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val viewsBefore = getUserAccountPermission(bankId, bankAccount.id, userId, user1).body.extract[ViewsJSONV121].views.length When("the request is sent") val reply = grantUserAccessToView(bankId, bankAccount.id, userId, randomString(5), user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) val viewsAfter = getUserAccountPermission(bankId, bankAccount.id, userId, user1).body.extract[ViewsJSONV121].views.length viewsAfter must equal(viewsBefore) @@ -1822,9 +1823,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val viewsBefore = getUserAccountPermission(bankId, bankAccount.id, userId, user1).body.extract[ViewsJSONV121].views.length When("the request is sent") val reply = grantUserAccessToView(bankId, bankAccount.id, userId, randomViewPermalink(bankId, bankAccount), user3) - Then("we must get a 400 ok code") + Then("We should get a 400 ok code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) val viewsAfter = getUserAccountPermission(bankId, bankAccount.id, userId, user1).body.extract[ViewsJSONV121].views.length viewsAfter must equal(viewsBefore) @@ -1841,12 +1842,12 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val viewsBefore = getUserAccountPermission(bankId, bankAccount.id, userId, user1).body.extract[ViewsJSONV121].views.length When("the request is sent") val reply = grantUserAccessToViews(bankId, bankAccount.id, userId, viewsIdsToGrant, user1) - Then("we must get a 201 ok code") + Then("We should get a 201 ok code") reply.code must equal (201) val viewsInfo = reply.body.extract[ViewsJSONV121] - And("some fields must not be empty") + And("some fields should not be empty") viewsInfo.views.foreach(v => v.id.nonEmpty must equal (true)) - And("the granted views must be the same") + And("the granted views should bethe same") viewsIdsToGrant.toSet must equal(viewsInfo.views.map(_.id).toSet) val viewsAfter = getUserAccountPermission(bankId, bankAccount.id, userId, user1).body.extract[ViewsJSONV121].views viewsAfter.length must equal(viewsBefore + viewsIdsToGrant.length) @@ -1862,9 +1863,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val viewsIdsToGrant= randomViewsIdsToGrant(bankId, bankAccount.id) When("the request is sent") val reply = grantUserAccessToViews(bankId, bankAccount.id, userId, viewsIdsToGrant, user1) - Then("we must get a 400 ok code") + Then("We should get a 400 ok code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1876,9 +1877,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val viewsIdsToGrant= List(randomString(3),randomString(3)) When("the request is sent") val reply = grantUserAccessToViews(bankId, bankAccount.id, userId, viewsIdsToGrant, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -1891,9 +1892,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val viewsBefore = getUserAccountPermission(bankId, bankAccount.id, userId, user1).body.extract[ViewsJSONV121].views.length When("the request is sent") val reply = grantUserAccessToViews(bankId, bankAccount.id, userId, viewsIdsToGrant, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) val viewsAfter = getUserAccountPermission(bankId, bankAccount.id, userId, user1).body.extract[ViewsJSONV121].views.length viewsAfter must equal(viewsBefore) @@ -1908,9 +1909,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val viewsBefore = getUserAccountPermission(bankId, bankAccount.id, userId, user1).body.extract[ViewsJSONV121].views.length When("the request is sent") val reply = grantUserAccessToViews(bankId, bankAccount.id, userId, viewsIdsToGrant, user3) - Then("we must get a 400 ok code") + Then("We should get a 400 ok code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) val viewsAfter = getUserAccountPermission(bankId, bankAccount.id, userId, user1).body.extract[ViewsJSONV121].views.length viewsAfter must equal(viewsBefore) @@ -1929,7 +1930,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val viewsBefore = getUserAccountPermission(bankId, bankAccount.id, userId, user1).body.extract[ViewsJSONV121].views.length When("the request is sent") val reply = revokeUserAccessToView(bankId, bankAccount.id, userId, viewId, user1) - Then("we must get a 204 no content code") + Then("We should get a 204 no content code") reply.code must equal (204) val viewsAfter = getUserAccountPermission(bankId, bankAccount.id, userId, user1).body.extract[ViewsJSONV121].views.length viewsAfter must equal(viewsBefore -1) @@ -1947,7 +1948,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val viewsBefore = getUserAccountPermission(bankId, bankAccount.id, userId1, user1).body.extract[ViewsJSONV121].views.length When("the request is sent") val reply = revokeUserAccessToView(bankId, bankAccount.id, userId1, viewId, user1) - Then("we must get a 204 no content code") + Then("We should get a 204 no content code") reply.code must equal (204) val viewsAfter = getUserAccountPermission(bankId, bankAccount.id, userId1, user1).body.extract[ViewsJSONV121].views.length viewsAfter must equal(viewsBefore -1) @@ -1971,7 +1972,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val viewUsersBefore = Views.views.vend.getOwners(view).toList When("the request is sent") val reply = revokeUserAccessToView(bankId, bankAccount.id, viewUsersBefore(0).idGivenByProvider, viewId.value, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) val viewUsersAfter = Views.views.vend.getOwners(view).toList viewUsersAfter.length must equal(viewUsersBefore.length) @@ -1983,7 +1984,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = revokeUserAccessToView(bankId, bankAccount.id, randomString(5), randomViewPermalink(bankId, bankAccount), user1) - Then("we must get a 400 ok code") + Then("We should get a 400 ok code") reply.code must equal (400) } @@ -2018,7 +2019,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val viewsBefore = getUserAccountPermission(bankId, bankAccount.id, userId, user1).body.extract[ViewsJSONV121].views.length When("the request is sent") val reply = revokeUserAccessToView(bankId, bankAccount.id, userId, randomString(5), user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) val viewsAfter = getUserAccountPermission(bankId, bankAccount.id, userId, user1).body.extract[ViewsJSONV121].views.length viewsAfter must equal(viewsBefore) @@ -2032,7 +2033,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val viewsBefore = getUserAccountPermission(bankId, bankAccount.id, userId, user1).body.extract[ViewsJSONV121].views.length When("the request is sent") val reply = revokeUserAccessToView(bankId, bankAccount.id, userId, randomViewPermalink(bankId, bankAccount), user3) - Then("we must get a 400 ok code") + Then("We should get a 400 ok code") reply.code must equal (400) val viewsAfter = getUserAccountPermission(bankId, bankAccount.id, userId, user1).body.extract[ViewsJSONV121].views.length viewsAfter must equal(viewsBefore) @@ -2049,7 +2050,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser grantUserAccessToViews(bankId, bankAccount.id, userId, viewsIdsToGrant, user1) When("the request is sent") val reply = revokeUserAccessToAllViews(bankId, bankAccount.id, userId, user1) - Then("we must get a 204 no content code") + Then("We should get a 204 no content code") reply.code must equal (204) val viewsAfter = getUserAccountPermission(bankId, bankAccount.id, userId, user1).body.extract[ViewsJSONV121].views.length viewsAfter must equal(0) @@ -2061,7 +2062,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = revokeUserAccessToAllViews(bankId, bankAccount.id, randomString(5), user1) - Then("we must get a 400 ok code") + Then("We should get a 400 ok code") reply.code must equal (400) } @@ -2076,7 +2077,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val viewsBefore = getUserAccountPermission(bankId, bankAccount.id, userId, user1).body.extract[ViewsJSONV121].views.length When("the request is sent") val reply = revokeUserAccessToAllViews(bankId, bankAccount.id, userId, user3) - Then("we must get a 400 ok code") + Then("We should get a 400 ok code") reply.code must equal (400) val viewsAfter = getUserAccountPermission(bankId, bankAccount.id, userId, user1).body.extract[ViewsJSONV121].views.length viewsAfter must equal(viewsBefore) @@ -2098,10 +2099,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val reply = revokeUserAccessToAllViews(bankId, bankAccount.id, userId, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("The user must not have had his access revoked") + And("The user should not have had his access revoked") Views.views.vend.getOwners(view).toList.length must equal(1) Views.views.vend.getOwners(view).toList(0).idGivenByProvider must equal(userId) } @@ -2120,7 +2121,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("We try to revoke this user's access to all views") val reply = revokeUserAccessToAllViews(bankId, bankAccount.id, resourceUser3.idGivenByProvider, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) And("The user should not have had his access revoked") @@ -2138,10 +2139,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getTheCounterparties(bankId, bankAccount.id, randomViewPermalink(bankId, bankAccount), user1) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) val accountsJson = reply.body.extract[OtherAccountsJSON] - And("some fields must not be empty") + And("some fields should not be empty") accountsJson.other_accounts.foreach( a => a.id.nonEmpty must equal (true) ) @@ -2153,9 +2154,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getTheCounterparties(bankId, bankAccount.id, randomViewPermalink(bankId, bankAccount), None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -2165,9 +2166,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getTheCounterparties(bankId, bankAccount.id, randomViewPermalink(bankId, bankAccount), user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -2177,9 +2178,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val bankAccount : AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getTheCounterparties(bankId, bankAccount.id, randomString(5), user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -2193,10 +2194,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val otherBankAccount = randomCounterparty(bankId, bankAccount.id, view) When("the request is sent") val reply = getTheCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) val accountJson = reply.body.extract[OtherAccountJSON] - And("some fields must not be empty") + And("some fields should not be empty") accountJson.id.nonEmpty must equal (true) } @@ -2208,9 +2209,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val otherBankAccount = randomCounterparty(bankId, bankAccount.id, view) When("the request is sent") val reply = getTheCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -2222,9 +2223,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val otherBankAccount = randomCounterparty(bankId, bankAccount.id, view) When("the request is sent") val reply = getTheCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -2235,9 +2236,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val otherBankAccount = randomCounterparty(bankId, bankAccount.id, randomViewPermalink(bankId, bankAccount)) When("the request is sent") val reply = getTheCounterparty(bankId, bankAccount.id, randomString(5), otherBankAccount.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -2248,9 +2249,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = getTheCounterparty(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -2264,9 +2265,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val otherBankAccount = randomCounterparty(bankId, bankAccount.id, view) When("the request is sent") val reply = getMetadataOfOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) - And("some fields must not be empty") + And("some fields should not be empty") reply.body.extract[OtherAccountMetadataJSON] } @@ -2278,9 +2279,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val otherBankAccount = randomCounterparty(bankId, bankAccount.id, view) When("the request is sent") val reply = getMetadataOfOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -2292,9 +2293,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val otherBankAccount = randomCounterparty(bankId, bankAccount.id, view) When("the request is sent") val reply = getMetadataOfOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -2306,9 +2307,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val otherBankAccount = randomCounterparty(bankId, bankAccount.id, view) When("the request is sent") val reply = getMetadataOfOneCounterparty(bankId, bankAccount.id, randomString(5), otherBankAccount.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -2319,9 +2320,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = getMetadataOfOneCounterparty(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -2335,7 +2336,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val otherBankAccount = randomCounterparty(bankId, bankAccount.id, view) When("the request is sent") val reply = getThePublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) reply.body.extract[AliasJSON] } @@ -2348,9 +2349,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val otherBankAccount = randomCounterparty(bankId, bankAccount.id, view) When("the request is sent") val reply = getThePublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -2362,9 +2363,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val otherBankAccount = randomCounterparty(bankId, bankAccount.id, view) When("the request is sent") val reply = getThePublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -2376,9 +2377,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val otherBankAccount = randomCounterparty(bankId, bankAccount.id, view) When("the request is sent") val reply = getThePublicAliasForOneCounterparty(bankId, bankAccount.id, randomString(5), otherBankAccount.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -2390,9 +2391,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val otherBankAccount = randomCounterparty(bankId, bankAccount.id, view) When("the request is sent") val reply = getThePublicAliasForOneCounterparty(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -2407,10 +2408,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val randomAlias = randomString(5) val postReply = postAPublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[SuccessMessage] - And("the alias must be changed") + And("the alias should bechanged") val getReply = getThePublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must equal (theAliasAfterThePost.alias) @@ -2425,11 +2426,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomAlias = randomString(5) When("the request is sent") val postReply = postAPublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the alias must not be changed") + And("the alias should not be changed") val getReply = getThePublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must not equal (theAliasAfterThePost.alias) @@ -2444,11 +2445,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomAlias = randomString(5) When("the request is sent") val postReply = postAPublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the alias must not be changed") + And("the alias should not be changed") val getReply = getThePublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must not equal (theAliasAfterThePost.alias) @@ -2463,11 +2464,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomAlias = randomString(5) When("the request is sent") val postReply = postAPublicAliasForOneCounterparty(bankId, bankAccount.id, randomString(5), otherBankAccount.id, randomAlias, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the alias must not be changed") + And("the alias should not be changed") val getReply = getThePublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must not equal (theAliasAfterThePost.alias) @@ -2481,9 +2482,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomAlias = randomString(5) When("the request is sent") val postReply = postAPublicAliasForOneCounterparty(bankId, bankAccount.id, view, randomString(5), randomAlias, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -2498,10 +2499,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val randomAlias = randomString(5) val putReply = updateThePublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") putReply.code must equal (200) putReply.body.extract[SuccessMessage] - And("the alias must be changed") + And("the alias should bechanged") val getReply = getThePublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must equal (theAliasAfterThePost.alias) @@ -2516,11 +2517,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomAlias = randomString(5) When("the request is sent") val putReply = updateThePublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, None) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the alias must not be changed") + And("the alias should not be changed") val getReply = getThePublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must not equal (theAliasAfterThePost.alias) @@ -2535,9 +2536,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomAlias = randomString(5) When("the request is sent") val putReply = updateThePublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -2549,9 +2550,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomAlias = randomString(5) When("the request is sent") val putReply = updateThePublicAliasForOneCounterparty(bankId, bankAccount.id, view, randomString(5), randomAlias, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -2567,9 +2568,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postAPublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user1) When("the delete request is sent") val deleteReply = deleteThePublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) - And("the public alias must be null") + And("the public alias should benull") val getReply = getThePublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterTheDelete : AliasJSON = getReply.body.extract[AliasJSON] theAliasAfterTheDelete.alias must equal (null) @@ -2584,9 +2585,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postAPublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user1) When("the delete request is sent") val deleteReply = deleteThePublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the public alias must not be null") + And("the public alias should not be null") val getReply = getThePublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterTheDelete : AliasJSON = getReply.body.extract[AliasJSON] theAliasAfterTheDelete.alias must not equal (null) @@ -2601,9 +2602,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postAPublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user1) When("the delete request is sent") val deleteReply = deleteThePublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the public alias must not be null") + And("the public alias should not be null") val getReply = getThePublicAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterTheDelete : AliasJSON = getReply.body.extract[AliasJSON] theAliasAfterTheDelete.alias must not equal (null) @@ -2616,7 +2617,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomAlias = randomString(5) When("the delete request is sent") val deleteReply = deleteThePublicAliasForOneCounterparty(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } } @@ -2630,7 +2631,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val otherBankAccount = randomCounterparty(bankId, bankAccount.id, view) When("the request is sent") val reply = getThePrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) reply.body.extract[AliasJSON] } @@ -2643,9 +2644,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val otherBankAccount = randomCounterparty(bankId, bankAccount.id, view) When("the request is sent") val reply = getThePrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -2657,9 +2658,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val otherBankAccount = randomCounterparty(bankId, bankAccount.id, view) When("the request is sent") val reply = getThePrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -2671,9 +2672,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val otherBankAccount = randomCounterparty(bankId, bankAccount.id, view) When("the request is sent") val reply = getThePrivateAliasForOneCounterparty(bankId, bankAccount.id, randomString(5), otherBankAccount.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -2685,9 +2686,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val reply = getThePrivateAliasForOneCounterparty(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -2702,10 +2703,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val randomAlias = randomString(5) val postReply = postAPrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[SuccessMessage] - And("the alias must be changed") + And("the alias should bechanged") val getReply = getThePrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must equal (theAliasAfterThePost.alias) @@ -2720,11 +2721,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomAlias = randomString(5) When("the request is sent") val postReply = postAPrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the alias must not be changed") + And("the alias should not be changed") val getReply = getThePrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must not equal (theAliasAfterThePost.alias) @@ -2739,11 +2740,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomAlias = randomString(5) When("the request is sent") val postReply = postAPrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the alias must not be changed") + And("the alias should not be changed") val getReply = getThePrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must not equal (theAliasAfterThePost.alias) @@ -2758,11 +2759,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomAlias = randomString(5) When("the request is sent") val postReply = postAPrivateAliasForOneCounterparty(bankId, bankAccount.id, randomString(5), otherBankAccount.id, randomAlias, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the alias must not be changed") + And("the alias should not be changed") val getReply = getThePrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must not equal (theAliasAfterThePost.alias) @@ -2776,9 +2777,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomAlias = randomString(5) When("the request is sent") val postReply = postAPrivateAliasForOneCounterparty(bankId, bankAccount.id, view, randomString(5), randomAlias, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -2793,10 +2794,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val randomAlias = randomString(5) val putReply = updateThePrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") putReply.code must equal (200) putReply.body.extract[SuccessMessage] - And("the alias must be changed") + And("the alias should bechanged") val getReply = getThePrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must equal (theAliasAfterThePost.alias) @@ -2811,11 +2812,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomAlias = randomString(5) When("the request is sent") val putReply = updateThePrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, None) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the alias must not be changed") + And("the alias should not be changed") val getReply = getThePrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterThePost : AliasJSON = getReply.body.extract[AliasJSON] randomAlias must not equal (theAliasAfterThePost.alias) @@ -2830,9 +2831,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomAlias = randomString(5) When("the request is sent") val putReply = updateThePrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -2844,9 +2845,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomAlias = randomString(5) When("the request is sent") val putReply = updateThePrivateAliasForOneCounterparty(bankId, bankAccount.id, view, randomString(5), randomAlias, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -2862,9 +2863,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postAPrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user1) When("the delete request is sent") val deleteReply = deleteThePrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) - And("the Private alias must be null") + And("the Private alias should benull") val getReply = getThePrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterTheDelete : AliasJSON = getReply.body.extract[AliasJSON] theAliasAfterTheDelete.alias must equal (null) @@ -2879,9 +2880,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postAPrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user1) When("the delete request is sent") val deleteReply = deleteThePrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the Private alias must not be null") + And("the Private alias should not be null") val getReply = getThePrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterTheDelete : AliasJSON = getReply.body.extract[AliasJSON] theAliasAfterTheDelete.alias must not equal (null) @@ -2896,9 +2897,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postAPrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomAlias, user1) When("the delete request is sent") val deleteReply = deleteThePrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the Private alias must not be null") + And("the Private alias should not be null") val getReply = getThePrivateAliasForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) val theAliasAfterTheDelete : AliasJSON = getReply.body.extract[AliasJSON] theAliasAfterTheDelete.alias must not equal (null) @@ -2911,7 +2912,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomAlias = randomString(5) When("the delete request is sent") val deleteReply = deleteThePrivateAliasForOneCounterparty(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } } @@ -2926,10 +2927,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val randomInfo = randomString(20) val postReply = postMoreInfoForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomInfo, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[SuccessMessage] - And("the information must be changed") + And("the information should bechanged") val moreInfo = getMoreInfoForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomInfo must equal (moreInfo) } @@ -2943,11 +2944,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomInfo = randomString(20) When("the request is sent") val postReply = postMoreInfoForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomInfo, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the information must not be changed") + And("the information should not be changed") val moreInfo = getMoreInfoForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomInfo must not equal (moreInfo) } @@ -2961,11 +2962,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomInfo = randomString(20) When("the request is sent") val postReply = postMoreInfoForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomInfo, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the information must not be changed") + And("the information should not be changed") val moreInfo = getMoreInfoForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomInfo must not equal (moreInfo) } @@ -2979,11 +2980,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomInfo = randomString(20) When("the request is sent") val postReply = postMoreInfoForOneCounterparty(bankId, bankAccount.id, randomString(5), otherBankAccount.id, randomInfo, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the information must not be changed") + And("the information should not be changed") val moreInfo = getMoreInfoForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomInfo must not equal (moreInfo) } @@ -2996,9 +2997,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomInfo = randomString(20) When("the request is sent") val postReply = postMoreInfoForOneCounterparty(bankId, bankAccount.id, view, randomString(5), randomInfo, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -3013,10 +3014,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val randomInfo = randomString(20) val putReply = updateMoreInfoForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomInfo, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") putReply.code must equal (200) putReply.body.extract[SuccessMessage] - And("the information must be changed") + And("the information should bechanged") val moreInfo = getMoreInfoForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomInfo must equal (moreInfo) } @@ -3030,11 +3031,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomInfo = randomString(20) When("the request is sent") val putReply = updateMoreInfoForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomInfo, None) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the information must not be changed") + And("the information should not be changed") val moreInfo = getMoreInfoForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomInfo must not equal (moreInfo) } @@ -3048,9 +3049,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomInfo = randomString(20) When("the request is sent") val putReply = updateMoreInfoForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomInfo, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3062,9 +3063,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomInfo = randomString(20) When("the request is sent") val putReply = updateMoreInfoForOneCounterparty(bankId, bankAccount.id, view, randomString(5), randomInfo, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -3080,9 +3081,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postMoreInfoForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomInfo, user1) When("the delete request is sent") val deleteReply = deleteMoreInfoForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) - And("the info must be null") + And("the info should be null") val infoAfterDelete = getMoreInfoForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) infoAfterDelete must equal (null) } @@ -3097,9 +3098,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postMoreInfoForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomInfo, user1) When("the delete request is sent") val deleteReply = deleteMoreInfoForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the info must not be null") + And("the info should not be null") val infoAfterDelete = getMoreInfoForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) infoAfterDelete must not equal (null) } @@ -3114,9 +3115,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postMoreInfoForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomInfo, user1) When("the delete request is sent") val deleteReply = deleteMoreInfoForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the info must not be null") + And("the info should not be null") val infoAfterDelete = getMoreInfoForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) infoAfterDelete must not equal (null) } @@ -3129,7 +3130,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomInfo = randomString(20) When("the delete request is sent") val deleteReply = deleteMoreInfoForOneCounterparty(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } } @@ -3144,10 +3145,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val randomURL = randomString(20) val postReply = postUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[SuccessMessage] - And("the url must be changed") + And("the url should bechanged") val url = getUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must equal (url) } @@ -3161,11 +3162,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomURL = randomString(20) When("the request is sent") val postReply = postUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the url must not be changed") + And("the url should not be changed") val url = getUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must not equal (url) } @@ -3179,11 +3180,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomURL = randomString(20) When("the request is sent") val postReply = postUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the url must not be changed") + And("the url should not be changed") val url = getUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must not equal (url) } @@ -3197,11 +3198,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomURL = randomString(20) When("the request is sent") val postReply = postUrlForOneCounterparty(bankId, bankAccount.id, randomString(5), otherBankAccount.id, randomURL, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the url must not be changed") + And("the url should not be changed") val url = getUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must not equal (url) } @@ -3214,9 +3215,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomURL = randomString(20) When("the request is sent") val postReply = postUrlForOneCounterparty(bankId, bankAccount.id, view, randomString(5), randomURL, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -3231,10 +3232,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val randomURL = randomString(20) val putReply = updateUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") putReply.code must equal (200) putReply.body.extract[SuccessMessage] - And("the url must be changed") + And("the url should bechanged") val url = getUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must equal (url) } @@ -3248,11 +3249,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomURL = randomString(20) When("the request is sent") val putReply = updateUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, None) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the url must not be changed") + And("the url should not be changed") val url = getUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must not equal (url) } @@ -3266,9 +3267,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomURL = randomString(20) When("the request is sent") val putReply = updateUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3280,9 +3281,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomURL = randomString(20) When("the request is sent") val putReply = updateUrlForOneCounterparty(bankId, bankAccount.id, view, randomString(5), randomURL, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -3298,9 +3299,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user1) When("the delete request is sent") val deleteReply = deleteUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) - And("the url must be null") + And("the url should benull") val urlAfterDelete = getUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) urlAfterDelete must equal (null) } @@ -3315,9 +3316,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user1) When("the delete request is sent") val deleteReply = deleteUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the url must not be null") + And("the url should not be null") val urlAfterDelete = getUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) urlAfterDelete must not equal (null) } @@ -3332,9 +3333,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user1) When("the delete request is sent") val deleteReply = deleteUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the url must not be null") + And("the url should not be null") val urlAfterDelete = getUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) urlAfterDelete must not equal (null) } @@ -3347,7 +3348,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomURL = randomString(20) When("the delete request is sent") val deleteReply = deleteUrlForOneCounterparty(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } } @@ -3362,10 +3363,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val randomImageURL = randomString(20) val postReply = postImageUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomImageURL, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[SuccessMessage] - And("the image url must be changed") + And("the image url should bechanged") val url = getImageUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomImageURL must equal (url) } @@ -3379,11 +3380,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomImageURL = randomString(20) When("the request is sent") val postReply = postImageUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomImageURL, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the image url must not be changed") + And("the image url should not be changed") val url = getImageUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomImageURL must not equal (url) } @@ -3397,11 +3398,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomImageURL = randomString(20) When("the request is sent") val postReply = postImageUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomImageURL, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the image url must not be changed") + And("the image url should not be changed") val url = getImageUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomImageURL must not equal (url) } @@ -3415,11 +3416,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomImageURL = randomString(20) When("the request is sent") val postReply = postImageUrlForOneCounterparty(bankId, bankAccount.id, randomString(5), otherBankAccount.id, randomImageURL, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the image url must not be changed") + And("the image url should not be changed") val url = getImageUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomImageURL must not equal (url) } @@ -3432,9 +3433,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomImageURL = randomString(20) When("the request is sent") val postReply = postImageUrlForOneCounterparty(bankId, bankAccount.id, view, randomString(5), randomImageURL, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -3449,10 +3450,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val randomImageURL = randomString(20) val putReply = updateImageUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomImageURL, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") putReply.code must equal (200) putReply.body.extract[SuccessMessage] - And("the image url must be changed") + And("the image url should bechanged") val url = getImageUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomImageURL must equal (url) } @@ -3466,11 +3467,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomImageURL = randomString(20) When("the request is sent") val putReply = updateImageUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomImageURL, None) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the image url must not be changed") + And("the image url should not be changed") val url = getImageUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomImageURL must not equal (url) } @@ -3484,9 +3485,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomImageURL = randomString(20) When("the request is sent") val putReply = updateImageUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomImageURL, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3498,9 +3499,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomImageURL = randomString(20) When("the request is sent") val putReply = updateImageUrlForOneCounterparty(bankId, bankAccount.id, view, randomString(5), randomImageURL, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -3516,9 +3517,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postImageUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomImageURL, user1) When("the delete request is sent") val deleteReply = deleteImageUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) - And("the image url must be null") + And("the image url should benull") val urlAfterDelete = getImageUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) urlAfterDelete must equal (null) } @@ -3533,9 +3534,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postImageUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomImageURL, user1) When("the delete request is sent") val deleteReply = deleteImageUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the image url must not be null") + And("the image url should not be null") val urlAfterDelete = getImageUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) urlAfterDelete must not equal (null) } @@ -3550,9 +3551,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postImageUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomImageURL, user1) When("the delete request is sent") val deleteReply = deleteImageUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the image url must not be null") + And("the image url should not be null") val urlAfterDelete = getImageUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) urlAfterDelete must not equal (null) } @@ -3565,7 +3566,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomImageURL = randomString(20) When("the delete request is sent") val deleteReply = deleteImageUrlForOneCounterparty(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } } @@ -3580,10 +3581,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val randomURL = randomString(20) val postReply = postOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[SuccessMessage] - And("the open corporates url must be changed") + And("the open corporates url should bechanged") val url = getOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must equal (url) } @@ -3597,11 +3598,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomURL = randomString(20) When("the request is sent") val postReply = postOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the open corporates url must not be changed") + And("the open corporates url should not be changed") val url = getOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must not equal (url) } @@ -3615,11 +3616,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomURL = randomString(20) When("the request is sent") val postReply = postOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the open corporates url must not be changed") + And("the open corporates url should not be changed") val url = getOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must not equal (url) } @@ -3633,11 +3634,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomURL = randomString(20) When("the request is sent") val postReply = postOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, randomString(5), otherBankAccount.id, randomURL, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the open corporates url must not be changed") + And("the open corporates url should not be changed") val url = getOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must not equal (url) } @@ -3650,9 +3651,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomURL = randomString(20) When("the request is sent") val postReply = postOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, randomString(5), randomURL, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -3667,10 +3668,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val randomURL = randomString(20) val putReply = updateOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") putReply.code must equal (200) putReply.body.extract[SuccessMessage] - And("the open corporates url must be changed") + And("the open corporates url should bechanged") val url = getOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must equal (url) } @@ -3684,11 +3685,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomURL = randomString(20) When("the request is sent") val putReply = updateOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, None) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the open corporates url must not be changed") + And("the open corporates url should not be changed") val url = getOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomURL must not equal (url) } @@ -3702,9 +3703,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomURL = randomString(20) When("the request is sent") val putReply = updateOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3716,9 +3717,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomURL = randomString(20) When("the request is sent") val putReply = updateOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, randomString(5), randomURL, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -3734,9 +3735,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user1) When("the delete request is sent") val deleteReply = deleteOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) - And("the open corporates url must be null") + And("the open corporates url should benull") val urlAfterDelete = getOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) urlAfterDelete must equal (null) } @@ -3751,9 +3752,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user1) When("the delete request is sent") val deleteReply = deleteOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the open corporates url must not be null") + And("the open corporates url should not be null") val urlAfterDelete = getOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) urlAfterDelete must not equal (null) } @@ -3768,9 +3769,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomURL, user1) When("the delete request is sent") val deleteReply = deleteOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the open corporates url must not be null") + And("the open corporates url should not be null") val urlAfterDelete = getOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) urlAfterDelete must not equal (null) } @@ -3783,7 +3784,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomURL = randomString(20) When("the delete request is sent") val deleteReply = deleteOpenCorporatesUrlForOneCounterparty(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } } @@ -3798,10 +3799,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the request is sent") val postReply = postCorporateLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[SuccessMessage] - And("the corporate location must be changed") + And("the corporate location should bechanged") val location = getCorporateLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomLoc.latitude must equal (location.latitude) randomLoc.longitude must equal (location.longitude) @@ -3816,9 +3817,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the request is sent") val postReply = postCorporateLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3831,9 +3832,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser var randomLoc = JSONFactory.createLocationPlainJSON(400,200) When("the request is sent") val postReply = postCorporateLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3846,9 +3847,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the request is sent") val postReply = postCorporateLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3861,9 +3862,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the request is sent") val postReply = postCorporateLocationForOneCounterparty(bankId, bankAccount.id, randomString(5), otherBankAccount.id, randomLoc, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3875,9 +3876,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the request is sent") val postReply = postCorporateLocationForOneCounterparty(bankId, bankAccount.id, view, randomString(5), randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -3892,10 +3893,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val randomLoc = randomLocation val putReply = updateCorporateLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") putReply.code must equal (200) putReply.body.extract[SuccessMessage] - And("the corporate location must be changed") + And("the corporate location should bechanged") val location = getCorporateLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomLoc.latitude must equal (location.latitude) randomLoc.longitude must equal (location.longitude) @@ -3910,9 +3911,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser var randomLoc = JSONFactory.createLocationPlainJSON(400,200) When("the request is sent") val putReply = updateCorporateLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3925,9 +3926,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the request is sent") val putReply = updateCorporateLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, None) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3940,9 +3941,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the request is sent") val putReply = updateCorporateLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -3954,9 +3955,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the request is sent") val putReply = updateCorporateLocationForOneCounterparty(bankId, bankAccount.id, view, randomString(5), randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -3972,9 +3973,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postCorporateLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) When("the delete request is sent") val deleteReply = deleteCorporateLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) - And("the corporate location must be null") + And("the corporate location should benull") val locationAfterDelete = getCorporateLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) locationAfterDelete must equal (null) } @@ -3989,9 +3990,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postCorporateLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) When("the delete request is sent") val deleteReply = deleteCorporateLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the corporate location must not be null") + And("the corporate location should not be null") val locationAfterDelete = getCorporateLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) locationAfterDelete must not equal (null) } @@ -4006,9 +4007,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postCorporateLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) When("the delete request is sent") val deleteReply = deleteCorporateLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the corporate location must not be null") + And("the corporate location should not be null") val locationAfterDelete = getCorporateLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) locationAfterDelete must not equal (null) } @@ -4021,7 +4022,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the delete request is sent") val deleteReply = deleteCorporateLocationForOneCounterparty(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } } @@ -4036,10 +4037,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the request is sent") val postReply = postPhysicalLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[SuccessMessage] - And("the physical location must be changed") + And("the physical location should bechanged") val location = getPhysicalLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomLoc.latitude must equal (location.latitude) randomLoc.longitude must equal (location.longitude) @@ -4054,9 +4055,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser var randomLoc = JSONFactory.createLocationPlainJSON(400,200) When("the request is sent") val postReply = postPhysicalLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -4069,9 +4070,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the request is sent") val postReply = postPhysicalLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -4084,9 +4085,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the request is sent") val postReply = postPhysicalLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -4099,9 +4100,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the request is sent") val postReply = postPhysicalLocationForOneCounterparty(bankId, bankAccount.id, randomString(5), otherBankAccount.id, randomLoc, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -4113,9 +4114,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the request is sent") val postReply = postPhysicalLocationForOneCounterparty(bankId, bankAccount.id, view, randomString(5), randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -4130,10 +4131,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val randomLoc = randomLocation val putReply = updatePhysicalLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") putReply.code must equal (200) putReply.body.extract[SuccessMessage] - And("the physical location must be changed") + And("the physical location should bechanged") val location = getPhysicalLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) randomLoc.latitude must equal (location.latitude) randomLoc.longitude must equal (location.longitude) @@ -4148,9 +4149,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser var randomLoc = JSONFactory.createLocationPlainJSON(400,200) When("the request is sent") val putReply = updatePhysicalLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -4163,9 +4164,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the request is sent") val putReply = updatePhysicalLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, None) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -4178,9 +4179,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the request is sent") val putReply = updatePhysicalLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -4192,9 +4193,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the request is sent") val putReply = updatePhysicalLocationForOneCounterparty(bankId, bankAccount.id, view, randomString(5), randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -4210,9 +4211,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postPhysicalLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) When("the delete request is sent") val deleteReply = deletePhysicalLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) - And("the physical location must be null") + And("the physical location should benull") val locationAfterDelete = getPhysicalLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) locationAfterDelete must equal (null) } @@ -4227,9 +4228,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postPhysicalLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) When("the delete request is sent") val deleteReply = deletePhysicalLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the physical location must not be null") + And("the physical location should not be null") val locationAfterDelete = getPhysicalLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) locationAfterDelete must not equal (null) } @@ -4244,9 +4245,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postPhysicalLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, randomLoc, user1) When("the delete request is sent") val deleteReply = deletePhysicalLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the physical location must not be null") + And("the physical location should not be null") val locationAfterDelete = getPhysicalLocationForOneCounterparty(bankId, bankAccount.id, view, otherBankAccount.id, user1) locationAfterDelete must not equal (null) } @@ -4259,7 +4260,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the delete request is sent") val deleteReply = deletePhysicalLocationForOneCounterparty(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } } @@ -4272,7 +4273,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = getTransactions(bankId,bankAccount.id,view, user1) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val transactions = reply.body.extract[TransactionsJSON] } @@ -4282,7 +4283,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val bankId = randomBank val reply = getTransactions(bankId,randomString(5),randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } @@ -4292,7 +4293,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val bankId = randomBank val bankAccount : AccountJSON = randomPrivateAccount(bankId) val reply = getTransactions(bankId,bankAccount.id,randomString(5), user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) } } @@ -4312,7 +4313,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent with a wrong value for param obp_sort_direction") val params = ("obp_sort_direction", "foo") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } scenario("we get all the transactions sorted by ASC", API1_2, GetTransactions, GetTransactionsWithParams) { @@ -4323,10 +4324,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent with the value ASC for param obp_sort_by") val params = ("obp_sort_direction", "ASC") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val transactions = reply.body.extract[TransactionsJSON] - And("transactions array must not be empty") + And("transactions array should not be empty") transactions.transactions.size must not equal (0) val transaction1 = transactions.transactions(0) val transaction2 = transactions.transactions(1) @@ -4340,10 +4341,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent with the value asc for param obp_sort_by") val params = ("obp_sort_direction", "asc") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val transactions = reply.body.extract[TransactionsJSON] - And("transactions array must not be empty") + And("transactions array should not be empty") transactions.transactions.size must not equal (0) val transaction1 = transactions.transactions(0) val transaction2 = transactions.transactions(1) @@ -4357,10 +4358,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent with the value DESC for param obp_sort_by") val params = ("obp_sort_direction", "DESC") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val transactions = reply.body.extract[TransactionsJSON] - And("transactions array must not be empty") + And("transactions array should not be empty") transactions.transactions.size must not equal (0) val transaction1 = transactions.transactions(0) val transaction2 = transactions.transactions(1) @@ -4374,10 +4375,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent with the value desc for param obp_sort_by") val params = ("obp_sort_direction", "desc") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val transactions = reply.body.extract[TransactionsJSON] - And("transactions array must not be empty") + And("transactions array should not be empty") transactions.transactions.size must not equal (0) val transaction1 = transactions.transactions(0) val transaction2 = transactions.transactions(1) @@ -4392,7 +4393,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent with a wrong value for param obp_limit") val params = ("obp_limit", "foo") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } scenario("we don't get transactions due to wrong value (0) for obp_limit parameter", API1_2, GetTransactions, GetTransactionsWithParams) { @@ -4403,7 +4404,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent with a wrong value for param obp_limit") val params = ("obp_limit", "0") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } scenario("we don't get transactions due to wrong value (-100) for obp_limit parameter", API1_2, GetTransactions, GetTransactionsWithParams) { @@ -4414,7 +4415,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent with a wrong value for param obp_limit") val params = ("obp_limit", "-100") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } scenario("we get only 5 transactions due to the obp_limit parameter value", API1_2, GetTransactions, GetTransactionsWithParams) { @@ -4425,10 +4426,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent with the value ASC for parameter obp_limit") val params = ("obp_limit", "5") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val transactions = reply.body.extract[TransactionsJSON] - And("transactions size must be equal to 5") + And("transactions size should be equal to 5") transactions.transactions.size must equal (5) } scenario("we don't get transactions due to wrong value for obp_from_date parameter", API1_2, GetTransactions, GetTransactionsWithParams) { @@ -4439,7 +4440,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent with a wrong value for param obp_from_date") val params = ("obp_from_date", "foo") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } scenario("we get transactions from a previous date with the right format", API1_2, GetTransactions, GetTransactionsWithParams) { @@ -4456,9 +4457,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val formatedPastDate = defaultFormat.format(pastDate) val params = ("obp_from_date", formatedPastDate) :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) - And("transactions size must not be empty") + And("transactions size should not be empty") val transactions = reply.body.extract[TransactionsJSON] transactions.transactions.size must not equal (0) } @@ -4476,9 +4477,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val formatedPastDate = rollbackFormat.format(pastDate) val params = ("obp_from_date", formatedPastDate) :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) - And("transactions size must not be empty") + And("transactions size should not be empty") val transactions = reply.body.extract[TransactionsJSON] transactions.transactions.size must not equal (0) } @@ -4496,9 +4497,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val formatedFutureDate = defaultFormat.format(futureDate) val params = ("obp_from_date", formatedFutureDate) :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) - And("transactions size must not be empty") + And("transactions size should not be empty") val transactions = reply.body.extract[TransactionsJSON] transactions.transactions.size must equal (0) } @@ -4510,7 +4511,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent with a wrong value for param obp_to_date") val params = ("obp_to_date", "foo") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } scenario("we get transactions from a previous (obp_to_date) date with the right format", API1_2, GetTransactions, GetTransactionsWithParams) { @@ -4523,9 +4524,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val formatedCurrentDate = defaultFormat.format(currentDate) val params = ("obp_to_date", formatedCurrentDate) :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) - And("transactions size must not be empty") + And("transactions size should not be empty") val transactions = reply.body.extract[TransactionsJSON] transactions.transactions.size must not equal (0) } @@ -4539,9 +4540,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val formatedCurrentDate = defaultFormat.format(currentDate) val params = ("obp_to_date", formatedCurrentDate) :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) - And("transactions size must not be empty") + And("transactions size should not be empty") val transactions = reply.body.extract[TransactionsJSON] transactions.transactions.size must not equal (0) } @@ -4559,9 +4560,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val formatedPastDate = defaultFormat.format(pastDate) val params = ("obp_to_date", formatedPastDate) :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) - And("transactions size must be empty") + And("transactions size should be empty") val transactions = reply.body.extract[TransactionsJSON] transactions.transactions.size must equal (0) } @@ -4573,7 +4574,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent with a wrong value for param obp_offset") val params = ("obp_offset", "foo") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } scenario("we don't get transactions due to the (2000) for obp_offset parameter", API1_2, GetTransactions, GetTransactionsWithParams) { @@ -4584,9 +4585,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent with a wrong value for param obp_offset") val params = ("obp_offset", "2000") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) - And("transactions size must be empty") + And("transactions size should be empty") val transactions = reply.body.extract[TransactionsJSON] transactions.transactions.size must equal (0) } @@ -4598,7 +4599,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent with a wrong value for param obp_offset") val params = ("obp_offset", "-100") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } scenario("we get only 5 transactions due to the obp_offset parameter value", API1_2, GetTransactions, GetTransactionsWithParams) { @@ -4609,10 +4610,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent with the value ASC for parameter obp_offset") val params = ("obp_offset", "5") :: Nil val reply = getTransactions(bankId,bankAccount.id,view, user1, params) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val transactions = reply.body.extract[TransactionsJSON] - And("transactions size must be equal to 5") + And("transactions size should be equal to 5") transactions.transactions.size must equal (5) } } @@ -4626,7 +4627,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTransaction(bankId, bankAccount.id, view, transaction.id, user1) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) reply.body.extract[TransactionJSON] } @@ -4639,7 +4640,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTransaction(bankId, bankAccount.id, view, transaction.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } @@ -4651,7 +4652,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTransaction(bankId, bankAccount.id, view, transaction.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } @@ -4663,7 +4664,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTransaction(bankId, randomString(5), view, transaction.id, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } @@ -4675,7 +4676,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTransaction(bankId, bankAccount.id, randomString(5), transaction.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) } @@ -4686,7 +4687,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = getTransaction(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) } @@ -4701,7 +4702,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) reply.body.extract[TransactionNarrativeJSON] } @@ -4714,9 +4715,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -4728,9 +4729,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -4742,9 +4743,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getNarrativeForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -4755,9 +4756,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -4772,10 +4773,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val randomNarrative = randomString(20) val postReply = postNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomNarrative, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[SuccessMessage] - And("the narrative must be added") + And("the narrative should be added") val getReply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val theNarrativeAfterThePost : TransactionNarrativeJSON = getReply.body.extract[TransactionNarrativeJSON] randomNarrative must equal (theNarrativeAfterThePost.narrative) @@ -4790,11 +4791,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomNarrative = randomString(20) When("the request is sent") val postReply = postNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomNarrative, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the narrative must not be added") + And("the narrative should not be added") val getReply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val theNarrativeAfterThePost : TransactionNarrativeJSON = getReply.body.extract[TransactionNarrativeJSON] randomNarrative must not equal (theNarrativeAfterThePost.narrative) @@ -4809,11 +4810,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomNarrative = randomString(20) When("the request is sent") val postReply = postNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomNarrative, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the narrative must not be added") + And("the narrative should not be added") val getReply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val theNarrativeAfterThePost : TransactionNarrativeJSON = getReply.body.extract[TransactionNarrativeJSON] randomNarrative must not equal (theNarrativeAfterThePost.narrative) @@ -4828,11 +4829,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomNarrative = randomString(20) When("the request is sent") val postReply = postNarrativeForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, randomNarrative, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the narrative must not be added") + And("the narrative should not be added") val getReply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val theNarrativeAfterThePost : TransactionNarrativeJSON = getReply.body.extract[TransactionNarrativeJSON] randomNarrative must not equal (theNarrativeAfterThePost.narrative) @@ -4846,9 +4847,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomNarrative = randomString(20) When("the request is sent") val postReply = postNarrativeForOneTransaction(bankId, bankAccount.id, view, randomString(5), randomNarrative, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -4863,10 +4864,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val randomNarrative = randomString(20) val putReply = updateNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomNarrative, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") putReply.code must equal (200) putReply.body.extract[SuccessMessage] - And("the narrative must be changed") + And("the narrative should be changed") val getReply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val narrativeAfterThePost : TransactionNarrativeJSON = getReply.body.extract[TransactionNarrativeJSON] randomNarrative must equal (narrativeAfterThePost.narrative) @@ -4881,11 +4882,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomNarrative = randomString(20) When("the request is sent") val putReply = updateNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomNarrative, None) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the narrative must not be changed") + And("the narrative should not be changed") val getReply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val narrativeAfterThePost : TransactionNarrativeJSON = getReply.body.extract[TransactionNarrativeJSON] randomNarrative must not equal (narrativeAfterThePost.narrative) @@ -4900,11 +4901,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomNarrative = randomString(20) When("the request is sent") val putReply = updateNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomNarrative, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the narrative must not be changed") + And("the narrative should not be changed") val getReply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val narrativeAfterThePost : TransactionNarrativeJSON = getReply.body.extract[TransactionNarrativeJSON] randomNarrative must not equal (narrativeAfterThePost.narrative) @@ -4919,9 +4920,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomNarrative = randomString(20) When("the request is sent") val putReply = updateNarrativeForOneTransaction(bankId, bankAccount.id, view, transactionId, randomNarrative, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -4937,9 +4938,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomNarrative, user1) When("the delete request is sent") val deleteReply = deleteNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) - And("the narrative must be null") + And("the narrative should be null") val getReply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val narrativeAfterTheDelete : TransactionNarrativeJSON = getReply.body.extract[TransactionNarrativeJSON] narrativeAfterTheDelete.narrative must equal (null) @@ -4955,9 +4956,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomNarrative, user1) When("the delete request is sent") val deleteReply = deleteNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the public narrative must not be null") + And("the public narrative should not be null") val getReply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val narrativeAfterTheDelete : TransactionNarrativeJSON = getReply.body.extract[TransactionNarrativeJSON] narrativeAfterTheDelete.narrative must not equal (null) @@ -4973,9 +4974,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomNarrative, user1) When("the delete request is sent") val deleteReply = deleteNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - And("the narrative must not be null") + And("the narrative should not be null") val getReply = getNarrativeForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val narrativeAfterTheDelete : TransactionNarrativeJSON = getReply.body.extract[TransactionNarrativeJSON] narrativeAfterTheDelete.narrative must not equal (null) @@ -4989,7 +4990,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomNarrative = randomString(20) When("the delete request is sent") val deleteReply = deleteNarrativeForOneTransaction(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } } @@ -5003,7 +5004,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getCommentsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) reply.body.extract[TransactionCommentsJSON] } @@ -5016,9 +5017,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getCommentsForOneTransaction(bankId, bankAccount.id, view, transaction.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5030,9 +5031,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getCommentsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5044,9 +5045,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getCommentsForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5057,9 +5058,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = getCommentsForOneTransaction(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -5074,10 +5075,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val randomComment = PostTransactionCommentJSON(randomString(20)) val postReply = postCommentForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomComment, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[TransactionCommentJSON] - And("the comment must be added") + And("the comment should be added") val getReply = getCommentsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val theCommentsAfterThePost = getReply.body.extract[TransactionCommentsJSON].comments val theComment = theCommentsAfterThePost.find(_.value == randomComment.value) @@ -5095,11 +5096,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomComment = PostTransactionCommentJSON(randomString(20)) When("the request is sent") val postReply = postCommentForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomComment, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the comment must not be added") + And("the comment should not be added") val getReply = getCommentsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val theCommentsAfterThePost = getReply.body.extract[TransactionCommentsJSON].comments val notFound = theCommentsAfterThePost.find(_.value == randomComment.value) match { @@ -5119,11 +5120,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomComment = PostTransactionCommentJSON(randomString(20)) When("the request is sent") val postReply = postCommentForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomComment, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the comment must not be added") + And("the comment should not be added") val getReply = getCommentsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val theCommentsAfterThePost = getReply.body.extract[TransactionCommentsJSON].comments val notFound = theCommentsAfterThePost.find(_.value == randomComment.value) match { @@ -5142,11 +5143,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomComment = PostTransactionCommentJSON(randomString(20)) When("the request is sent") val postReply = postCommentForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, randomComment, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the comment must not be added") + And("the comment should not be added") val getReply = getCommentsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val theCommentsAfterThePost = getReply.body.extract[TransactionCommentsJSON].comments val notFound = theCommentsAfterThePost.find(_.value == randomComment.value) match { @@ -5164,9 +5165,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomComment = PostTransactionCommentJSON(randomString(20)) When("the request is sent") val postReply = postCommentForOneTransaction(bankId, bankAccount.id, view, randomString(5), randomComment, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -5183,7 +5184,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val postedComment = postedReply.body.extract[TransactionCommentJSON] When("the delete request is sent") val deleteReply = deleteCommentForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedComment.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) } @@ -5198,7 +5199,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val postedComment = postedReply.body.extract[TransactionCommentJSON] When("the delete request is sent") val deleteReply = deleteCommentForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedComment.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -5213,7 +5214,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val postedComment = postedReply.body.extract[TransactionCommentJSON] When("the delete request is sent") val deleteReply = deleteCommentForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedComment.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -5228,7 +5229,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val postedComment = postedReply.body.extract[TransactionCommentJSON] When("the delete request is sent") val deleteReply = deleteCommentForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedComment.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -5240,7 +5241,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the delete request is sent") val deleteReply = deleteCommentForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -5255,7 +5256,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val postedComment = postedReply.body.extract[TransactionCommentJSON] When("the delete request is sent") val deleteReply = deleteCommentForOneTransaction(bankId, bankAccount.id, view, randomString(5), postedComment.id, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -5270,7 +5271,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val postedComment = postedReply.body.extract[TransactionCommentJSON] When("the delete request is sent") val deleteReply = deleteCommentForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, postedComment.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") deleteReply.code must equal (404) } } @@ -5284,7 +5285,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTagsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) reply.body.extract[TransactionTagsJSON] } @@ -5297,9 +5298,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTagsForOneTransaction(bankId, bankAccount.id, view, transaction.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5311,9 +5312,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTagsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5325,9 +5326,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTagsForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5338,9 +5339,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = getTagsForOneTransaction(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -5355,10 +5356,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val randomTag = PostTransactionTagJSON(randomString(5)) val postReply = postTagForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomTag, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[TransactionTagJSON] - And("the tag must be added") + And("the tag should be added") val getReply = getTagsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val theTagsAfterThePost = getReply.body.extract[TransactionTagsJSON].tags val theTag = theTagsAfterThePost.find(_.value == randomTag.value) @@ -5375,11 +5376,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomTag = PostTransactionTagJSON(randomString(5)) When("the request is sent") val postReply = postTagForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomTag, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the tag must not be added") + And("the tag should not be added") val getReply = getTagsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val theTagsAfterThePost = getReply.body.extract[TransactionTagsJSON].tags val notFound = theTagsAfterThePost.find(_.value == randomTag.value) match { @@ -5398,11 +5399,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomTag = PostTransactionTagJSON(randomString(5)) When("the request is sent") val postReply = postTagForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomTag, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the tag must not be added") + And("the tag should not be added") val getReply = getTagsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val theTagsAfterThePost = getReply.body.extract[TransactionTagsJSON].tags val notFound = theTagsAfterThePost.find(_.value == randomTag.value) match { @@ -5421,11 +5422,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomTag = PostTransactionTagJSON(randomString(5)) When("the request is sent") val postReply = postTagForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, randomTag, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the tag must not be added") + And("the tag should not be added") val getReply = getTagsForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val theTagsAfterThePost = getReply.body.extract[TransactionTagsJSON].tags val notFound = theTagsAfterThePost.find(_.value == randomTag.value) match { @@ -5443,9 +5444,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomTag = PostTransactionTagJSON(randomString(5)) When("the request is sent") val postReply = postTagForOneTransaction(bankId, bankAccount.id, view, randomString(5), randomTag, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -5462,7 +5463,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val postedTag = postedReply.body.extract[TransactionTagJSON] When("the delete request is sent") val deleteReply = deleteTagForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedTag.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) } @@ -5477,7 +5478,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val postedTag = postedReply.body.extract[TransactionTagJSON] When("the delete request is sent") val deleteReply = deleteTagForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedTag.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -5492,7 +5493,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val postedTag = postedReply.body.extract[TransactionTagJSON] When("the delete request is sent") val deleteReply = deleteTagForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedTag.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -5507,7 +5508,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val postedTag = postedReply.body.extract[TransactionTagJSON] When("the delete request is sent") val deleteReply = deleteTagForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedTag.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -5519,7 +5520,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the delete request is sent") val deleteReply = deleteTagForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -5534,7 +5535,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val postedTag = postedReply.body.extract[TransactionTagJSON] When("the delete request is sent") val deleteReply = deleteTagForOneTransaction(bankId, bankAccount.id, view, randomString(5), postedTag.id, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -5549,7 +5550,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val postedTag = postedReply.body.extract[TransactionTagJSON] When("the delete request is sent") val deleteReply = deleteTagForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, postedTag.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") deleteReply.code must equal (404) } } @@ -5563,7 +5564,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getImagesForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) reply.body.extract[TransactionImagesJSON] } @@ -5576,9 +5577,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getImagesForOneTransaction(bankId, bankAccount.id, view, transaction.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5590,9 +5591,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getImagesForOneTransaction(bankId, bankAccount.id, view, transaction.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5604,9 +5605,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getImagesForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5617,9 +5618,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = getImagesForOneTransaction(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -5634,10 +5635,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val randomImage = PostTransactionImageJSON(randomString(5),"http://www.mysuperimage.com") val postReply = postImageForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomImage, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[TransactionImageJSON] - And("the image must be added") + And("the image should be added") val getReply = getImagesForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val theImagesAfterThePost = getReply.body.extract[TransactionImagesJSON].images val theImage = theImagesAfterThePost.find(_.URL == randomImage.URL) @@ -5654,11 +5655,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomImage = PostTransactionImageJSON(randomString(5),"http://www.mysuperimage.com/"+randomString(5)) When("the request is sent") val postReply = postImageForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomImage, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the image must not be added") + And("the image should not be added") val getReply = getImagesForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val theImagesAfterThePost = getReply.body.extract[TransactionImagesJSON].images val notFound = theImagesAfterThePost.find(_.URL == randomImage.URL) match { @@ -5677,11 +5678,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomImage = PostTransactionImageJSON(randomString(5),"http://www.mysuperimage.com") When("the request is sent") val postReply = postImageForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomImage, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the image must not be added") + And("the image should not be added") val getReply = getImagesForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val theImagesAfterThePost = getReply.body.extract[TransactionImagesJSON].images val notFound = theImagesAfterThePost.find(_.URL == randomImage.URL) match { @@ -5700,11 +5701,11 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomImage = PostTransactionImageJSON(randomString(5),"http://www.mysuperimage.com") When("the request is sent") val postReply = postImageForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, randomImage, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) - And("the image must not be added") + And("the image should not be added") val getReply = getImagesForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) val theImagesAfterThePost = getReply.body.extract[TransactionImagesJSON].images val notFound = theImagesAfterThePost.find(_.URL == randomImage.URL) match { @@ -5722,9 +5723,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomImage = PostTransactionImageJSON(randomString(5),"http://www.mysuperimage.com") When("the request is sent") val postReply = postImageForOneTransaction(bankId, bankAccount.id, view, randomString(5), randomImage, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -5741,7 +5742,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val postedImage = postedReply.body.extract[TransactionImageJSON] When("the delete request is sent") val deleteReply = deleteImageForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedImage.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) } @@ -5756,7 +5757,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val postedImage = postedReply.body.extract[TransactionImageJSON] When("the delete request is sent") val deleteReply = deleteImageForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedImage.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -5771,7 +5772,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val postedImage = postedReply.body.extract[TransactionImageJSON] When("the delete request is sent") val deleteReply = deleteImageForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedImage.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -5786,7 +5787,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val postedImage = postedReply.body.extract[TransactionImageJSON] When("the delete request is sent") val deleteReply = deleteImageForOneTransaction(bankId, bankAccount.id, view, transaction.id, postedImage.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -5798,7 +5799,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the delete request is sent") val deleteReply = deleteImageForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -5813,7 +5814,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val postedImage = postedReply.body.extract[TransactionImageJSON] When("the delete request is sent") val deleteReply = deleteImageForOneTransaction(bankId, bankAccount.id, view, randomString(5), postedImage.id, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -5828,7 +5829,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val postedImage = postedReply.body.extract[TransactionImageJSON] When("the delete request is sent") val deleteReply = deleteImageForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, postedImage.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") deleteReply.code must equal (404) } } @@ -5844,7 +5845,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) When("the request is sent") val reply = getWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) } @@ -5858,9 +5859,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) When("the request is sent") val reply = getWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5874,9 +5875,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) When("the request is sent") val reply = getWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5890,9 +5891,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) When("the request is sent") val reply = getWhereForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5903,9 +5904,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = getWhereForOneTransaction(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -5920,10 +5921,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the request is sent") val postReply = postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") postReply.code must equal (201) postReply.body.extract[SuccessMessage] - And("the where must be posted") + And("the where should be posted") val location = getWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1).body.extract[TransactionWhereJSON] randomLoc.latitude must equal (location.where.latitude) randomLoc.longitude must equal (location.where.longitude) @@ -5939,9 +5940,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser var randomLoc = JSONFactory.createLocationPlainJSON(400,200) When("the request is sent") val postReply = postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5954,9 +5955,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the request is sent") val postReply = postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, None) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5969,9 +5970,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the request is sent") val postReply = postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5984,9 +5985,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the request is sent") val postReply = postWhereForOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, randomLoc, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") postReply.code must equal (404) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -5998,9 +5999,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the request is sent") val postReply = postWhereForOneTransaction(bankId, bankAccount.id, view, randomString(5), randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") postReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") postReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -6015,10 +6016,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser When("the request is sent") val randomLoc = randomLocation val putReply = updateWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") putReply.code must equal (200) putReply.body.extract[SuccessMessage] - And("the where must be changed") + And("the where should be changed") val location = getWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1).body.extract[TransactionWhereJSON] randomLoc.latitude must equal (location.where.latitude) randomLoc.longitude must equal (location.where.longitude) @@ -6033,9 +6034,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser var randomLoc = JSONFactory.createLocationPlainJSON(400,200) When("the request is sent") val putReply = updateWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -6048,9 +6049,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser var randomLoc = randomLocation When("the request is sent") val putReply = updateWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, None) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -6063,9 +6064,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the request is sent") val putReply = updateWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -6077,9 +6078,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the request is sent") val putReply = updateWhereForOneTransaction(bankId, bankAccount.id, view, randomString(5), randomLoc, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") putReply.code must equal (400) - And("we must get an error message") + And("We should get an error message") putReply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -6095,9 +6096,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) When("the delete request is sent") val deleteReply = deleteWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) - Then("we must get a 204 code") + Then("We should get a 204 code") deleteReply.code must equal (204) - And("the where must be null") + And("the where should be null") val locationAfterDelete = getWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, user1).body.extract[TransactionWhereJSON] locationAfterDelete.where must equal (null) } @@ -6112,9 +6113,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) When("the delete request is sent") val deleteReply = deleteWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - // And("the where must not be null") + // And("the where should not be null") } scenario("we will not delete the where for a random transaction because the user does not have enough privileges", API1_2, DeleteWhere) { @@ -6127,9 +6128,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) When("the delete request is sent") val deleteReply = deleteWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) - // And("the where must not be null") + // And("the where should not be null") } scenario("we will not delete the where for one random transaction because the user did not post the geo tag", API1_2, DeleteWhere) { @@ -6142,7 +6143,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser postWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, randomLoc, user1) When("the delete request is sent") val deleteReply = deleteWhereForOneTransaction(bankId, bankAccount.id, view, transaction.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } @@ -6154,7 +6155,7 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val randomLoc = randomLocation When("the delete request is sent") val deleteReply = deleteWhereForOneTransaction(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") deleteReply.code must equal (400) } } @@ -6168,10 +6169,10 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTheCounterpartyOfOneTransaction(bankId, bankAccount.id, view, transaction.id, user1) - Then("we must get a 200 code") + Then("We should get a 200 code") reply.code must equal (200) val accountJson = reply.body.extract[OtherAccountJSON] - And("some fields must not be empty") + And("some fields should not be empty") accountJson.id.nonEmpty must equal (true) } @@ -6183,9 +6184,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTheCounterpartyOfOneTransaction(bankId, bankAccount.id, view, transaction.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -6197,9 +6198,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTheCounterpartyOfOneTransaction(bankId, bankAccount.id, view, transaction.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -6211,9 +6212,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val transaction = randomTransaction(bankId, bankAccount.id, view) When("the request is sent") val reply = getTheCounterpartyOfOneTransaction(bankId, bankAccount.id, randomString(5), transaction.id, user1) - Then("we must get a 404 code") + Then("We should get a 404 code") reply.code must equal (404) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -6224,9 +6225,9 @@ class API1_2_1Test extends User1AllPrivileges with DefaultUsers with PrivateUser val view = randomViewPermalink(bankId, bankAccount) When("the request is sent") val reply = getTheCounterparty(bankId, bankAccount.id, view, randomString(5), user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } diff --git a/src/test/scala/code/api/v1_3_0/PhysicalCardsTest.scala b/src/test/scala/code/api/v1_3_0/PhysicalCardsTest.scala index 216f20bdc..13df83d42 100644 --- a/src/test/scala/code/api/v1_3_0/PhysicalCardsTest.scala +++ b/src/test/scala/code/api/v1_3_0/PhysicalCardsTest.scala @@ -266,12 +266,12 @@ class PhysicalCardsTest extends ServerSetup with DefaultUsers with DefaultConne val request = (v1_3Request / "cards").GET <@(user1) val response = makeGetRequest(request) - Then("We must get a 200") + Then("We should get a 200") response.code must equal(200) - //dummy connector above tells us we must get back user1AllCards + //dummy connector above tells us We should get back user1AllCards //we are just testing that the api calls the connector properly - And("We must get the correct cards") + And("We should get the correct cards") val expectedCardNumbers = user1AllCards.map(_.bankCardNumber) val json = response.body.extract[PhysicalCardsJSON] val returnedCardNumbers = json.cards.map(_.bank_card_number) @@ -286,12 +286,12 @@ class PhysicalCardsTest extends ServerSetup with DefaultUsers with DefaultConne val request = (v1_3Request / "banks" / bank.bankId.value / "cards").GET <@(user1) val response = makeGetRequest(request) - Then("We must get a 200") + Then("We should get a 200") response.code must equal(200) - //dummy connector above tells us we must get back user1CardsForOneBank + //dummy connector above tells us We should get back user1CardsForOneBank //we are just testing that the api calls the connector properly - And("We must get the correct cards") + And("We should get the correct cards") val expectedCardNumbers = user1CardsForOneBank.map(_.bankCardNumber) val json = response.body.extract[PhysicalCardsJSON] diff --git a/src/test/scala/code/api/v1_4_0/AtmsTest.scala b/src/test/scala/code/api/v1_4_0/AtmsTest.scala index 2f4946b31..14c7402fb 100644 --- a/src/test/scala/code/api/v1_4_0/AtmsTest.scala +++ b/src/test/scala/code/api/v1_4_0/AtmsTest.scala @@ -117,7 +117,7 @@ class AtmsTest extends V140ServerSetup with DefaultUsers { val request = (v1_4Request / "banks" / BankWithoutLicense.value / "atms").GET <@ user1 val response = makeGetRequest(request) - Then("We must get a 200") + Then("We should get a 200") response.code must equal(200) } @@ -127,17 +127,17 @@ class AtmsTest extends V140ServerSetup with DefaultUsers { val request = (v1_4Request / "banks" / BankWithLicense.value / "atms").GET <@ user1 val response = makeGetRequest(request) - Then("We must get a 200") + Then("We should get a 200") response.code must equal(200) - And("We must get the right json format containing a list of ATMs") + And("We should get the right json format containing a list of ATMs") val wholeResponseBody = response.body val responseBodyOpt = wholeResponseBody.extractOpt[AtmsJson] responseBodyOpt.isDefined must equal(true) val responseBody = responseBodyOpt.get - And("We must get the right atms") + And("We should get the right atms") val atms = responseBody.atms // Order of ATMs in the list is arbitrary diff --git a/src/test/scala/code/api/v1_4_0/BranchesTest.scala b/src/test/scala/code/api/v1_4_0/BranchesTest.scala index c3faa61c2..305908713 100644 --- a/src/test/scala/code/api/v1_4_0/BranchesTest.scala +++ b/src/test/scala/code/api/v1_4_0/BranchesTest.scala @@ -146,7 +146,7 @@ class BranchesTest extends V140ServerSetup with DefaultUsers { val request = (v1_4Request / "banks" / BankWithoutLicense.value / "branches").GET <@(user1) val response = makeGetRequest(request) - Then("We must get a 200") + Then("We should get a 200") response.code must equal(200) } @@ -155,17 +155,17 @@ class BranchesTest extends V140ServerSetup with DefaultUsers { val request = (v1_4Request / "banks" / BankWithLicense.value / "branches").GET <@(user1) val response = makeGetRequest(request) - Then("We must get a 200") + Then("We should get a 200") response.code must equal(200) - And("We must get the right json format containing a list of Branches") + And("We should get the right json format containing a list of Branches") val wholeResponseBody = response.body val responseBodyOpt = wholeResponseBody.extractOpt[BranchesJson] responseBodyOpt.isDefined must equal(true) val responseBody = responseBodyOpt.get - And("We must get the right branches") + And("We should get the right branches") val branches = responseBody.branches // Order of branches in the list is arbitrary diff --git a/src/test/scala/code/api/v1_4_0/CustomerTest.scala b/src/test/scala/code/api/v1_4_0/CustomerTest.scala index 452dfccca..c5d25587c 100644 --- a/src/test/scala/code/api/v1_4_0/CustomerTest.scala +++ b/src/test/scala/code/api/v1_4_0/CustomerTest.scala @@ -57,34 +57,34 @@ class CustomerTest extends V200ServerSetup with DefaultUsers { UserCustomerLink.userCustomerLink.vend.getUserCustomerLinkByUserId(customerPostJSON1.user_id).size must equal(0) val requestPost = (v1_4Request / "banks" / mockBankId1.value / "customer").POST <@ (user1) val responsePost = makePostRequest(requestPost, write(customerPostJSON1)) - Then("We must get a 400") + Then("We should get a 400") responsePost.code must equal(400) When("We add one required entitlement") Entitlement.entitlement.vend.addEntitlement(mockBankId1.value, resourceUser1.userId, ApiRole.CanCreateCustomer.toString) val responsePost1Entitlement = makePostRequest(requestPost, write(customerPostJSON1)) - Then("We must get a 400") + Then("We should get a 400") responsePost1Entitlement.code must equal(400) When("We add all required entitlement") Entitlement.entitlement.vend.addEntitlement(mockBankId1.value, resourceUser1.userId, ApiRole.CanCreateUserCustomerLink.toString) val responsePost2Entitlement = makePostRequest(requestPost, write(customerPostJSON1)) - Then("We must get a 200") + Then("We should get a 200") responsePost2Entitlement.code must equal(200) - And("We must get the right information back") + And("We should get the right information back") val infoPost = responsePost2Entitlement.body.extract[CustomerJsonV140] When("We make the request") val requestGet = (v1_4Request / "banks" / mockBankId1.value / "customer").GET <@ (user1) val responseGet = makeGetRequest(requestGet) - Then("We must get a 200") + Then("We should get a 200") responseGet.code must equal(200) - And("We must get the right information back") + And("We should get the right information back") val infoGet = responseGet.body.extract[CustomerJsonV140] - And("POST feedback and GET feedback must be the same") + And("POST feedback and GET feedback should be the same") infoGet must equal(infoPost) And("User is linked to 1 customer") @@ -93,10 +93,10 @@ class CustomerTest extends V200ServerSetup with DefaultUsers { When("We try to make the second request with same customer number at same bank") val secondResponsePost = makePostRequest(requestPost, write(customerPostJSON1)) - Then("We must get a 400") + Then("We should get a 400") secondResponsePost.code must equal(400) val error = for { JObject(o) <- secondResponsePost.body; JField("error", JString(error)) <- o } yield error - And("We must get a message: " + ErrorMessages.CustomerNumberAlreadyExists) + And("We should get a message: " + ErrorMessages.CustomerNumberAlreadyExists) error must contain (ErrorMessages.CustomerNumberAlreadyExists) And("User is linked to 1 customer") UserCustomerLink.userCustomerLink.vend.getUserCustomerLinkByUserId(customerPostJSON1.user_id).size must equal(1) @@ -105,7 +105,7 @@ class CustomerTest extends V200ServerSetup with DefaultUsers { val customerPostJSON2 = createCustomerJson(mockCustomerNumber2) val requestPost2 = (v1_4Request / "banks" / mockBankId1.value / "customer").POST <@ (user1) val responsePost2 = makePostRequest(requestPost2, write(customerPostJSON2)) - Then("We must get a 200") + Then("We should get a 200") responsePost2.code must equal(200) And("User is linked to 2 customers") UserCustomerLink.userCustomerLink.vend.getUserCustomerLinkByUserId(customerPostJSON1.user_id).size must equal(2) @@ -117,17 +117,17 @@ class CustomerTest extends V200ServerSetup with DefaultUsers { val customerPostJSON3 = createCustomerJson(mockCustomerNumber1) val requestPost3 = (v1_4Request / "banks" / mockBankId2.value / "customer").POST <@ (user1) val responsePost3 = makePostRequest(requestPost3, write(customerPostJSON3)) - Then("We must get a 200") + Then("We should get a 200") responsePost3.code must equal(200) And("User is linked to 3 customers") UserCustomerLink.userCustomerLink.vend.getUserCustomerLinkByUserId(customerPostJSON1.user_id).size must equal(3) When("We try to make the second request with same customer number at same bank") val secondResponsePost3 = makePostRequest(requestPost3, write(customerPostJSON3)) - Then("We must get a 400") + Then("We should get a 400") secondResponsePost3.code must equal(400) val error3 = for { JObject(o) <- secondResponsePost3.body; JField("error", JString(error)) <- o } yield error - And("We must get a message: " + ErrorMessages.CustomerNumberAlreadyExists) + And("We should get a message: " + ErrorMessages.CustomerNumberAlreadyExists) error3 must contain (ErrorMessages.CustomerNumberAlreadyExists) And("User is linked to 3 customers") UserCustomerLink.userCustomerLink.vend.getUserCustomerLinkByUserId(customerPostJSON3.user_id).size must equal(3) diff --git a/src/test/scala/code/api/v1_4_0/MappedCustomerMessagesTest.scala b/src/test/scala/code/api/v1_4_0/MappedCustomerMessagesTest.scala index 5632acd63..74db53949 100644 --- a/src/test/scala/code/api/v1_4_0/MappedCustomerMessagesTest.scala +++ b/src/test/scala/code/api/v1_4_0/MappedCustomerMessagesTest.scala @@ -30,10 +30,10 @@ class MappedCustomerMessagesTest extends V140ServerSetup with DefaultUsers { val request = (v1_4Request / "banks" / mockBankId1.value / "customer" / "messages").GET <@ user1 val response = makeGetRequest(request) - Then("We must get a 200") + Then("We should get a 200") response.code must equal(200) - And("We must get no messages") + And("We should get no messages") val json = response.body.extract[CustomerMessagesJson] json.messages.size must equal(0) } @@ -73,7 +73,7 @@ class MappedCustomerMessagesTest extends V140ServerSetup with DefaultUsers { request = (v1_4Request / "banks" / mockBankId1.value / "customer" / customerId / "messages").POST <@ user1 val messageJson = AddCustomerMessageJson("some message", "some department", "some person") response = makePostRequest(request, write(messageJson)) - Then("We must get a 201") + Then("We should get a 201") response.code must equal(201) And("We should get that message when we do a get messages request ") diff --git a/src/test/scala/code/api/v1_4_0/ProductsTest.scala b/src/test/scala/code/api/v1_4_0/ProductsTest.scala index 2d9002ce7..b1597d743 100644 --- a/src/test/scala/code/api/v1_4_0/ProductsTest.scala +++ b/src/test/scala/code/api/v1_4_0/ProductsTest.scala @@ -105,7 +105,7 @@ class ProductsTest extends ServerSetup with DefaultUsers with V140ServerSetup { val request = (v1_4Request / "banks" / BankWithoutLicense.value / "products").GET <@(user1) val response = makeGetRequest(request) - Then("We must get a 200") + Then("We should get a 200") response.code must equal(200) } @@ -115,17 +115,17 @@ class ProductsTest extends ServerSetup with DefaultUsers with V140ServerSetup { val request = (v1_4Request / "banks" / BankWithLicense.value / "products").GET <@(user1) val response = makeGetRequest(request) - Then("We must get a 200") + Then("We should get a 200") response.code must equal(200) - And("We must get the right json format containing a list of products") + And("We should get the right json format containing a list of products") val wholeResponseBody = response.body val responseBodyOpt = wholeResponseBody.extractOpt[ProductsJson] responseBodyOpt.isDefined must equal(true) val responseBody = responseBodyOpt.get - And("We must get the right products") + And("We should get the right products") val products = responseBody.products // Order of Products in the list is arbitrary diff --git a/src/test/scala/code/api/v1_4_0/TransactionRequestsTest.scala b/src/test/scala/code/api/v1_4_0/TransactionRequestsTest.scala index 211eae1ee..fc9238982 100644 --- a/src/test/scala/code/api/v1_4_0/TransactionRequestsTest.scala +++ b/src/test/scala/code/api/v1_4_0/TransactionRequestsTest.scala @@ -74,7 +74,7 @@ class TransactionRequestsTest extends V140ServerSetup with DefaultUsers { var request = (v1_4Request / "banks" / testBank.bankId.value / "accounts" / fromAccount.accountId.value / "owner" / "transaction-request-types" / "SANDBOX_TAN" / "transaction-requests").POST <@(user1) var response = makePostRequest(request, write(transactionRequestBody)) - Then("we must get a 201 created code") + Then("We should get a 201 created code") response.code must equal(201) //created a transaction request, check some return values. As type is SANDBOX_TAN, we expect no challenge @@ -82,7 +82,7 @@ class TransactionRequestsTest extends V140ServerSetup with DefaultUsers { case JString(i) => i case _ => "" } - Then("We must have some new transaction id") + Then("We should have some new transaction id") transId must not equal ("") val status: String = (response.body \ "status") match { @@ -105,7 +105,7 @@ class TransactionRequestsTest extends V140ServerSetup with DefaultUsers { "owner" / "transaction-requests").GET <@(user1) response = makeGetRequest(request) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") response.code must equal(200) val transactionRequests = response.body.children transactionRequests.size must not equal(0) @@ -126,7 +126,7 @@ class TransactionRequestsTest extends V140ServerSetup with DefaultUsers { "owner" / "transactions").GET <@(user1) response = makeGetRequest(request) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") response.code must equal(200) val transactions = response.body.children @@ -143,19 +143,19 @@ class TransactionRequestsTest extends V140ServerSetup with DefaultUsers { //(do it here even though the payments test does test makePayment already) val fromAccountBalance = getFromAccount.balance - And("the from account must have a balance smaller by the amount specified to pay") + And("the from account should have a balance smaller by the amount specified to pay") fromAccountBalance must equal((beforeFromBalance - amt)) /* - And("the newest transaction for the account receiving the payment must have the proper amount") + And("the newest transaction for the account receiving the payment should have the proper amount") newestToAccountTransaction.details.value.amount must equal(amt.toString) */ - And("the account receiving the payment must have a new balance plus the amount paid") + And("the account receiving the payment should have a new balance plus the amount paid") val toAccountBalance = getToAccount.balance toAccountBalance must equal(beforeToBalance + amt) - And("there must now be 2 new transactions in the database (one for the sender, one for the receiver") + And("there should now be 2 new transactions in the database (one for the sender, one for the receiver") transactionCount(fromAccount, toAccount) must equal(totalTransactionsBefore + 2) } } @@ -204,7 +204,7 @@ class TransactionRequestsTest extends V140ServerSetup with DefaultUsers { var request = (v1_4Request / "banks" / testBank.bankId.value / "accounts" / fromAccount.accountId.value / "owner" / "transaction-request-types" / "SANDBOX_TAN" / "transaction-requests").POST <@ (user1) var response = makePostRequest(request, write(transactionRequestBody)) - Then("we must get a 201 created code") + Then("We should get a 201 created code") response.code must equal(201) //ok, created a transaction request, check some return values. As type is SANDBOX_TAN but over 100€, we expect a challenge @@ -240,7 +240,7 @@ class TransactionRequestsTest extends V140ServerSetup with DefaultUsers { "owner" / "transaction-requests").GET <@ (user1) response = makeGetRequest(request) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") response.code must equal(200) var transactionRequests = response.body.children @@ -260,7 +260,7 @@ class TransactionRequestsTest extends V140ServerSetup with DefaultUsers { request = (v1_4Request / "banks" / testBank.bankId.value / "accounts" / fromAccount.accountId.value / "owner" / "transaction-request-types" / "SANDBOX_TAN" / "transaction-requests" / transId / "challenge").POST <@ (user1) response = makePostRequest(request, write(answerJson)) - Then("we must get a 400 bad request code") + Then("We should get a 400 bad request code") response.code must equal(400) //TODO: check if allowed_attempts is decreased @@ -270,7 +270,7 @@ class TransactionRequestsTest extends V140ServerSetup with DefaultUsers { request = (v1_4Request / "banks" / testBank.bankId.value / "accounts" / fromAccount.accountId.value / "owner" / "transaction-request-types" / "SANDBOX_TAN" / "transaction-requests" / transId / "challenge").POST <@ (user1) response = makePostRequest(request, write(answerJson)) - Then("we must get a 202 accepted code") + Then("We should get a 202 accepted code") response.code must equal(202) //check if returned data includes new transaction's id @@ -291,7 +291,7 @@ class TransactionRequestsTest extends V140ServerSetup with DefaultUsers { "owner" / "transaction-requests").GET <@ (user1) response = makeGetRequest(request) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") response.code must equal(200) transactionRequests = response.body.children @@ -309,19 +309,19 @@ class TransactionRequestsTest extends V140ServerSetup with DefaultUsers { //(do it here even though the payments test does test makePayment already) val fromAccountBalance = getFromAccount.balance - And("the from account must have a balance smaller by the amount specified to pay") + And("the from account should have a balance smaller by the amount specified to pay") fromAccountBalance must equal((beforeFromBalance - amt)) /* - And("the newest transaction for the account receiving the payment must have the proper amount") + And("the newest transaction for the account receiving the payment should have the proper amount") newestToAccountTransaction.details.value.amount must equal(amt.toString) */ - And("the account receiving the payment must have a new balance plus the amount paid") + And("the account receiving the payment should have a new balance plus the amount paid") val toAccountBalance = getToAccount.balance toAccountBalance must equal(beforeToBalance + amt) - And("there must now be 2 new transactions in the database (one for the sender, one for the receiver") + And("there should now be 2 new transactions in the database (one for the sender, one for the receiver") transactionCount(fromAccount, toAccount) must equal(totalTransactionsBefore + 2) } } @@ -357,13 +357,13 @@ class TransactionRequestsTest extends V140ServerSetup with DefaultUsers { val payJson = MakePaymentJson(toAccount.bankId.value, toAccount.accountId.value, amt.toString) val postResult = postTransaction(fromAccount.bankId.value, fromAccount.accountId.value, view, payJson, user2) - Then("we must get a 400") + Then("We should get a 400") postResult.code must equal(400) - And("the number of transactions for each account must remain unchanged") + And("the number of transactions for each account should remain unchanged") totalTransactionsBefore must equal(transactionCount(fromAccount, toAccount)) - And("the balances of each account must remain unchanged") + And("the balances of each account should remain unchanged") beforeFromBalance must equal(getFromAccount.balance) beforeToBalance must equal(getToAccount.balance) } @@ -397,13 +397,13 @@ class TransactionRequestsTest extends V140ServerSetup with DefaultUsers { val payJson = MakePaymentJson(toAccount.bankId.value, toAccount.accountId.value, amt.toString) val postResult = postTransaction(fromAccount.bankId.value, fromAccount.accountId.value, view, payJson, None) - Then("we must get a 400") + Then("We should get a 400") postResult.code must equal(400) - And("the number of transactions for each account must remain unchanged") + And("the number of transactions for each account should remain unchanged") totalTransactionsBefore must equal(transactionCount(fromAccount, toAccount)) - And("the balances of each account must remain unchanged") + And("the balances of each account should remain unchanged") beforeFromBalance must equal(getFromAccount.balance) beforeToBalance must equal(getToAccount.balance) } @@ -439,13 +439,13 @@ class TransactionRequestsTest extends V140ServerSetup with DefaultUsers { val payJson = MakePaymentJson(toAccount.bankId.value, toAccount.accountId.value, amt.toString) val postResult = postTransaction(fromAccount.bankId.value, fromAccount.accountId.value, view, payJson, user1) - Then("we must get a 400") + Then("We should get a 400") postResult.code must equal(400) - And("the number of transactions for each account must remain unchanged") + And("the number of transactions for each account should remain unchanged") totalTransactionsBefore must equal(transactionCount(fromAccount, toAccount)) - And("the balances of each account must remain unchanged") + And("the balances of each account should remain unchanged") beforeFromBalance must equal(getFromAccount.balance) beforeToBalance must equal(getToAccount.balance) } @@ -482,13 +482,13 @@ class TransactionRequestsTest extends V140ServerSetup with DefaultUsers { val payJson = MakePaymentJson(toAccount.bankId.value, toAccount.accountId.value, amt.toString) val postResult = postTransaction(fromAccount.bankId.value, fromAccount.accountId.value, view, payJson, user1) - Then("we must get a 400") + Then("We should get a 400") postResult.code must equal(400) - And("the number of transactions for each account must remain unchanged") + And("the number of transactions for each account should remain unchanged") totalTransactionsBefore must equal(transactionCount(fromAccount, toAccount)) - And("the balances of each account must remain unchanged") + And("the balances of each account should remain unchanged") beforeFromBalance must equal(getFromAccount.balance) beforeToBalance must equal(getToAccount.balance) } @@ -517,13 +517,13 @@ class TransactionRequestsTest extends V140ServerSetup with DefaultUsers { val payJson = MakePaymentJson(bankId.value, "ACCOUNTTHATDOESNOTEXIST232321321", amt.toString) val postResult = postTransaction(fromAccount.bankId.value, fromAccount.accountId.value, view, payJson, user1) - Then("we must get a 400") + Then("We should get a 400") postResult.code must equal(400) - And("the number of transactions for the sender's account must remain unchanged") + And("the number of transactions for the sender's account should remain unchanged") totalTransactionsBefore must equal(transactionCount(fromAccount)) - And("the balance of the sender's account must remain unchanged") + And("the balance of the sender's account should remain unchanged") beforeFromBalance must equal(getFromAccount.balance) } @@ -557,13 +557,13 @@ class TransactionRequestsTest extends V140ServerSetup with DefaultUsers { val payJson = MakePaymentJson(toAccount.bankId.value, toAccount.accountId.value, amt.toString) val postResult = postTransaction(fromAccount.bankId.value, fromAccount.accountId.value, view, payJson, user1) - Then("we must get a 400") + Then("We should get a 400") postResult.code must equal(400) - And("the number of transactions for each account must remain unchanged") + And("the number of transactions for each account should remain unchanged") totalTransactionsBefore must equal(transactionCount(fromAccount, toAccount)) - And("the balances of each account must remain unchanged") + And("the balances of each account should remain unchanged") beforeFromBalance must equal(getFromAccount.balance) beforeToBalance must equal(getToAccount.balance) } */ diff --git a/src/test/scala/code/api/v2_0_0/AccountTest.scala b/src/test/scala/code/api/v2_0_0/AccountTest.scala index 01e93f0b6..61e2bba35 100644 --- a/src/test/scala/code/api/v2_0_0/AccountTest.scala +++ b/src/test/scala/code/api/v2_0_0/AccountTest.scala @@ -23,14 +23,14 @@ class AccountTest extends V200ServerSetup with DefaultUsers { val requestPut = (v2_0Request / "banks" / testBank.value / "accounts" / mockAccountId1).PUT <@ (user1) val responsePut = makePutRequest(requestPut, write(accountPutJSON)) - And("We must get a 200") + And("We should get a 200") responsePut.code must equal(200) When("We make the anonymous access request") val requestGet = (v2_0Request / "accounts").GET val responseGet = makeGetRequest(requestGet) - Then("We must get a 200") + Then("We should get a 200") responseGet.code must equal(200) val isPublic: List[Boolean] = @@ -47,7 +47,7 @@ class AccountTest extends V200ServerSetup with DefaultUsers { val requestGetAll = (v2_0Request / "accounts").GET <@ (user1) val responseGetAll = makeGetRequest(requestGetAll) - Then("We must get a 200") + Then("We should get a 200") responseGetAll.code must equal(200) val isPublicAll = @@ -71,14 +71,14 @@ class AccountTest extends V200ServerSetup with DefaultUsers { val requestPut = (v2_0Request / "banks" / testBank.value / "accounts" / mockAccountId1).PUT <@ (user1) val responsePut = makePutRequest(requestPut, write(accountPutJSON)) - And("We must get a 200") + And("We should get a 200") responsePut.code must equal(200) When("We make the anonymous access request") val requestGet = (v2_0Request / "banks" / testBank.value / "accounts").GET val responseGet = makeGetRequest(requestGet) - Then("We must get a 200") + Then("We should get a 200") responseGet.code must equal(200) val isPublic: List[Boolean] = @@ -95,7 +95,7 @@ class AccountTest extends V200ServerSetup with DefaultUsers { val requestGetAll = (v2_0Request / "banks" / testBank.value / "accounts").GET <@ (user1) val responseGetAll = makeGetRequest(requestGetAll) - Then("We must get a 200") + Then("We should get a 200") responseGetAll.code must equal(200) val isPublicAll = @@ -120,14 +120,14 @@ class AccountTest extends V200ServerSetup with DefaultUsers { val requestPut = (v2_0Request / "banks" / testBank.value / "accounts" / newAccountIdWithSpaces).PUT <@ (user1) val responsePut = makePutRequest(requestPut, write(accountPutJSON)) - And("We must get a 400") + And("We should get a 400") responsePut.code must equal(400) - And("We must have the error massage") + And("We should have the error massage") val error: String = (responsePut.body \ "error") match { case JString(i) => i case _ => "" } - Then("We must have the error: " + ErrorMessages.InvalidAccountIdFormat) + Then("We should have the error: " + ErrorMessages.InvalidAccountIdFormat) error must equal(ErrorMessages.InvalidAccountIdFormat) } } diff --git a/src/test/scala/code/api/v2_0_0/CreateUserTest.scala b/src/test/scala/code/api/v2_0_0/CreateUserTest.scala index a2cd6afe9..3ebe4de88 100644 --- a/src/test/scala/code/api/v2_0_0/CreateUserTest.scala +++ b/src/test/scala/code/api/v2_0_0/CreateUserTest.scala @@ -79,7 +79,7 @@ class CreateUserTest extends V200ServerSetup with BeforeAndAfter { var request = (v2_0Request / "users").POST var response = makePostRequest(request, write(params)) - Then("we must get a 201 created code") + Then("We should get a 201 created code") response.code must equal(201) } @@ -88,7 +88,7 @@ class CreateUserTest extends V200ServerSetup with BeforeAndAfter { var request = directLoginRequest var response = makePostRequestAdditionalHeader(request, "", validHeaders) var token = "INVALID" - Then("we must get a 200 - OK and a token") + Then("We should get a 200 - OK and a token") response.code must equal(200) response.body match { case JObject(List(JField(name, JString(value)))) => @@ -103,7 +103,7 @@ class CreateUserTest extends V200ServerSetup with BeforeAndAfter { scenario("we login using OAuth as newly created user", CreateUser) { When("the request an OAuth token") val reply = getRequestToken(consumer, oob) - Then("we must get a 200 - OK and a token") + Then("We should get a 200 - OK and a token") reply.code must equal (200) val requestToken = extractToken(reply.body) requestToken.value.size must not equal (0) @@ -119,7 +119,7 @@ class CreateUserTest extends V200ServerSetup with BeforeAndAfter { val request = (v2_0Request / "users").POST val response = makePostRequest(request, write(params)) - Then("we must get a 409 created code") + Then("We should get a 409 created code") response.code must equal(409) } diff --git a/src/test/scala/code/api/v2_0_0/CustomerTest.scala b/src/test/scala/code/api/v2_0_0/CustomerTest.scala index 2d37ec05c..bec77731d 100644 --- a/src/test/scala/code/api/v2_0_0/CustomerTest.scala +++ b/src/test/scala/code/api/v2_0_0/CustomerTest.scala @@ -44,34 +44,34 @@ class CustomerTest extends V200ServerSetup with DefaultUsers { UserCustomerLink.userCustomerLink.vend.getUserCustomerLinkByUserId(customerPostJSON.user_id).size must equal(0) val requestPost = (v2_0Request / "banks" / mockBankId1.value / "customers").POST <@ (user1) val responsePost = makePostRequest(requestPost, write(customerPostJSON)) - Then("We must get a 400") + Then("We should get a 400") responsePost.code must equal(400) When("We add one required entitlement") Entitlement.entitlement.vend.addEntitlement(mockBankId1.value, resourceUser1.userId, ApiRole.CanCreateCustomer.toString) val responsePost1 = makePostRequest(requestPost, write(customerPostJSON)) - Then("We must get a 400") + Then("We should get a 400") responsePost1.code must equal(400) When("We add all required entitlement") Entitlement.entitlement.vend.addEntitlement(mockBankId1.value, resourceUser1.userId, ApiRole.CanCreateUserCustomerLink.toString) val responsePost2 = makePostRequest(requestPost, write(customerPostJSON)) - Then("We must get a 201") + Then("We should get a 201") responsePost2.code must equal(201) - And("We must get the right information back") + And("We should get the right information back") val infoPost = responsePost2.body.extract[CustomerJsonV140] When("We make the request") val requestGet = (v2_0Request / "banks" / mockBankId1.value / "customer").GET <@ (user1) val responseGet = makeGetRequest(requestGet) - Then("We must get a 200") + Then("We should get a 200") responseGet.code must equal(200) - And("We must get the right information back") + And("We should get the right information back") val infoGet = responseGet.body.extract[CustomerJsonV140] - And("POST feedback and GET feedback must be the same") + And("POST feedback and GET feedback should be the same") infoGet must equal(infoPost) And("User is linked to 1 customer") @@ -80,10 +80,10 @@ class CustomerTest extends V200ServerSetup with DefaultUsers { When("We try to make the second request with same customer number at same bank") val secondResponsePost = makePostRequest(requestPost, write(customerPostJSON)) - Then("We must get a 400") + Then("We should get a 400") secondResponsePost.code must equal(400) val error = for { JObject(o) <- secondResponsePost.body; JField("error", JString(error)) <- o } yield error - And("We must get a message: " + ErrorMessages.CustomerNumberAlreadyExists) + And("We should get a message: " + ErrorMessages.CustomerNumberAlreadyExists) error must contain (ErrorMessages.CustomerNumberAlreadyExists) And("User is linked to 1 customer") UserCustomerLink.userCustomerLink.vend.getUserCustomerLinkByUserId(customerPostJSON.user_id).size must equal(1) @@ -92,7 +92,7 @@ class CustomerTest extends V200ServerSetup with DefaultUsers { val customerPostJSON3 = createCustomerJson(mockCustomerNumber2) val requestPost3 = (v2_0Request / "banks" / mockBankId1.value / "customers").POST <@ (user1) val responsePost3 = makePostRequest(requestPost3, write(customerPostJSON3)) - Then("We must get a 201") + Then("We should get a 201") responsePost3.code must equal(201) And("User is linked to 2 customers") UserCustomerLink.userCustomerLink.vend.getUserCustomerLinkByUserId(customerPostJSON3.user_id).size must equal(2) @@ -104,17 +104,17 @@ class CustomerTest extends V200ServerSetup with DefaultUsers { val customerPostJSON4 = createCustomerJson(mockCustomerNumber1) val requestPost4 = (v2_0Request / "banks" / mockBankId2.value / "customers").POST <@ (user1) val responsePost4 = makePostRequest(requestPost4, write(customerPostJSON4)) - Then("We must get a 201") + Then("We should get a 201") responsePost4.code must equal(201) And("User is linked to 3 customers") UserCustomerLink.userCustomerLink.vend.getUserCustomerLinkByUserId(customerPostJSON4.user_id).size must equal(3) When("We try to make the second request with same customer number at same bank") val secondResponsePost4 = makePostRequest(requestPost4, write(customerPostJSON4)) - Then("We must get a 400") + Then("We should get a 400") secondResponsePost4.code must equal(400) val error4 = for { JObject(o) <- secondResponsePost4.body; JField("error", JString(error)) <- o } yield error - And("We must get a message: " + ErrorMessages.CustomerNumberAlreadyExists) + And("We should get a message: " + ErrorMessages.CustomerNumberAlreadyExists) error4 must contain (ErrorMessages.CustomerNumberAlreadyExists) And("User is linked to 3 customers") UserCustomerLink.userCustomerLink.vend.getUserCustomerLinkByUserId(customerPostJSON.user_id).size must equal(3) diff --git a/src/test/scala/code/api/v2_0_0/EntitlementTests.scala b/src/test/scala/code/api/v2_0_0/EntitlementTests.scala index 1cd8eaae2..88e9e4e6a 100644 --- a/src/test/scala/code/api/v2_0_0/EntitlementTests.scala +++ b/src/test/scala/code/api/v2_0_0/EntitlementTests.scala @@ -28,10 +28,10 @@ class EntitlementTests extends V200ServerSetup with DefaultUsers { When("We make the request") val requestGet = (v2_0Request / "users" / resourceUser1.userId / "entitlements").GET val responseGet = makeGetRequest(requestGet) - Then("We must get a 400") + Then("We should get a 400") responseGet.code must equal(400) val error = for { JObject(o) <- responseGet.body; JField("error", JString(error)) <- o } yield error - And("We must get a message: " + ErrorMessages.UserNotLoggedIn) + And("We should get a message: " + ErrorMessages.UserNotLoggedIn) error must contain (ErrorMessages.UserNotLoggedIn) } @@ -40,10 +40,10 @@ class EntitlementTests extends V200ServerSetup with DefaultUsers { When("We make the request") val requestGet = (v2_0Request / "users" / resourceUser1.userId / "entitlements").GET <@ (user1) val responseGet = makeGetRequest(requestGet) - Then("We must get a 400") + Then("We should get a 400") responseGet.code must equal(400) val error = for { JObject(o) <- responseGet.body; JField("error", JString(error)) <- o } yield error - And("We must get a message: " + s"$CanGetEntitlementsForAnyUserAtAnyBank entitlement required") + And("We should get a message: " + s"$CanGetEntitlementsForAnyUserAtAnyBank entitlement required") error must contain (UserDoesNotHaveRole + CanGetEntitlementsForAnyUserAtAnyBank) } @@ -53,7 +53,7 @@ class EntitlementTests extends V200ServerSetup with DefaultUsers { And("We make the request") val requestGet = (v2_0Request / "users" / resourceUser1.userId / "entitlements").GET <@ (user1) val responseGet = makeGetRequest(requestGet) - Then("We must get a 200") + Then("We should get a 200") responseGet.code must equal(200) } } diff --git a/src/test/scala/code/api/v2_0_0/TransactionRequestsTest.scala b/src/test/scala/code/api/v2_0_0/TransactionRequestsTest.scala index 6a417de50..18e3806f9 100644 --- a/src/test/scala/code/api/v2_0_0/TransactionRequestsTest.scala +++ b/src/test/scala/code/api/v2_0_0/TransactionRequestsTest.scala @@ -1,7 +1,8 @@ package code.api.v2_0_0 +import code.api.ErrorMessage import code.api.util.ErrorMessages -import code.api.{DefaultUsers, ErrorMessage, ServerSetupWithTestData} +import code.setup.{DefaultUsers, ServerSetupWithTestData} import code.api.util.APIUtil.OAuth._ import code.api.v1_2_1.AmountOfMoneyJsonV121 import code.api.v1_4_0.JSONFactory1_4_0.{ChallengeAnswerJSON, TransactionRequestAccountJsonV140} @@ -42,10 +43,10 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { val bankId = testBank.bankId val accountId1 = AccountId("__acc1") val accountId2 = AccountId("__acc2") - createAccountAndOwnerView(Some(authuser1), bankId, accountId1, "EUR") - createAccountAndOwnerView(Some(authuser1), bankId, accountId2, "EUR") + createAccountAndOwnerView(Some(resourceUser1), bankId, accountId1, "EUR") + createAccountAndOwnerView(Some(resourceUser1), bankId, accountId2, "EUR") - addEntitlement(bankId.value, authuser3.userId, CanCreateAnyTransactionRequest.toString) + addEntitlement(bankId.value, resourceUser3.userId, CanCreateAnyTransactionRequest.toString) Then("We add entitlement to user3") val hasEntitlement = code.api.util.APIUtil.hasEntitlement(bankId.value, resourceUser3.userId, CanCreateAnyTransactionRequest) hasEntitlement must equal(true) @@ -83,7 +84,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { var request = (v2_0Request / "banks" / testBank.bankId.value / "accounts" / fromAccount.accountId.value / "owner" / "transaction-request-types" / "SANDBOX_TAN" / "transaction-requests").POST <@(user3) var response = makePostRequest(request, write(transactionRequestBody)) - Then("we must get a 201 created code") + Then("We should get a 201 created code") response.code must equal(201) println(response.body) @@ -93,7 +94,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { case JString(i) => i case _ => "" } - Then("We must have some new transaction id") + Then("We should have some new transaction id") transRequestId must not equal ("") val responseBody = response.body @@ -105,7 +106,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { } status must equal (code.transactionrequests.TransactionRequests.STATUS_COMPLETED) - // Challenge must be null (none required) + // Challenge should be null (none required) var challenge = (response.body \ "challenge").children challenge.size must equal(0) @@ -121,7 +122,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { "owner" / "transaction-requests").GET <@(user1) response = makeGetRequest(request) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") response.code must equal(200) val transactionRequests = response.body.children transactionRequests.size must not equal(0) @@ -145,7 +146,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { "owner" / "transactions").GET <@(user1) response = makeGetRequest(request) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") response.code must equal(200) val transactions = response.body.children @@ -164,19 +165,19 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { val rate = fx.exchangeRate (fromAccount.currency, toAccount.currency) val convertedAmount = fx.convert(amt, rate) val fromAccountBalance = getFromAccount.balance - And("the from account must have a balance smaller by the amount specified to pay") + And("the from account should have a balance smaller by the amount specified to pay") fromAccountBalance must equal((beforeFromBalance - convertedAmount)) /* - And("the newest transaction for the account receiving the payment must have the proper amount") + And("the newest transaction for the account receiving the payment should have the proper amount") newestToAccountTransaction.details.value.amount must equal(amt.toString) */ - And("the account receiving the payment must have a new balance plus the amount paid") + And("the account receiving the payment should have a new balance plus the amount paid") val toAccountBalance = getToAccount.balance toAccountBalance must equal(beforeToBalance + convertedAmount) - And("there must now be 2 new transactions in the database (one for the sender, one for the receiver") + And("there should now be 2 new transactions in the database (one for the sender, one for the receiver") transactionCount(fromAccount, toAccount) must equal(totalTransactionsBefore + 2) } } @@ -227,7 +228,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { var request = (v2_0Request / "banks" / testBank.bankId.value / "accounts" / fromAccount.accountId.value / "owner" / "transaction-request-types" / "SANDBOX_TAN" / "transaction-requests").POST <@(user1) var response = makePostRequest(request, write(transactionRequestBody)) - Then("we must get a 201 created code") + Then("We should get a 201 created code") response.code must equal(201) //created a transaction request, check some return values. As type is SANDBOX_TAN and value is < 1000, we expect no challenge @@ -235,7 +236,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { case JString(i) => i case _ => "" } - Then("We must have some new transaction id") + Then("We should have some new transaction id") transRequestId must not equal ("") val responseBody = response.body @@ -247,7 +248,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { } status must equal (code.transactionrequests.TransactionRequests.STATUS_COMPLETED) - // Challenge must be null (none required) + // Challenge should be null (none required) var challenge = (response.body \ "challenge").children challenge.size must equal(0) @@ -262,7 +263,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { "owner" / "transaction-requests").GET <@(user1) response = makeGetRequest(request) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") response.code must equal(200) val transactionRequests = response.body.children transactionRequests.size must not equal(0) @@ -286,7 +287,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { "owner" / "transactions").GET <@(user1) response = makeGetRequest(request) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") response.code must equal(200) val transactions = response.body.children @@ -304,19 +305,19 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { val rate = fx.exchangeRate (fromAccount.currency, toAccount.currency) val convertedAmount = fx.convert(amt, rate) val fromAccountBalance = getFromAccount.balance - And("the from account must have a balance smaller by the amount specified to pay") + And("the from account should have a balance smaller by the amount specified to pay") fromAccountBalance must equal((beforeFromBalance - convertedAmount)) /* - And("the newest transaction for the account receiving the payment must have the proper amount") + And("the newest transaction for the account receiving the payment should have the proper amount") newestToAccountTransaction.details.value.amount must equal(amt.toString) */ - And("the account receiving the payment must have a new balance plus the amount paid") + And("the account receiving the payment should have a new balance plus the amount paid") val toAccountBalance = getToAccount.balance toAccountBalance must equal(beforeToBalance + convertedAmount) - And("there must now be 2 new transactions in the database (one for the sender, one for the receiver") + And("there should now be 2 new transactions in the database (one for the sender, one for the receiver") transactionCount(fromAccount, toAccount) must equal(totalTransactionsBefore + 2) } } @@ -353,7 +354,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { val request = (v2_0Request / "banks" / testBank.bankId.value / "accounts" / fromAccount.accountId.value / "owner" / "transaction-request-types" / "SANDBOX_TAN" / "transaction-requests").POST <@(user2) val response = makePostRequest(request, write(transactionRequestBody)) - Then("we must get a 400 created code") + Then("We should get a 400 created code") response.code must equal(400) //created a transaction request, check some return values. As type is SANDBOX_TAN and value is < 1000, we expect no challenge @@ -361,7 +362,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { case JString(i) => i case _ => "" } - Then("We must have the error: " + ErrorMessages.InsufficientAuthorisationToCreateTransactionRequest) + Then("We should have the error: " + ErrorMessages.InsufficientAuthorisationToCreateTransactionRequest) error must equal (ErrorMessages.InsufficientAuthorisationToCreateTransactionRequest) } @@ -413,7 +414,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { val request = (v2_0Request / "banks" / testBank.bankId.value / "accounts" / fromAccount.accountId.value / "owner" / "transaction-request-types" / "SANDBOX_TAN" / "transaction-requests").POST <@ (user3) val response = makePostRequest(request, write(transactionRequestBody)) - Then("we must get a 400 created code") + Then("We should get a 400 created code") response.code must equal(400) //created a transaction request, check some return values. As type is SANDBOX_TAN and value is < 1000, we expect no challenge @@ -421,7 +422,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { case JString(i) => i case _ => "" } - Then("We must have the error: " + ErrorMessages.InsufficientAuthorisationToCreateTransactionRequest) + Then("We should have the error: " + ErrorMessages.InsufficientAuthorisationToCreateTransactionRequest) error must equal (ErrorMessages.InsufficientAuthorisationToCreateTransactionRequest) @@ -493,7 +494,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { var request = (v2_0Request / "banks" / testBank.bankId.value / "accounts" / fromAccount.accountId.value / "owner" / "transaction-request-types" / "SANDBOX_TAN" / "transaction-requests").POST <@(user1) var response = makePostRequest(request, write(transactionRequestBody)) - Then("we must get a 201 created code") + Then("We should get a 201 created code") response.code must equal(201) @@ -504,7 +505,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { case JString(i) => i case _ => "" } - Then("We must have some new transaction request id") + Then("We should have some new transaction request id") transRequestId must not equal ("") val status: String = (response.body \ "status") match { @@ -514,7 +515,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { status must equal (code.transactionrequests.TransactionRequests.STATUS_COMPLETED) - Then("we must not have a challenge object") + Then("We should not have a challenge object") var challenge = (response.body \ "challenge").children challenge.size must equal(0) @@ -529,7 +530,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { "owner" / "transaction-requests").GET <@(user1) response = makeGetRequest(request) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") response.code must equal(200) val transactionRequests = response.body.children transactionRequests.size must not equal(0) @@ -550,7 +551,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { "owner" / "transactions").GET <@(user1) response = makeGetRequest(request) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") response.code must equal(200) val fromTransactions = response.body.children @@ -585,7 +586,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { "owner" / "transactions").GET <@(user1) response = makeGetRequest(request) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") response.code must equal(200) val toTransactions = response.body.children @@ -617,24 +618,24 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { val rate = fx.exchangeRate (fromAccount.currency, toAccount.currency) val convertedAmount = fx.convert(amt, rate) val fromAccountBalance = getFromAccount.balance - And("the from account must have a balance smaller by the original amount specified to pay") + And("the from account should have a balance smaller by the original amount specified to pay") fromAccountBalance must equal(beforeFromBalance - amt) //val fromAccountBalance = getFromAccount.balance - //And("the from account must have a balance smaller by the amount specified to pay") + //And("the from account should have a balance smaller by the amount specified to pay") //fromAccountBalance must equal((beforeFromBalance - amt)) /* - And("the newest transaction for the account receiving the payment must have the proper amount") + And("the newest transaction for the account receiving the payment should have the proper amount") newestToAccountTransaction.details.value.amount must equal(amt.toString) */ - And("the account receiving the payment must have a new balance plus the amount paid") + And("the account receiving the payment should have a new balance plus the amount paid") val toAccountBalance = getToAccount.balance toAccountBalance must equal(beforeToBalance + convertedAmount) - And("there must now be 2 new transactions in the database (one for the sender, one for the receiver)") + And("there should now be 2 new transactions in the database (one for the sender, one for the receiver)") transactionCount(fromAccount, toAccount) must equal(totalTransactionsBefore + 2) } } @@ -688,7 +689,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { var request = (v2_0Request / "banks" / testBank.bankId.value / "accounts" / fromAccount.accountId.value / "owner" / "transaction-request-types" / "SANDBOX_TAN" / "transaction-requests").POST <@ (user1) var response = makePostRequest(request, write(transactionRequestBody)) - Then("we must get a 201 created code") + Then("We should get a 201 created code") response.code must equal(201) //ok, created a transaction request, check some return values. As type is SANDBOX_TAN but over 100€, we expect a challenge @@ -724,7 +725,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { "owner" / "transaction-requests").GET <@ (user1) response = makeGetRequest(request) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") response.code must equal(200) var transactionRequests = response.body.children @@ -744,7 +745,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { request = (v1_4Request / "banks" / testBank.bankId.value / "accounts" / fromAccount.accountId.value / "owner" / "transaction-request-types" / "SANDBOX_TAN" / "transaction-requests" / transRequestId / "challenge").POST <@ (user1) response = makePostRequest(request, write(answerJson)) - Then("we must get a 400 bad request code") + Then("We should get a 400 bad request code") response.code must equal(400) //TODO: check if allowed_attempts is decreased @@ -754,7 +755,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { request = (v1_4Request / "banks" / testBank.bankId.value / "accounts" / fromAccount.accountId.value / "owner" / "transaction-request-types" / "SANDBOX_TAN" / "transaction-requests" / transRequestId / "challenge").POST <@ (user1) response = makePostRequest(request, write(answerJson)) - Then("we must get a 202 accepted code") + Then("We should get a 202 accepted code") response.code must equal(202) //check if returned data includes new transaction's id @@ -775,7 +776,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { "owner" / "transaction-requests").GET <@ (user1) response = makeGetRequest(request) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") response.code must equal(200) transactionRequests = response.body.children @@ -793,19 +794,19 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { //(do it here even though the payments test does test makePayment already) val fromAccountBalance = getFromAccount.balance - And("the from account must have a balance smaller by the amount specified to pay") + And("the from account should have a balance smaller by the amount specified to pay") fromAccountBalance must equal((beforeFromBalance - amt)) /* - And("the newest transaction for the account receiving the payment must have the proper amount") + And("the newest transaction for the account receiving the payment should have the proper amount") newestToAccountTransaction.details.value.amount must equal(amt.toString) */ - And("the account receiving the payment must have a new balance plus the amount paid") + And("the account receiving the payment should have a new balance plus the amount paid") val toAccountBalance = getToAccount.balance toAccountBalance must equal(beforeToBalance + amt) - And("there must now be 2 new transactions in the database (one for the sender, one for the receiver") + And("there should now be 2 new transactions in the database (one for the sender, one for the receiver") transactionCount(fromAccount, toAccount) must equal(totalTransactionsBefore + 2) } } @@ -877,7 +878,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { var request = (v2_0Request / "banks" / testBank.bankId.value / "accounts" / fromAccount.accountId.value / "owner" / "transaction-request-types" / "SANDBOX_TAN" / "transaction-requests").POST <@(user1) var response = makePostRequest(request, write(transactionRequestBody)) - Then("we must get a 201 created code") + Then("We should get a 201 created code") response.code must equal(201) //created a transaction request, check some return values. As type is SANDBOX_TAN, we expect no challenge @@ -885,7 +886,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { case JString(i) => i case _ => "" } - Then("We must have some new transaction id") + Then("We should have some new transaction id") transRequestId must not equal ("") var status: String = (response.body \ "status") match { @@ -914,7 +915,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { "owner" / "transaction-requests").GET <@ (user1) response = makeGetRequest(request) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") response.code must equal(200) var transactionRequests = response.body.children @@ -925,7 +926,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { } transaction_ids must equal ("") - //Then("we must have a challenge object") + //Then("We should have a challenge object") //challenge = (response.body \ "challenge").children // TODO fix this path challenge.size must not equal(0) @@ -935,7 +936,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { request = (v2_0Request / "banks" / testBank.bankId.value / "accounts" / fromAccount.accountId.value / "owner" / "transaction-request-types" / "SANDBOX_TAN" / "transaction-requests" / transRequestId / "challenge").POST <@ (user1) response = makePostRequest(request, write(answerJson)) - Then("we must get a 400 bad request code") + Then("We should get a 400 bad request code") response.code must equal(400) //TODO: check if allowed_attempts is decreased @@ -945,7 +946,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { request = (v2_0Request / "banks" / testBank.bankId.value / "accounts" / fromAccount.accountId.value / "owner" / "transaction-request-types" / "SANDBOX_TAN" / "transaction-requests" / transRequestId / "challenge").POST <@ (user1) response = makePostRequest(request, write(answerJson)) - Then("we must get a 202 accepted code") + Then("We should get a 202 accepted code") response.code must equal(202) //check if returned data includes new transaction's id @@ -966,7 +967,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { "owner" / "transaction-requests").GET <@(user1) response = makeGetRequest(request) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") response.code must equal(200) transactionRequests = response.body.children @@ -988,7 +989,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { "owner" / "transactions").GET <@(user1) response = makeGetRequest(request) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") response.code must equal(200) val fromTransactions = response.body.children @@ -1023,7 +1024,7 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { "owner" / "transactions").GET <@(user1) response = makeGetRequest(request) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") response.code must equal(200) val toTransactions = response.body.children @@ -1055,24 +1056,24 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { val rate = fx.exchangeRate (fromAccount.currency, toAccount.currency) val convertedAmount = fx.convert(amt, rate) val fromAccountBalance = getFromAccount.balance - And("the from account must have a balance smaller by the original amount specified to pay") + And("the from account should have a balance smaller by the original amount specified to pay") fromAccountBalance must equal(beforeFromBalance - amt) //val fromAccountBalance = getFromAccount.balance - //And("the from account must have a balance smaller by the amount specified to pay") + //And("the from account should have a balance smaller by the amount specified to pay") //fromAccountBalance must equal((beforeFromBalance - amt)) /* - And("the newest transaction for the account receiving the payment must have the proper amount") + And("the newest transaction for the account receiving the payment should have the proper amount") newestToAccountTransaction.details.value.amount must equal(amt.toString) */ - And("the account receiving the payment must have a new balance plus the amount paid") + And("the account receiving the payment should have a new balance plus the amount paid") val toAccountBalance = getToAccount.balance toAccountBalance must equal(beforeToBalance + convertedAmount) - And("there must now be 2 new transactions in the database (one for the sender, one for the receiver)") + And("there should now be 2 new transactions in the database (one for the sender, one for the receiver)") transactionCount(fromAccount, toAccount) must equal(totalTransactionsBefore + 2) } } @@ -1108,13 +1109,13 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { val payJson = MakePaymentJson(toAccount.bankId.value, toAccount.accountId.value, amt.toString) val postResult = postTransaction(fromAccount.bankId.value, fromAccount.accountId.value, view, payJson, user2) - Then("we must get a 400") + Then("We should get a 400") postResult.code must equal(400) - And("the number of transactions for each account must remain unchanged") + And("the number of transactions for each account should remain unchanged") totalTransactionsBefore must equal(transactionCount(fromAccount, toAccount)) - And("the balances of each account must remain unchanged") + And("the balances of each account should remain unchanged") beforeFromBalance must equal(getFromAccount.balance) beforeToBalance must equal(getToAccount.balance) } @@ -1148,13 +1149,13 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { val payJson = MakePaymentJson(toAccount.bankId.value, toAccount.accountId.value, amt.toString) val postResult = postTransaction(fromAccount.bankId.value, fromAccount.accountId.value, view, payJson, None) - Then("we must get a 400") + Then("We should get a 400") postResult.code must equal(400) - And("the number of transactions for each account must remain unchanged") + And("the number of transactions for each account should remain unchanged") totalTransactionsBefore must equal(transactionCount(fromAccount, toAccount)) - And("the balances of each account must remain unchanged") + And("the balances of each account should remain unchanged") beforeFromBalance must equal(getFromAccount.balance) beforeToBalance must equal(getToAccount.balance) } @@ -1190,13 +1191,13 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { val payJson = MakePaymentJson(toAccount.bankId.value, toAccount.accountId.value, amt.toString) val postResult = postTransaction(fromAccount.bankId.value, fromAccount.accountId.value, view, payJson, user1) - Then("we must get a 400") + Then("We should get a 400") postResult.code must equal(400) - And("the number of transactions for each account must remain unchanged") + And("the number of transactions for each account should remain unchanged") totalTransactionsBefore must equal(transactionCount(fromAccount, toAccount)) - And("the balances of each account must remain unchanged") + And("the balances of each account should remain unchanged") beforeFromBalance must equal(getFromAccount.balance) beforeToBalance must equal(getToAccount.balance) } @@ -1233,13 +1234,13 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { val payJson = MakePaymentJson(toAccount.bankId.value, toAccount.accountId.value, amt.toString) val postResult = postTransaction(fromAccount.bankId.value, fromAccount.accountId.value, view, payJson, user1) - Then("we must get a 400") + Then("We should get a 400") postResult.code must equal(400) - And("the number of transactions for each account must remain unchanged") + And("the number of transactions for each account should remain unchanged") totalTransactionsBefore must equal(transactionCount(fromAccount, toAccount)) - And("the balances of each account must remain unchanged") + And("the balances of each account should remain unchanged") beforeFromBalance must equal(getFromAccount.balance) beforeToBalance must equal(getToAccount.balance) } @@ -1268,13 +1269,13 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { val payJson = MakePaymentJson(bankId.value, "ACCOUNTTHATDOESNOTEXIST232321321", amt.toString) val postResult = postTransaction(fromAccount.bankId.value, fromAccount.accountId.value, view, payJson, user1) - Then("we must get a 400") + Then("We should get a 400") postResult.code must equal(400) - And("the number of transactions for the sender's account must remain unchanged") + And("the number of transactions for the sender's account should remain unchanged") totalTransactionsBefore must equal(transactionCount(fromAccount)) - And("the balance of the sender's account must remain unchanged") + And("the balance of the sender's account should remain unchanged") beforeFromBalance must equal(getFromAccount.balance) } @@ -1308,13 +1309,13 @@ class TransactionRequestsTest extends V200ServerSetup with DefaultUsers { val payJson = MakePaymentJson(toAccount.bankId.value, toAccount.accountId.value, amt.toString) val postResult = postTransaction(fromAccount.bankId.value, fromAccount.accountId.value, view, payJson, user1) - Then("we must get a 400") + Then("We should get a 400") postResult.code must equal(400) - And("the number of transactions for each account must remain unchanged") + And("the number of transactions for each account should remain unchanged") totalTransactionsBefore must equal(transactionCount(fromAccount, toAccount)) - And("the balances of each account must remain unchanged") + And("the balances of each account should remain unchanged") beforeFromBalance must equal(getFromAccount.balance) beforeToBalance must equal(getToAccount.balance) } */ diff --git a/src/test/scala/code/api/v2_1_0/CreateBranchTest.scala b/src/test/scala/code/api/v2_1_0/CreateBranchTest.scala index 28b68860c..4be31562c 100644 --- a/src/test/scala/code/api/v2_1_0/CreateBranchTest.scala +++ b/src/test/scala/code/api/v2_1_0/CreateBranchTest.scala @@ -45,7 +45,7 @@ class CreateBranchTest extends V210ServerSetup with DefaultUsers { var requestPut = (v2_1Request / "banks" / bankId.value / "branches" / branchId.value ).PUT <@ (user1) var responsePut = makePutRequest(requestPut, write(customerPutJSON)) - Then("We must get a 201 and check all the fields") + Then("We should get a 201 and check all the fields") responsePut.code must equal(201) var nameResponse = (responsePut.body \ "name" ) match { @@ -76,7 +76,7 @@ class CreateBranchTest extends V210ServerSetup with DefaultUsers { requestPut = (v2_1Request / "banks" / bankId.value / "branches" / branchId.value ).PUT <@ (user1) responsePut = makePutRequest(requestPut, write(customerPutJSON2)) - Then("We must get a 201 and check all the fields") + Then("We should get a 201 and check all the fields") responsePut.code must equal(201) var nameResponse = (responsePut.body \ "name" ) match { @@ -117,7 +117,7 @@ class CreateBranchTest extends V210ServerSetup with DefaultUsers { val requestPut = (v2_1Request / "banks" / bankId.value / "branches").POST <@ (user1) val responsePost = makePostRequest(requestPut, write(customerPostJSON)) - Then("We must get a 201 and check all the fields") + Then("We should get a 201 and check all the fields") responsePost.code must equal(201) var nameResponse = (responsePost.body \ "name" ) match { @@ -147,7 +147,7 @@ class CreateBranchTest extends V210ServerSetup with DefaultUsers { var requestPost = (v2_1Request / "banks" / bankId.value / "branches").POST <@ (user1) var responsePost = makePostRequest(requestPost, write(customerPostJSON)) - Then("We must get a 201 and check all the fields") + Then("We should get a 201 and check all the fields") responsePost.code must equal(201) val customerPostJSON2 = customerPostJSON.copy(name="OBP1") @@ -155,7 +155,7 @@ class CreateBranchTest extends V210ServerSetup with DefaultUsers { requestPost = (v2_1Request / "banks" / bankId.value / "branches" / branchId.value ).PUT <@ (user1) responsePost = makePutRequest(requestPost, write(customerPostJSON2)) - Then("We must get a 201 and check all the fields") + Then("We should get a 201 and check all the fields") responsePost.code must equal(201) var nameResponse = (responsePost.body \ "name" ) match { diff --git a/src/test/scala/code/api/v2_1_0/CreateCounterpartyTest.scala b/src/test/scala/code/api/v2_1_0/CreateCounterpartyTest.scala index 2441fd019..eed33f878 100644 --- a/src/test/scala/code/api/v2_1_0/CreateCounterpartyTest.scala +++ b/src/test/scala/code/api/v2_1_0/CreateCounterpartyTest.scala @@ -47,7 +47,7 @@ class CreateCounterpartyTest extends V210ServerSetup with DefaultUsers { val requestPost = (v2_1Request / "banks" / bankId.value / "accounts" / accountId.value / viewId.value / "counterparties" ).POST <@ (user1) val responsePost = makePostRequest(requestPost, write(counterpartyPostJSON)) - Then("We must get a 200 and check all the fields") + Then("We should get a 200 and check all the fields") responsePost.code must equal(200) var accountRoutingAddress = (responsePost.body \ "other_account_routing_address" ) match { @@ -70,7 +70,7 @@ class CreateCounterpartyTest extends V210ServerSetup with DefaultUsers { val requestPost = (v2_1Request / "banks" / bankId.value / "accounts" / accountId.value / viewId.value / "counterparties" ).POST <@ (user1) val responsePost = makePostRequest(requestPost, write(counterpartyPostJSON)) - Then("We must get a 400") + Then("We should get a 400") responsePost.code must equal(400) val error = for { JObject(o) <- responsePost.body; JField("error", JString(error)) <- o } yield error @@ -92,7 +92,7 @@ class CreateCounterpartyTest extends V210ServerSetup with DefaultUsers { Then("We make the request again, the same name/bank_id/account_id/view_id") responsePost = makePostRequest(requestPost, write(counterpartyPostJSON)) - Then("We must get a 400 and check the error massage") + Then("We should get a 400 and check the error massage") responsePost.code must equal(400) val error = for { JObject(o) <- responsePost.body; JField("error", JString(error)) <- o } yield error diff --git a/src/test/scala/code/api/v2_1_0/CreateTransactionTypeTest.scala b/src/test/scala/code/api/v2_1_0/CreateTransactionTypeTest.scala index 4e63f4c15..d1ea67404 100644 --- a/src/test/scala/code/api/v2_1_0/CreateTransactionTypeTest.scala +++ b/src/test/scala/code/api/v2_1_0/CreateTransactionTypeTest.scala @@ -43,10 +43,10 @@ class CreateTransactionTypeTest extends V210ServerSetup with DefaultUsers { When("We make the request") val requestPut = (v2_1Request / "banks" / mockBankId1.value / "transaction-types").PUT <@ (user1) val responsePut = makePutRequest(requestPut, write(transactionTypeJSON)) - Then("We must get a 400") + Then("We should get a 400") responsePut.code must equal(400) val error = for {JObject(o) <- responsePut.body; JField("error", JString(error)) <- o} yield error - And("We must get a message: " + ErrorMessages.InsufficientAuthorisationToCreateTransactionType) + And("We should get a message: " + ErrorMessages.InsufficientAuthorisationToCreateTransactionType) error must contain(ErrorMessages.InsufficientAuthorisationToCreateTransactionType) } @@ -58,7 +58,7 @@ class CreateTransactionTypeTest extends V210ServerSetup with DefaultUsers { val requestPut = (v2_1Request / "banks" / mockBankId1.value / "transaction-types").PUT <@ (user1) val responsePut = makePutRequest(requestPut, write(transactionTypeJSON)) - And("We must get a 200") + And("We should get a 200") responsePut.code must equal(200) } } @@ -73,7 +73,7 @@ class CreateTransactionTypeTest extends V210ServerSetup with DefaultUsers { val requestPut1 = (v2_1Request / "banks" / mockBankId1.value / "transaction-types").PUT <@ (user1) val responsePut1 = makePutRequest(requestPut1, write(transactionTypeJSON)) - And("We must get a 200") + And("We should get a 200") responsePut1.code must equal(200) Then("update input value and We make the request") @@ -88,7 +88,7 @@ class CreateTransactionTypeTest extends V210ServerSetup with DefaultUsers { val requestPut = (v2_1Request / "banks" / mockBankId1.value / "transaction-types").PUT <@ (user1) val responsePut = makePutRequest(requestPut, write(transactionTypeJSON2)) - And("We must get a 200") + And("We should get a 200") responsePut.code must equal(200) } @@ -100,7 +100,7 @@ class CreateTransactionTypeTest extends V210ServerSetup with DefaultUsers { val requestPut1 = (v2_1Request / "banks" / mockBankId1.value / "transaction-types").PUT <@ (user1) val responsePut1 = makePutRequest(requestPut1, write(transactionTypeJSON)) - And("We must get a 200") + And("We should get a 200") responsePut1.code must equal(200) Then("insert new data and We make the request") @@ -115,10 +115,10 @@ class CreateTransactionTypeTest extends V210ServerSetup with DefaultUsers { val requestPut2 = (v2_1Request / "banks" / mockBankId1.value / "transaction-types").PUT <@ (user1) val responsePut2 = makePutRequest(requestPut2, write(transactionTypeJSON1)) - And("We must get a 400") + And("We should get a 400") responsePut2.code must equal(400) val errorInsert = for {JObject(o) <- responsePut2.body; JField("error", JString(error)) <- o} yield error - And("We must get a message: " + ErrorMessages.CreateTransactionTypeInsertError) + And("We should get a message: " + ErrorMessages.CreateTransactionTypeInsertError) errorInsert must contain(ErrorMessages.CreateTransactionTypeInsertError) @@ -134,10 +134,10 @@ class CreateTransactionTypeTest extends V210ServerSetup with DefaultUsers { val requestPut3 = (v2_1Request / "banks" / mockBankId1.value / "transaction-types").PUT <@ (user1) val responsePut3 = makePutRequest(requestPut3, write(transactionTypeJSON2)) - And("We must get a 400") + And("We should get a 400") responsePut3.code must equal(400) val errorUpdate = for {JObject(o) <- responsePut3.body; JField("error", JString(error)) <- o} yield error - And("We must get a message: " + ErrorMessages.CreateTransactionTypeUpdateError) + And("We should get a message: " + ErrorMessages.CreateTransactionTypeUpdateError) errorUpdate must contain(ErrorMessages.CreateTransactionTypeUpdateError) } } diff --git a/src/test/scala/code/api/v2_1_0/CustomerTest.scala b/src/test/scala/code/api/v2_1_0/CustomerTest.scala index b9fd11faa..73bf91e43 100644 --- a/src/test/scala/code/api/v2_1_0/CustomerTest.scala +++ b/src/test/scala/code/api/v2_1_0/CustomerTest.scala @@ -46,35 +46,35 @@ class CustomerTest extends V210ServerSetup with DefaultUsers { UserCustomerLink.userCustomerLink.vend.getUserCustomerLinkByUserId(customerPostJSON.user_id).size must equal(0) val requestPost = (v2_1Request / "banks" / mockBankId1.value / "customers").POST <@ (user1) val responsePost = makePostRequest(requestPost, write(customerPostJSON)) - Then("We must get a 400") + Then("We should get a 400") responsePost.code must equal(400) When("We add one required entitlement") Entitlement.entitlement.vend.addEntitlement(mockBankId1.value, resourceUser1.userId, ApiRole.CanCreateCustomer.toString) val responsePost1 = makePostRequest(requestPost, write(customerPostJSON)) - Then("We must get a 400") + Then("We should get a 400") responsePost1.code must equal(400) When("We add all required entitlement") Entitlement.entitlement.vend.addEntitlement(mockBankId1.value, resourceUser1.userId, ApiRole.CanCreateUserCustomerLink.toString) val responsePost2 = makePostRequest(requestPost, write(customerPostJSON)) println("responsePost2 " + responsePost2) - Then("We must get a 201") + Then("We should get a 201") responsePost2.code must equal(201) - And("We must get the right information back") + And("We should get the right information back") val infoPost = responsePost2.body.extract[CustomerJsonV210] When("We make the request") val requestGet = (v2_1Request / "banks" / mockBankId1.value / "customer").GET <@ (user1) val responseGet = makeGetRequest(requestGet) - Then("We must get a 200") + Then("We should get a 200") responseGet.code must equal(200) - And("We must get the right information back") + And("We should get the right information back") val infoGet = responseGet.body.extract[CustomerJsonV210] - And("POST feedback and GET feedback must be the same") + And("POST feedback and GET feedback should be the same") infoGet must equal(infoPost) And("User is linked to 1 customer") @@ -83,10 +83,10 @@ class CustomerTest extends V210ServerSetup with DefaultUsers { When("We try to make the second request with same customer number at same bank") val secondResponsePost = makePostRequest(requestPost, write(customerPostJSON)) - Then("We must get a 400") + Then("We should get a 400") secondResponsePost.code must equal(400) val error = for { JObject(o) <- secondResponsePost.body; JField("error", JString(error)) <- o } yield error - And("We must get a message: " + ErrorMessages.CustomerNumberAlreadyExists) + And("We should get a message: " + ErrorMessages.CustomerNumberAlreadyExists) error must contain (ErrorMessages.CustomerNumberAlreadyExists) And("User is linked to 1 customer") UserCustomerLink.userCustomerLink.vend.getUserCustomerLinkByUserId(customerPostJSON.user_id).size must equal(1) @@ -95,7 +95,7 @@ class CustomerTest extends V210ServerSetup with DefaultUsers { val customerPostJSON3 = createCustomerJson(mockCustomerNumber2) val requestPost3 = (v2_1Request / "banks" / mockBankId1.value / "customers").POST <@ (user1) val responsePost3 = makePostRequest(requestPost3, write(customerPostJSON3)) - Then("We must get a 201") + Then("We should get a 201") responsePost3.code must equal(201) And("User is linked to 2 customers") UserCustomerLink.userCustomerLink.vend.getUserCustomerLinkByUserId(customerPostJSON3.user_id).size must equal(2) @@ -107,17 +107,17 @@ class CustomerTest extends V210ServerSetup with DefaultUsers { val customerPostJSON4 = createCustomerJson(mockCustomerNumber1) val requestPost4 = (v2_1Request / "banks" / mockBankId2.value / "customers").POST <@ (user1) val responsePost4 = makePostRequest(requestPost4, write(customerPostJSON4)) - Then("We must get a 201") + Then("We should get a 201") responsePost4.code must equal(201) And("User is linked to 3 customers") UserCustomerLink.userCustomerLink.vend.getUserCustomerLinkByUserId(customerPostJSON4.user_id).size must equal(3) When("We try to make the second request with same customer number at same bank") val secondResponsePost4 = makePostRequest(requestPost4, write(customerPostJSON4)) - Then("We must get a 400") + Then("We should get a 400") secondResponsePost4.code must equal(400) val error4 = for { JObject(o) <- secondResponsePost4.body; JField("error", JString(error)) <- o } yield error - And("We must get a message: " + ErrorMessages.CustomerNumberAlreadyExists) + And("We should get a message: " + ErrorMessages.CustomerNumberAlreadyExists) error4 must contain (ErrorMessages.CustomerNumberAlreadyExists) And("User is linked to 3 customers") UserCustomerLink.userCustomerLink.vend.getUserCustomerLinkByUserId(customerPostJSON.user_id).size must equal(3) diff --git a/src/test/scala/code/api/v2_1_0/EntitlementTests.scala b/src/test/scala/code/api/v2_1_0/EntitlementTests.scala index b7d6fd28f..795ee8938 100644 --- a/src/test/scala/code/api/v2_1_0/EntitlementTests.scala +++ b/src/test/scala/code/api/v2_1_0/EntitlementTests.scala @@ -22,10 +22,10 @@ class EntitlementTests extends V210ServerSetup with DefaultUsers { When("We make the request") val requestGet = (v2_1Request / "roles").GET val responseGet = makeGetRequest(requestGet) - Then("We must get a 400") + Then("We should get a 400") responseGet.code must equal(400) val error = for { JObject(o) <- responseGet.body; JField("error", JString(error)) <- o } yield error - And("We must get a message: " + ErrorMessages.UserNotLoggedIn) + And("We should get a message: " + ErrorMessages.UserNotLoggedIn) error must contain (ErrorMessages.UserNotLoggedIn) } @@ -34,7 +34,7 @@ class EntitlementTests extends V210ServerSetup with DefaultUsers { When("We make the request") val requestGet = (v2_1Request / "roles").GET <@ (user1) val responseGet = makeGetRequest(requestGet) - Then("We must get a 200") + Then("We should get a 200") responseGet.code must equal(200) } } @@ -45,10 +45,10 @@ class EntitlementTests extends V210ServerSetup with DefaultUsers { When("We make the request") val requestGet = (v2_1Request / "banks" / mockBankId1.value / "users" / resourceUser1.userId / "entitlements").GET val responseGet = makeGetRequest(requestGet) - Then("We must get a 400") + Then("We should get a 400") responseGet.code must equal(400) val error = for { JObject(o) <- responseGet.body; JField("error", JString(error)) <- o } yield error - And("We must get a message: " + ErrorMessages.UserNotLoggedIn) + And("We should get a message: " + ErrorMessages.UserNotLoggedIn) error must contain (ErrorMessages.UserNotLoggedIn) } @@ -57,14 +57,14 @@ class EntitlementTests extends V210ServerSetup with DefaultUsers { When("We make the request") val requestGet = (v2_1Request / "banks" / mockBankId1.value / "users" / resourceUser1.userId / "entitlements").GET <@ (user1) val responseGet = makeGetRequest(requestGet) - Then("We must get a 400") + Then("We should get a 400") responseGet.code must equal(400) val error = for { JObject(o) <- responseGet.body; JField("error", JString(error)) <- o } yield error val requiredEntitlements = CanGetEntitlementsForAnyUserAtOneBank :: CanGetEntitlementsForAnyUserAtAnyBank:: Nil val requiredEntitlementsTxt = requiredEntitlements.mkString(" or ") - And("We must get a message: " + s"$requiredEntitlementsTxt entitlements required") + And("We should get a message: " + s"$requiredEntitlementsTxt entitlements required") error must contain (UserDoesNotHaveRole + requiredEntitlementsTxt) } @@ -74,7 +74,7 @@ class EntitlementTests extends V210ServerSetup with DefaultUsers { And("We make the request") val requestGet = (v2_1Request / "banks" / mockBankId1.value / "users" / resourceUser1.userId / "entitlements").GET <@ (user1) val responseGet = makeGetRequest(requestGet) - Then("We must get a 200") + Then("We should get a 200") responseGet.code must equal(200) } } diff --git a/src/test/scala/code/api/v2_1_0/TransactionRequestsTest.scala b/src/test/scala/code/api/v2_1_0/TransactionRequestsTest.scala index 0c7993a8e..499a502ac 100644 --- a/src/test/scala/code/api/v2_1_0/TransactionRequestsTest.scala +++ b/src/test/scala/code/api/v2_1_0/TransactionRequestsTest.scala @@ -92,7 +92,7 @@ class TransactionRequestsTest extends V210ServerSetup with DefaultUsers { var answerJson = ChallengeAnswerJSON(id = challengeId, answer = "123456") //prepare for counterparty and SEPA stuff - //For SEPA, otherAccountRoutingScheme must be 'IBAN' + //For SEPA, otherAccountRoutingScheme should be 'IBAN' val counterPartySEPA = createCounterparty(bankId.value, accountId2.value, "IBAN", "IBAN", true, UUID.randomUUID.toString); //For Counterpart local mapper, the mOtherAccountRoutingScheme='OBP' and mOtherBankRoutingScheme = 'OBP' val counterPartyCounterparty = createCounterparty(bankId.value, accountId2.value, "IBAN", "OBP", true, UUID.randomUUID.toString); @@ -128,32 +128,32 @@ class TransactionRequestsTest extends V210ServerSetup with DefaultUsers { def makeCreateTransReqRequestCounterparty: APIResponse = makePostRequest(createTransReqRequest, write(transactionRequestBodyCounterparty)) def checkAllCreateTransReqResBodyField(createTransactionRequestResponse: APIResponse, withChallenge: Boolean): Unit = { - Then("we must get a 201 created code") + Then("We should get a 201 created code") (createTransactionRequestResponse.code) must equal(201) - Then("We must have a new transaction id in response body") + Then("We should have a new transaction id in response body") transRequestId = (createTransactionRequestResponse.body \ "id").values.toString transRequestId must not equal ("") if (withChallenge) { - Then("We must have the INITIATED status in response body") + Then("We should have the INITIATED status in response body") (createTransactionRequestResponse.body \ "status").values.toString must equal(code.transactionrequests.TransactionRequests.STATUS_INITIATED) - Then("The transaction_ids filed must be empty") + Then("The transaction_ids filed should be empty") (createTransactionRequestResponse.body \ "transaction_ids").values.toString must equal("List()") - Then("Challenge must have body, this is the with challenge scenario") + Then("Challenge should have body, this is the with challenge scenario") (createTransactionRequestResponse.body \ "challenge").children.size must not equal (0) challengeId = (createTransactionRequestResponse.body \ "challenge" \ "id").values.toString challengeId must not equal ("") } else { - Then("We must have the COMPLETED status in response body") + Then("We should have the COMPLETED status in response body") (createTransactionRequestResponse.body \ "status").values.toString must equal(code.transactionrequests.TransactionRequests.STATUS_COMPLETED) - Then("The transaction_ids filed must be not empty") + Then("The transaction_ids filed should be not empty") (createTransactionRequestResponse.body \ "transaction_ids").values.toString must not equal ("List()") - Then("Challenge must be null, this is the no challenge scenario") + Then("Challenge should be null, this is the no challenge scenario") (createTransactionRequestResponse.body \ "challenge").children.size must equal(0) } - Then("We must have a new TransactionIds value") + Then("We should have a new TransactionIds value") (createTransactionRequestResponse.body \ "transaction_ids").values.toString must not equal ("") } @@ -167,29 +167,29 @@ class TransactionRequestsTest extends V210ServerSetup with DefaultUsers { def makeGetTransReqRequest = makeGetRequest(getTransReqRequest) def checkAllGetTransReqResBodyField(getTransactionRequestResponse: APIResponse, withChellenge: Boolean): Unit = { - Then("we must get a 200 created code") + Then("We should get a 200 created code") (getTransactionRequestResponse.code) must equal(200) - And("We must have a new transaction id in response body") + And("We should have a new transaction id in response body") (getTransactionRequestResponse.body \ "transaction_requests_with_charges" \ "id").values.toString must not equal ("") if (withChellenge) { - And("We must have the INITIATED status in response body") + And("We should have the INITIATED status in response body") (getTransactionRequestResponse.body \ "transaction_requests_with_charges" \ "status").values.toString must equal(code.transactionrequests.TransactionRequests.STATUS_INITIATED) - And("Challenge must be not null, this is the no challenge scenario") + And("Challenge should be not null, this is the no challenge scenario") (getTransactionRequestResponse.body \ "transaction_requests_with_charges" \ "challenge").children.size must not equal (0) - And("We must have be null value for TransactionIds") + And("We should have be null value for TransactionIds") (getTransactionRequestResponse.body \ "transaction_requests_with_charges" \ "transaction_ids").values.toString must equal("List()") } else { - And("We must have the COMPLETED status in response body") + And("We should have the COMPLETED status in response body") (getTransactionRequestResponse.body \ "transaction_requests_with_charges" \ "status").values.toString must equal(code.transactionrequests.TransactionRequests.STATUS_COMPLETED) - And("Challenge must be null, this is the no challenge scenario") + And("Challenge should be null, this is the no challenge scenario") (getTransactionRequestResponse.body \ "transaction_requests_with_charges" \ "challenge").children.size must equal(0) - And("We must have a new TransactionIds value") + And("We should have a new TransactionIds value") (getTransactionRequestResponse.body \ "transaction_requests_with_charges" \ "transaction_ids").values.toString must not equal ("") } @@ -203,15 +203,15 @@ class TransactionRequestsTest extends V210ServerSetup with DefaultUsers { def makeGetTransRequest = makeGetRequest(getTransactionRequest) def checkAllGetTransResBodyField(getTransactionResponse: APIResponse, withChellenge: Boolean): Unit = { - Then("we must get a 200 created code") + Then("We should get a 200 created code") (getTransactionResponse.code) must equal(200) - And("we must get the body size is one") + And("We should get the body size is one") (getTransactionResponse.body.children.size) must equal(1) if (withChellenge) { - And("we must get None, there is no transaction yet") + And("We should get None, there is no transaction yet") ((getTransactionResponse.body \ "transactions"\"details").toString contains (discription)) must not equal(true) } else { - And("we must get the body discription value is as we set before") + And("We should get the body discription value is as we set before") ((getTransactionResponse.body \ "transactions"\"details").toString contains (discription)) must equal(true) } } @@ -232,33 +232,33 @@ class TransactionRequestsTest extends V210ServerSetup with DefaultUsers { if (finishedTranscation ) { if(transactionRequestTypeInput.equals("FREE_FORM")){ - Then("FREE_FORM just transfer money to itself, the money must be the same as before ") + Then("FREE_FORM just transfer money to itself, the money should be the same as before ") fromAccountBalance must equal((beforeFromBalance)) - And("there must now be 2 new transactions in the database") + And("there should now be 2 new transactions in the database") transactionCount(fromAccount, toAccount) must equal(totalTransactionsBefore+2) } else if(transactionRequestTypeInput.equals("SANDBOX_TAN")){ Then("check that the balances have been properly decreased/increased (since we handle that logic for sandbox accounts at least) ") fromAccountBalance must equal((beforeFromBalance - amt)) - And("the account receiving the payment must have a new balance plus the amount paid") + And("the account receiving the payment should have a new balance plus the amount paid") toAccountBalance must equal(beforeToBalance + convertedAmount) - And("there must now be 2 new transactions in the database (one for the sender, one for the receiver") + And("there should now be 2 new transactions in the database (one for the sender, one for the receiver") transactionCount(fromAccount, toAccount) must equal(totalTransactionsBefore + 2) } else{ Then("check that the balances have been properly decreased/increased (since we handle that logic for sandbox accounts at least) ") fromAccountBalance must equal((beforeFromBalance - amt)) - And("the account receiving the payment must have a new balance plus the amount paid") + And("the account receiving the payment should have a new balance plus the amount paid") //TODO for now, sepa, counterparty can not clear the toAccount and toAccount Currency so just test the fromAccount //toAccountBalance must equal(beforeToBalance + convertedAmount) - And("there must now be 2 new transactions in the database (one for the sender, one for the receiver") + And("there should now be 2 new transactions in the database (one for the sender, one for the receiver") transactionCount(fromAccount, toAccount) must equal(totalTransactionsBefore + 2) } } else { - Then("No transaction, it must be the same as before ") + Then("No transaction, it should be the same as before ") fromAccountBalance must equal((beforeFromBalance)) - And("No transaction, it must be the same as before ") + And("No transaction, it should be the same as before ") toAccountBalance must equal(beforeToBalance) - And("No transaction, it must be the same as before ") + And("No transaction, it should be the same as before ") transactionCount(fromAccount, toAccount) must equal(totalTransactionsBefore) } } @@ -273,16 +273,16 @@ class TransactionRequestsTest extends V210ServerSetup with DefaultUsers { def makeAnswerRequest = makePostRequest(answerRequest, write(answerJson)) def checkAllAnsTransReqBodyFields(ansTransReqResponse: APIResponse, withChellenge: Boolean): Unit = { - Then("we must get a 202 created code") + Then("We should get a 202 created code") (ansTransReqResponse.code) must equal(202) - And("we must get the body sie is 10, the response Json body have 10 Attributes") + And("We should get the body sie is 10, the response Json body have 10 Attributes") (ansTransReqResponse.body.children.size) must equal(10) - Then("We must have a new TransactionIds value") + Then("We should have a new TransactionIds value") (ansTransReqResponse.body \ "transaction_ids").values.toString must not equal ("") - Then("We must have the COMPLETED status in response body") + Then("We should have the COMPLETED status in response body") (ansTransReqResponse.body \ "status").values.toString must equal(code.transactionrequests.TransactionRequests.STATUS_COMPLETED) } } @@ -303,10 +303,10 @@ class TransactionRequestsTest extends V210ServerSetup with DefaultUsers { var response = makePostRequest(request, write(helper.transactionRequestBody)) - Then("we must get a 400 created code") + Then("We should get a 400 created code") response.code must equal(400) - Then("We must have the error message") + Then("We should have the error message") val error = for {JObject(o) <- response.body; JField("error", JString(error)) <- o} yield error error must contain(ErrorMessages.UserNotLoggedIn) @@ -325,10 +325,10 @@ class TransactionRequestsTest extends V210ServerSetup with DefaultUsers { "owner" / "transaction-request-types" / helper.transactionRequestType / "transaction-requests").POST <@ (user2) val response = makePostRequest(request, write(helper.transactionRequestBody)) - Then("we must get a 400 created code") + Then("We should get a 400 created code") response.code must equal(400) - Then("We must have the error: " + ErrorMessages.InsufficientAuthorisationToCreateTransactionRequest) + Then("We should have the error: " + ErrorMessages.InsufficientAuthorisationToCreateTransactionRequest) val error: String = (response.body \ "error").values.toString error must equal(ErrorMessages.InsufficientAuthorisationToCreateTransactionRequest) } @@ -349,7 +349,7 @@ class TransactionRequestsTest extends V210ServerSetup with DefaultUsers { "owner" / "transaction-request-types" / helper.transactionRequestType / "transaction-requests").POST <@ (user3) var response = makePostRequest(request, write(helper.transactionRequestBody)) - Then("we must get a 201 created code") + Then("We should get a 201 created code") response.code must equal(201) } @@ -363,7 +363,7 @@ class TransactionRequestsTest extends V210ServerSetup with DefaultUsers { val helper = defaultSetup() Then("We grant the CanCreateAnyTransactionRequest role to user3") - addEntitlement(helper.bankId.value, authuser3.userId, CanCreateAnyTransactionRequest.toString) + addEntitlement(helper.bankId.value, resourceUser3.userId, CanCreateAnyTransactionRequest.toString) Then("We call createTransactionRequest with invalid transactionRequestType - V210") val invalidTransactionRequestType = "invalidTransactionRequestType" @@ -371,10 +371,10 @@ class TransactionRequestsTest extends V210ServerSetup with DefaultUsers { "owner" / "transaction-request-types" / invalidTransactionRequestType / "transaction-requests").POST <@ (user3) var response = makePostRequest(request, write(helper.transactionRequestBody)) - Then("we must get a 400 created code") + Then("We should get a 400 created code") response.code must equal(400) - Then("We must have the error message") + Then("We should have the error message") val error: List[String] = for {JObject(o) <- response.body; JField("error", JString(error)) <- o} yield error error(0) must include(ErrorMessages.InvalidTransactionRequestType) } @@ -1046,13 +1046,13 @@ class TransactionRequestsTest extends V210ServerSetup with DefaultUsers { val payJson = MakePaymentJson(toAccount.bankId.value, toAccount.accountId.value, amt.toString) val postResult = postTransaction(fromAccount.bankId.value, fromAccount.accountId.value, view, payJson, user1) - Then("we must get a 400") + Then("We should get a 400") postResult.code must equal(400) - And("the number of transactions for each account must remain unchanged") + And("the number of transactions for each account should remain unchanged") totalTransactionsBefore must equal(transactionCount(fromAccount, toAccount)) - And("the balances of each account must remain unchanged") + And("the balances of each account should remain unchanged") beforeFromBalance must equal(getFromAccount.balance) beforeToBalance must equal(getToAccount.balance) } @@ -1089,13 +1089,13 @@ class TransactionRequestsTest extends V210ServerSetup with DefaultUsers { val payJson = MakePaymentJson(toAccount.bankId.value, toAccount.accountId.value, amt.toString) val postResult = postTransaction(fromAccount.bankId.value, fromAccount.accountId.value, view, payJson, user1) - Then("we must get a 400") + Then("We should get a 400") postResult.code must equal(400) - And("the number of transactions for each account must remain unchanged") + And("the number of transactions for each account should remain unchanged") totalTransactionsBefore must equal(transactionCount(fromAccount, toAccount)) - And("the balances of each account must remain unchanged") + And("the balances of each account should remain unchanged") beforeFromBalance must equal(getFromAccount.balance) beforeToBalance must equal(getToAccount.balance) } @@ -1124,13 +1124,13 @@ class TransactionRequestsTest extends V210ServerSetup with DefaultUsers { val payJson = MakePaymentJson(bankId.value, "ACCOUNTTHATDOESNOTEXIST232321321", amt.toString) val postResult = postTransaction(fromAccount.bankId.value, fromAccount.accountId.value, view, payJson, user1) - Then("we must get a 400") + Then("We should get a 400") postResult.code must equal(400) - And("the number of transactions for the sender's account must remain unchanged") + And("the number of transactions for the sender's account should remain unchanged") totalTransactionsBefore must equal(transactionCount(fromAccount)) - And("the balance of the sender's account must remain unchanged") + And("the balance of the sender's account should remain unchanged") beforeFromBalance must equal(getFromAccount.balance) } */ diff --git a/src/test/scala/code/api/v2_2_0/API2_2_0Test.scala b/src/test/scala/code/api/v2_2_0/API2_2_0Test.scala index bb4290192..727746e26 100644 --- a/src/test/scala/code/api/v2_2_0/API2_2_0Test.scala +++ b/src/test/scala/code/api/v2_2_0/API2_2_0Test.scala @@ -12,7 +12,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. -You must have received a copy of the GNU Affero General Public License +you should have received a copy of the GNU Affero General Public License along with this program. If not, see . Email: contact@tesobe.com @@ -134,7 +134,7 @@ class API2_2_0Test extends User1AllPrivileges with V220ServerSetup with DefaultU Given("We will not use an access token") When("the request is sent") val reply = getAPIInfo - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val apiInfo = reply.body.extract[APIInfoJSON] apiInfo.version must equal ("2.2.0") @@ -147,7 +147,7 @@ class API2_2_0Test extends User1AllPrivileges with V220ServerSetup with DefaultU Given("We will not use an access token") When("the request is sent") val reply = getBanksInfo - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val banksInfo = reply.body.extract[BanksJSON] banksInfo.banks.foreach(b => { @@ -161,7 +161,7 @@ class API2_2_0Test extends User1AllPrivileges with V220ServerSetup with DefaultU Given("We will not use an access token") When("the request is sent") val reply = getBankInfo(randomBank) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val bankInfo = reply.body.extract[code.api.v1_2_1.BankJSON] bankInfo.id.nonEmpty must equal (true) @@ -171,9 +171,9 @@ class API2_2_0Test extends User1AllPrivileges with V220ServerSetup with DefaultU Given("We will not use an access token and request a random bankId") When("the request is sent") val reply = getBankInfo(randomString(5)) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -215,7 +215,7 @@ class API2_2_0Test extends User1AllPrivileges with V220ServerSetup with DefaultU val bankAccount : code.api.v1_2.AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getAccountViews(bankId, bankAccount.id, user1) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) reply.body.extract[ViewsJSONV220] } @@ -226,9 +226,9 @@ class API2_2_0Test extends User1AllPrivileges with V220ServerSetup with DefaultU val bankAccount : code.api.v1_2.AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getAccountViews(bankId, bankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -238,9 +238,9 @@ class API2_2_0Test extends User1AllPrivileges with V220ServerSetup with DefaultU val bankAccount : code.api.v1_2.AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getAccountViews(bankId, bankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -253,10 +253,10 @@ class API2_2_0Test extends User1AllPrivileges with V220ServerSetup with DefaultU val view = randomView(true, "") When("the request is sent") val reply = postView(bankId, bankAccount.id, view, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") reply.code must equal (201) reply.body.extract[ViewJSONV220] - And("we must get a new view") + And("We should get a new view") val viewsAfter = getAccountViews(bankId, bankAccount.id, user1).body.extract[ViewsJSONV220].views viewsBefore.size must equal (viewsAfter.size -1) } @@ -268,9 +268,9 @@ class API2_2_0Test extends User1AllPrivileges with V220ServerSetup with DefaultU val view = randomView(true, "") When("the request is sent") val reply = postView(bankId, bankAccount.id, view, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -281,9 +281,9 @@ class API2_2_0Test extends User1AllPrivileges with V220ServerSetup with DefaultU val view = randomView(true, "") When("the request is sent") val reply = postView(bankId, bankAccount.id, view, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -293,9 +293,9 @@ class API2_2_0Test extends User1AllPrivileges with V220ServerSetup with DefaultU val view = randomView(true, "") When("the request is sent") val reply = postView(bankId, randomString(3), view, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -307,9 +307,9 @@ class API2_2_0Test extends User1AllPrivileges with V220ServerSetup with DefaultU postView(bankId, bankAccount.id, view, user1) When("the request is sent") val reply = postView(bankId, bankAccount.id, view, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -359,7 +359,7 @@ class API2_2_0Test extends User1AllPrivileges with V220ServerSetup with DefaultU When("We use a valid access token and valid put json") val reply = putView(bankId, bankAccount.id, createdView.id, viewUpdateJson(createdView), user1) - Then("We must get back the updated view") + Then("We should get back the updated view") reply.code must equal (200) val updatedView = reply.body.extract[ViewJSONV220] updatedView.can_see_images must equal(true) @@ -384,7 +384,7 @@ class API2_2_0Test extends User1AllPrivileges with V220ServerSetup with DefaultU When("we try to update that view") val reply = putView(bankId, bankAccount.id, nonExistantViewId, someViewUpdateJson(), user1) - Then("We must get a 404") + Then("We should get a 404") reply.code must equal(404) } @@ -399,10 +399,10 @@ class API2_2_0Test extends User1AllPrivileges with V220ServerSetup with DefaultU When("we don't use an access token") val reply = putView(bankId, bankAccount.id, createdView.id, viewUpdateJson(createdView), None) - Then("we must get a 400") + Then("We should get a 400") reply.code must equal(400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -417,10 +417,10 @@ class API2_2_0Test extends User1AllPrivileges with V220ServerSetup with DefaultU When("we try to update a view without having sufficient privileges to do so") val reply = putView(bankId, bankAccount.id, createdView.id, viewUpdateJson(createdView), user3) - Then("we must get a 400") + Then("We should get a 400") reply.code must equal(400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } diff --git a/src/test/scala/code/api/v3_0_0/API3_0_0Test.scala b/src/test/scala/code/api/v3_0_0/API3_0_0Test.scala index a3d477042..7c82b6954 100644 --- a/src/test/scala/code/api/v3_0_0/API3_0_0Test.scala +++ b/src/test/scala/code/api/v3_0_0/API3_0_0Test.scala @@ -12,7 +12,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. -You must have received a copy of the GNU Affero General Public License +you should have received a copy of the GNU Affero General Public License along with this program. If not, see . Email: contact@tesobe.com @@ -99,7 +99,7 @@ class API3_0_0Test extends User1AllPrivileges with V300ServerSetup with DefaultU Given("We will not use an access token") When("the request is sent") val reply = getAPIInfo - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val apiInfo = reply.body.extract[APIInfoJSON] apiInfo.version must equal ("3.0.0") @@ -111,7 +111,7 @@ class API3_0_0Test extends User1AllPrivileges with V300ServerSetup with DefaultU Given("We will not use an access token") When("the request is sent") val reply = getBanksInfo - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val banksInfo = reply.body.extract[BanksJSON] banksInfo.banks.foreach(b => { @@ -125,7 +125,7 @@ class API3_0_0Test extends User1AllPrivileges with V300ServerSetup with DefaultU Given("We will not use an access token") When("the request is sent") val reply = getBankInfo(randomBankId) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) val bankInfo = reply.body.extract[code.api.v1_2_1.BankJSON] bankInfo.id.nonEmpty must equal (true) @@ -135,9 +135,9 @@ class API3_0_0Test extends User1AllPrivileges with V300ServerSetup with DefaultU Given("We will not use an access token and request a random bankId") When("the request is sent") val reply = getBankInfo(randomString(5)) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -149,7 +149,7 @@ class API3_0_0Test extends User1AllPrivileges with V300ServerSetup with DefaultU val bankAccount : code.api.v1_2.AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getAccountViews(bankId, bankAccount.id, user1) - Then("we must get a 200 ok code") + Then("We should get a 200 ok code") reply.code must equal (200) reply.body.extract[ViewsJsonV300] } @@ -160,9 +160,9 @@ class API3_0_0Test extends User1AllPrivileges with V300ServerSetup with DefaultU val bankAccount : code.api.v1_2.AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getAccountViews(bankId, bankAccount.id, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -172,9 +172,9 @@ class API3_0_0Test extends User1AllPrivileges with V300ServerSetup with DefaultU val bankAccount : code.api.v1_2.AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = getAccountViews(bankId, bankAccount.id, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -187,10 +187,10 @@ class API3_0_0Test extends User1AllPrivileges with V300ServerSetup with DefaultU When("the request is sent") val reply = postView(bankId, bankAccount.id, view, user1) - Then("we must get a 201 code") + Then("We should get a 201 code") reply.code must equal (201) reply.body.extract[ViewJSONV220] - And("we must get a new view") + And("We should get a new view") val viewsAfter = getAccountViews(bankId, bankAccount.id, user1).body.extract[ViewsJsonV300].views viewsBefore.size must equal (viewsAfter.size -1) } @@ -201,9 +201,9 @@ class API3_0_0Test extends User1AllPrivileges with V300ServerSetup with DefaultU val bankAccount : code.api.v1_2.AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = postView(bankId, bankAccount.id, view, None) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -213,9 +213,9 @@ class API3_0_0Test extends User1AllPrivileges with V300ServerSetup with DefaultU val bankAccount : code.api.v1_2.AccountJSON = randomPrivateAccount(bankId) When("the request is sent") val reply = postView(bankId, bankAccount.id, view, user3) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -224,9 +224,9 @@ class API3_0_0Test extends User1AllPrivileges with V300ServerSetup with DefaultU val bankId = randomBankId When("the request is sent") val reply = postView(bankId, randomString(3), view, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -237,9 +237,9 @@ class API3_0_0Test extends User1AllPrivileges with V300ServerSetup with DefaultU postView(bankId, bankAccount.id, view, user1) When("the request is sent") val reply = postView(bankId, bankAccount.id, view, user1) - Then("we must get a 400 code") + Then("We should get a 400 code") reply.code must equal (400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } @@ -288,7 +288,7 @@ class API3_0_0Test extends User1AllPrivileges with V300ServerSetup with DefaultU When("We use a valid access token and valid put json") val reply = putView(bankId, bankAccount.id, createdView.id, viewUpdateJson(createdView), user1) - Then("We must get back the updated view") + Then("We should get back the updated view") reply.code must equal (200) val updatedView = reply.body.extract[ViewJsonV300] updatedView.can_see_images must equal(true) @@ -313,7 +313,7 @@ class API3_0_0Test extends User1AllPrivileges with V300ServerSetup with DefaultU When("we try to update that view") val reply = putView(bankId, bankAccount.id, nonExistantViewId, someViewUpdateJson(), user1) - Then("We must get a 404") + Then("We should get a 404") reply.code must equal(404) } @@ -327,10 +327,10 @@ class API3_0_0Test extends User1AllPrivileges with V300ServerSetup with DefaultU When("we don't use an access token") val reply = putView(bankId, bankAccount.id, createdView.id, viewUpdateJson(createdView), None) - Then("we must get a 400") + Then("We should get a 400") reply.code must equal(400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } @@ -344,10 +344,10 @@ class API3_0_0Test extends User1AllPrivileges with V300ServerSetup with DefaultU When("we try to update a view without having sufficient privileges to do so") val reply = putView(bankId, bankAccount.id, createdView.id, viewUpdateJson(createdView), user3) - Then("we must get a 400") + Then("We should get a 400") reply.code must equal(400) - And("we must get an error message") + And("We should get an error message") reply.body.extract[ErrorMessage].error.nonEmpty must equal (true) } } diff --git a/src/test/scala/code/api/v3_0_0/AccountTest.scala b/src/test/scala/code/api/v3_0_0/AccountTest.scala index 52f396033..59ef58338 100644 --- a/src/test/scala/code/api/v3_0_0/AccountTest.scala +++ b/src/test/scala/code/api/v3_0_0/AccountTest.scala @@ -21,14 +21,14 @@ class AccountTest extends V300ServerSetup with DefaultUsers { val responsePut = makePutRequest(requestPut, write(accountPutJSON)) And("We should get a 200") - responsePut.code should equal(200) + responsePut.code must 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) + responseGet.code must equal(200) val isPublic: List[Boolean] = for { @@ -38,14 +38,14 @@ class AccountTest extends V300ServerSetup with DefaultUsers { isPublic } And("All received accounts have to be public") - isPublic.forall(_ == true) should equal(true) + isPublic.forall(_ == true) must equal(true) When("We make the authenticated access request") val requestGetAll = (v2_0Request / "accounts").GET <@ (user1) val responseGetAll = makeGetRequest(requestGetAll) Then("We should get a 200") - responseGetAll.code should equal(200) + responseGetAll.code must equal(200) val isPublicAll = for { @@ -56,7 +56,7 @@ class AccountTest extends V300ServerSetup with DefaultUsers { isPublic } And("The new created account has to be private") - isPublicAll.forall(_ == false) should equal(true) + isPublicAll.forall(_ == false) must equal(true) } scenario("We create an account and get accounts as anonymous and then as authenticated user - allAccountsAtOneBank") { @@ -69,14 +69,14 @@ class AccountTest extends V300ServerSetup with DefaultUsers { val responsePut = makePutRequest(requestPut, write(accountPutJSON)) And("We should get a 200") - responsePut.code should equal(200) + responsePut.code must 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) + responseGet.code must equal(200) val isPublic: List[Boolean] = for { @@ -86,14 +86,14 @@ class AccountTest extends V300ServerSetup with DefaultUsers { isPublic } And("All received accounts have to be public") - isPublic.forall(_ == true) should equal(true) + isPublic.forall(_ == true) must equal(true) When("We make the authenticated access request") val requestGetAll = (v2_0Request / "banks" / testBank.value / "accounts").GET <@ (user1) val responseGetAll = makeGetRequest(requestGetAll) Then("We should get a 200") - responseGetAll.code should equal(200) + responseGetAll.code must equal(200) val isPublicAll = for { @@ -104,7 +104,7 @@ class AccountTest extends V300ServerSetup with DefaultUsers { isPublic } And("The new created account has to be private") - isPublicAll.forall(_ == false) should equal(true) + isPublicAll.forall(_ == false) must equal(true) } scenario("We create an account, but with wrong format of account_id ") { @@ -118,14 +118,14 @@ class AccountTest extends V300ServerSetup with DefaultUsers { val responsePut = makePutRequest(requestPut, write(accountPutJSON)) And("We should get a 400") - responsePut.code should equal(400) + responsePut.code must equal(400) And("We should have the error massage") val error: String = (responsePut.body \ "error") match { case JString(i) => i case _ => "" } Then("We should have the error: " + ErrorMessages.InvalidAccountIdFormat) - error should equal(ErrorMessages.InvalidAccountIdFormat) + error must equal(ErrorMessages.InvalidAccountIdFormat) } } diff --git a/src/test/scala/code/atms/MappedAtmsProviderTest.scala b/src/test/scala/code/atms/MappedAtmsProviderTest.scala index e4baae1e7..a8cf2cffe 100644 --- a/src/test/scala/code/atms/MappedAtmsProviderTest.scala +++ b/src/test/scala/code/atms/MappedAtmsProviderTest.scala @@ -96,14 +96,14 @@ class MappedAtmsProviderTest extends ServerSetup { When("we try to get the atms for that bank") val atmsOpt: Option[List[Atm]] = MappedAtmsProvider.getAtms(BankId(fixture.bankIdX)) - Then("We must get a atms list") + Then("We should get a atms list") atmsOpt.isDefined must equal (true) val atms = atmsOpt.get And("it must contain two atms") atms.size must equal(2) - And("they must be the licensed ones") + And("they should be the licensed ones") atms must equal (expectedAtms) } @@ -118,7 +118,7 @@ class MappedAtmsProviderTest extends ServerSetup { When("we try to get the atms for that bank") val atmDataOpt = MappedAtmsProvider.getAtms(BankId(fixture.bankIdY)) - Then("we must get back an empty list") + Then("We should get back an empty list") atmDataOpt.isDefined must equal(true) val atms = atmDataOpt.get diff --git a/src/test/scala/code/bankaccountcreation/BankAccountCreationListenerTest.scala b/src/test/scala/code/bankaccountcreation/BankAccountCreationListenerTest.scala index b99676094..0cb3a7ac3 100644 --- a/src/test/scala/code/bankaccountcreation/BankAccountCreationListenerTest.scala +++ b/src/test/scala/code/bankaccountcreation/BankAccountCreationListenerTest.scala @@ -44,7 +44,7 @@ class BankAccountCreationListenerTest extends ServerSetup with DefaultConnectorT val accountNumber = "123456" def thenCheckAccountCreated(user: User) = { - Then("An account with the proper parameters must be created") + Then("An account with the proper parameters should be created") val userAccounts = Views.views.vend.getAllAccountsUserCanSee(Full(user)) userAccounts.size must equal(1) val createdAccount = userAccounts(0) @@ -76,7 +76,7 @@ class BankAccountCreationListenerTest extends ServerSetup with DefaultConnectorT When("We create a bank account") - //using expectedBankId as the bank name must be okay as the behaviour must be to slugify the bank name to get the id + //using expectedBankId as the bank name should be okay as the behaviour should be to slugify the bank name to get the id //what to do if this slugification results in an id collision has not been determined yet val msgContent = CreateBankAccount(userId, userProvider, accountNumber, bankIdentifier, expectedBankId) @@ -87,7 +87,7 @@ class BankAccountCreationListenerTest extends ServerSetup with DefaultConnectorT thenCheckAccountCreated(user) - And("A bank must be created") + And("A bank should be created") val createdBankBox = Connector.connector.vend.getBank(BankId(expectedBankId)) createdBankBox.isDefined must equal(true) val createdBank = createdBankBox match { diff --git a/src/test/scala/code/bankaccountcreation/BankAccountCreationTest.scala b/src/test/scala/code/bankaccountcreation/BankAccountCreationTest.scala index f2d7d1e7c..28e6d2d60 100644 --- a/src/test/scala/code/bankaccountcreation/BankAccountCreationTest.scala +++ b/src/test/scala/code/bankaccountcreation/BankAccountCreationTest.scala @@ -39,7 +39,7 @@ class BankAccountCreationTest extends ServerSetup with DefaultUsers with Default // // val newBank1 = createBank(id) // -// Then("A bank must now exist, with the correct parameters") +// Then("A bank should now exist, with the correct parameters") // // val allBanks = Connector.connector.vend.getBanks // allBanks.size must equal(1) @@ -67,14 +67,14 @@ class BankAccountCreationTest extends ServerSetup with DefaultUsers with Default "","", "" //added field in V220 ) - Then("A bank must now exist, with the correct parameters") + Then("A bank should now exist, with the correct parameters") val allBanks = Connector.connector.vend.getBanks allBanks.size must equal(1) val newBank = allBanks(0) newBank.fullName must equal(bankName) newBank.nationalIdentifier must equal(bankNationalIdentifier) - And("An account must now exist, with the correct parameters") + And("An account should now exist, with the correct parameters") val foundAccountBox = Connector.connector.vend.getBankAccount(newBank.bankId, returnedAccount.accountId) foundAccountBox.isDefined must equal(true) val foundAccount = foundAccountBox match { @@ -104,13 +104,13 @@ class BankAccountCreationTest extends ServerSetup with DefaultUsers with Default "","", "" //added field in V220 ) - Then("No new bank must be created") + Then("No new bank should be created") val allBanksAfter = Connector.connector.vend.getBanks allBanksAfter.size must equal(1) allBanksAfter(0).fullName must equal(existingBank.fullName) allBanksAfter(0).nationalIdentifier must equal(existingBank.nationalIdentifier) - And("An account must now exist, with the correct parameters") + And("An account should now exist, with the correct parameters") val foundAccountBox = Connector.connector.vend.getBankAccount(existingBank.bankId, returnedAccount.accountId) foundAccountBox.isDefined must equal(true) val foundAccount = foundAccountBox match { @@ -160,7 +160,7 @@ class BankAccountCreationTest extends ServerSetup with DefaultUsers with Default Connector.connector.vend.createSandboxBankAccount(bankId, accountId, defaultAccountNumber, accountType, accountLabel, currency, initialBalance, accountHolderName, "","","" ) //added field in V220 - Then("An account with the proper parameters must be created") + Then("An account with the proper parameters should be created") val createdAccBox = Connector.connector.vend.getBankAccount(bankId, accountId) createdAccBox.isDefined must be(true) val createdAcc = createdAccBox match { @@ -184,7 +184,7 @@ class BankAccountCreationTest extends ServerSetup with DefaultUsers with Default Connector.connector.vend.createSandboxBankAccount(bankId, accountId, accountType, accountLabel, currency, initialBalance, accountHolderName, "","", "")//added field in V220 - Then("An account with the proper parameters must be created") + Then("An account with the proper parameters should be created") val createdAccBox = Connector.connector.vend.getBankAccount(bankId, accountId) createdAccBox.isDefined must be(true) val createdAcc = createdAccBox match { @@ -197,7 +197,7 @@ class BankAccountCreationTest extends ServerSetup with DefaultUsers with Default createdAcc.currency must equal(currency) createdAcc.accountHolder must equal(accountHolderName) - //Account number must be autogenerated + //Account number should be autogenerated createdAcc.number.nonEmpty must equal(true) } diff --git a/src/test/scala/code/branches/MappedBranchesProviderTest.scala b/src/test/scala/code/branches/MappedBranchesProviderTest.scala index d868cdce0..4b3002323 100644 --- a/src/test/scala/code/branches/MappedBranchesProviderTest.scala +++ b/src/test/scala/code/branches/MappedBranchesProviderTest.scala @@ -96,14 +96,14 @@ class MappedBranchesProviderTest extends ServerSetup { When("we try to get the branches for that bank") val branchesOpt: Option[List[Branch]] = MappedBranchesProvider.getBranches(BankId(fixture.bankIdX)) - Then("We must get a branches list") + Then("We should get a branches list") branchesOpt.isDefined must equal (true) val branches = branchesOpt.get And("it must contain two branches") branches.size must equal(2) - And("they must be the licensed ones") + And("they should be the licensed ones") branches must equal (expectedBranches) } @@ -118,7 +118,7 @@ class MappedBranchesProviderTest extends ServerSetup { When("we try to get the branches for that bank") val branchDataOpt = MappedBranchesProvider.getBranches(BankId(fixture.bankIdY)) - Then("we must get back an empty list") + Then("We should get back an empty list") branchDataOpt.isDefined must equal(true) val branches = branchDataOpt.get diff --git a/src/test/scala/code/crm/MappedCrmEventProviderTest.scala b/src/test/scala/code/crm/MappedCrmEventProviderTest.scala index 92b4ae438..05f35e9fc 100644 --- a/src/test/scala/code/crm/MappedCrmEventProviderTest.scala +++ b/src/test/scala/code/crm/MappedCrmEventProviderTest.scala @@ -120,7 +120,7 @@ class MappedCrmEventProviderTest extends ServerSetup with DefaultUsers { Then("We do") foundOpt.isDefined must equal(true) - And("There must be two") + And("There should be two") val foundThings = foundOpt.get foundThings.size must equal(2) diff --git a/src/test/scala/code/customer/MappedCustomerInfoTest.scala b/src/test/scala/code/customer/MappedCustomerInfoTest.scala index c98577d1c..76184bbfb 100644 --- a/src/test/scala/code/customer/MappedCustomerInfoTest.scala +++ b/src/test/scala/code/customer/MappedCustomerInfoTest.scala @@ -45,7 +45,7 @@ class MappedCustomerProviderTest extends V140ServerSetup with DefaultUsers { And("Try to create a customer") val requestPost = (v1_4Request / "banks" / bankId.value / "customer").POST <@ (user) val responsePost = makePostRequest(requestPost, write(customerPostJSON1)) - Then("We must get a 200") + Then("We should get a 200") responsePost.code must equal(200) val customer: Box[Customer] = Customer.customerProvider.vend.getCustomerByCustomerNumber(nmb, bankId) @@ -92,7 +92,7 @@ class MappedCustomerProviderTest extends V140ServerSetup with DefaultUsers { When("We try to get the user for a bank with that customer number") val found = Customer.customerProvider.vend.getUser(BankId("some-bank"), customerNumber) - Then("We must not find a user") + Then("We should not find a user") found.isDefined must equal(false) } @@ -104,13 +104,13 @@ class MappedCustomerProviderTest extends V140ServerSetup with DefaultUsers { When("We try to get the user for the same bank") val user = Customer.customerProvider.vend.getUser(BankId(mockBankId2.value), customerNumber) - Then("We must find a user") + Then("We should find a user") user.isDefined must equal(true) When("We try to get the user for a different bank") val found = Customer.customerProvider.vend.getUser(BankId(mockBankId2.value + "asdsad"), customerNumber) - Then("We must not find a user") + Then("We should not find a user") found.isDefined must equal(false) } @@ -130,7 +130,7 @@ class MappedCustomerProviderTest extends V140ServerSetup with DefaultUsers { When("We try to get the user for that bank") val found = Customer.customerProvider.vend.getUser(mockBankId2, customerNumber) - Then("We must not find a user") + Then("We should not find a user") found.isDefined must equal(true) } diff --git a/src/test/scala/code/management/ImporterTest.scala b/src/test/scala/code/management/ImporterTest.scala index 678db1859..c4ceaa0ff 100644 --- a/src/test/scala/code/management/ImporterTest.scala +++ b/src/test/scala/code/management/ImporterTest.scala @@ -157,10 +157,10 @@ class ImporterTest extends ServerSetup with MdcLoggable with DefaultConnectorTes When("We try to import transactions without using a secret key") val response = addTransactions(f.testJson, None) - Then("We must get a 400") + Then("We should get a 400") response.code must equal(400) - And("No transactions must be added") + And("No transactions should be added") val tsAfter = Connector.connector.vend.getTransactions(f.account.bankId, f.account.accountId) match { case Full(ts) => ts } @@ -179,10 +179,10 @@ class ImporterTest extends ServerSetup with MdcLoggable with DefaultConnectorTes When("We try to import transactions with the incorrect secret key") val response = addTransactions(f.testJson, Some(secretKeyValue + "asdsadsad")) - Then("We must get a 401") + Then("We should get a 401") response.code must equal(401) - And("No transactions must be added") + And("No transactions should be added") val tsAfter = Connector.connector.vend.getTransactions(f.account.bankId, f.account.accountId) match { case Full(ts) => ts } @@ -201,16 +201,16 @@ class ImporterTest extends ServerSetup with MdcLoggable with DefaultConnectorTes When("We try to import transactions with the correct secret key") val response = addTransactions(f.testJson, Some(secretKeyValue)) - Then("We must get a 200") //implementation returns 200 and not 201, so we'll leave it like that + Then("We should get a 200") //implementation returns 200 and not 201, so we'll leave it like that response.code must equal(200) - And("Transactions must be added") + And("Transactions should be added") val tsAfter = Connector.connector.vend.getTransactions(f.account.bankId, f.account.accountId) match { case Full(ts) => ts } tsAfter.size must equal(2) - And("The transactions must have the correct parameters") + And("The transactions should have the correct parameters") val t1 = tsAfter(0) checkOkay(t1, f.t1Value, f.t1NewBalance, f.t1StartDate, f.t1EndDate, f.dummyLabel) @@ -218,13 +218,13 @@ class ImporterTest extends ServerSetup with MdcLoggable with DefaultConnectorTes checkOkay(t2, f.t2Value, f.t2NewBalance, f.t2StartDate, f.t2EndDate, f.dummyLabel) - And("The account must have its balance set to the 'new_balance' value of the most recently completed transaction") + And("The account should have its balance set to the 'new_balance' value of the most recently completed transaction") val account = Connector.connector.vend.getBankAccount(f.account.bankId, f.account.accountId) match { case Full(a) => a } account.balance.toString must equal(f.t2NewBalance) //t2 has a later completed date than t1 - And("The account must have accountLastUpdate set to the current time") + And("The account should have accountLastUpdate set to the current time") val dt = (now.getTime - account.lastUpdate.getTime) dt < 1000 must equal(true) @@ -247,25 +247,25 @@ class ImporterTest extends ServerSetup with MdcLoggable with DefaultConnectorTes //it must NOT complain about identical "new balances" as sometimes this value is unknown, or computed on a daily basis //and hence all transactions for the day will have the same end balance - Then("We must get a 200") //implementation returns 200 and not 201, so we'll leave it like that + Then("We should get a 200") //implementation returns 200 and not 201, so we'll leave it like that response.code must equal(200) - And("Transactions must be added") + And("Transactions should be added") val tsAfter = Connector.connector.vend.getTransactions(f.account.bankId, f.account.accountId) match { case Full(ts) => ts } tsAfter.size must equal(2) - And("The transactions must have the correct parameters") + And("The transactions should have the correct parameters") tsAfter.foreach(checkTransactionOkay) - And("The account must have its balance set to the 'new_balance' value of the most recently completed transaction") + And("The account should have its balance set to the 'new_balance' value of the most recently completed transaction") val account = Connector.connector.vend.getBankAccount(f.account.bankId, f.account.accountId) match { case Full(a) => a } account.balance.toString must equal(f.t1NewBalance) - And("The account must have accountLastUpdate set to the current time") + And("The account should have accountLastUpdate set to the current time") val dt = (now.getTime - account.lastUpdate.getTime) dt < 1000 must equal(true) } @@ -295,7 +295,7 @@ class ImporterTest extends ServerSetup with MdcLoggable with DefaultConnectorTes When("We try to add those transactions again") val response = addTransactions(importJson, Some(secretKeyValue)) - Then("We must get a 200") //implementation returns 200 and not 201, so we'll leave it like that + Then("We should get a 200") //implementation returns 200 and not 201, so we'll leave it like that response.code must equal(200) And("There must still only be two transactions") @@ -306,7 +306,7 @@ class ImporterTest extends ServerSetup with MdcLoggable with DefaultConnectorTes tsAfter.foreach(checkTransactionOkay) - And("The account must have accountLastUpdate set to the current time (different from first insertion)") + And("The account should have accountLastUpdate set to the current time (different from first insertion)") account = Connector.connector.vend.getBankAccount(f.account.bankId, f.account.accountId) match { case Full(a) => a } @@ -335,10 +335,10 @@ class ImporterTest extends ServerSetup with MdcLoggable with DefaultConnectorTes When("We try to add 5 copies of the transaction") val response = addTransactions(secondImportJson, Some(secretKeyValue)) - Then("We must get a 200") //implementation returns 200 and not 201, so we'll leave it like that + Then("We should get a 200") //implementation returns 200 and not 201, so we'll leave it like that response.code must equal(200) - And("There must now be 5 transactions") + And("There should now be 5 transactions") val tsAfter = Connector.connector.vend.getTransactions(f.account.bankId, f.account.accountId) match { case Full(ts) => ts } @@ -372,7 +372,7 @@ class ImporterTest extends ServerSetup with MdcLoggable with DefaultConnectorTes When("We add these same 'identical' transactions to a different account") addTransactions(t1F2ImportJson, Some(secretKeyValue)) - Then("There must be two transactions for each account") + Then("There should be two transactions for each account") val f1TsAfter = Connector.connector.vend.getTransactions(f1.account.bankId, f1.account.accountId) match { case Full(ts) => ts } @@ -398,10 +398,10 @@ class ImporterTest extends ServerSetup with MdcLoggable with DefaultConnectorTes When("We try to import transactions with the correct secret key") val response = addTransactions("""{"some_gibberish" : "json"}""", Some(secretKeyValue)) - Then("We must get a 500") //implementation returns 500, so we'll leave it like that + Then("We should get a 500") //implementation returns 500, so we'll leave it like that response.code must equal(200) - And("No transactions must be added") + And("No transactions should be added") val tsAfter = Connector.connector.vend.getTransactions(f.account.bankId, f.account.accountId) match { case Full(ts) => ts } diff --git a/src/test/scala/code/products/MappedProductsProviderTest.scala b/src/test/scala/code/products/MappedProductsProviderTest.scala index 16c44d2cb..39627df10 100644 --- a/src/test/scala/code/products/MappedProductsProviderTest.scala +++ b/src/test/scala/code/products/MappedProductsProviderTest.scala @@ -85,14 +85,14 @@ class MappedProductsProviderTest extends ServerSetup { When("we try to get the Products for that bank") val productsOpt: Option[List[Product]] = MappedProductsProvider.getProducts(BankId(fixture.bankIdX)) - Then("We must get a Products list") + Then("We should get a Products list") productsOpt.isDefined must equal (true) val products = productsOpt.get And("it must contain two Products") products.size must equal(2) - And("they must be the licensed ones") + And("they should be the licensed ones") products must equal (expectedProducts) } @@ -107,7 +107,7 @@ class MappedProductsProviderTest extends ServerSetup { When("we try to get the Products for that bank") val productsOpt = MappedProductsProvider.getProducts(BankId(fixture.bankIdY)) - Then("we must get back an empty list") + Then("We should get back an empty list") productsOpt.isDefined must equal(true) val products = productsOpt.get diff --git a/src/test/scala/code/sandbox/PostCounterpartyMetadata.scala b/src/test/scala/code/sandbox/PostCounterpartyMetadata.scala index dd1ffa13f..fe748a829 100644 --- a/src/test/scala/code/sandbox/PostCounterpartyMetadata.scala +++ b/src/test/scala/code/sandbox/PostCounterpartyMetadata.scala @@ -14,7 +14,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. -You must have received a copy of the GNU Affero General Public License +you should have received a copy of the GNU Affero General Public License along with this program. If not, see . Email: contact@tesobe.com diff --git a/src/test/scala/code/sandbox/PostCustomer.scala b/src/test/scala/code/sandbox/PostCustomer.scala index 792282d5d..c09d0e163 100644 --- a/src/test/scala/code/sandbox/PostCustomer.scala +++ b/src/test/scala/code/sandbox/PostCustomer.scala @@ -14,7 +14,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. -You must have received a copy of the GNU Affero General Public License +you should have received a copy of the GNU Affero General Public License along with this program. If not, see . Email: contact@tesobe.com diff --git a/src/test/scala/code/sandbox/SandboxDataLoadingTest.scala b/src/test/scala/code/sandbox/SandboxDataLoadingTest.scala index e36348700..a4ea7102c 100644 --- a/src/test/scala/code/sandbox/SandboxDataLoadingTest.scala +++ b/src/test/scala/code/sandbox/SandboxDataLoadingTest.scala @@ -12,7 +12,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. -You must have received a copy of the GNU Affero General Public License +you should have received a copy of the GNU Affero General Public License along with this program. If not, see . Email: contact@tesobe.com @@ -310,12 +310,12 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with MustM val owner = Users.users.vend.getUserByProviderId(defaultProvider, foundAccount.owners.toList.head.name) match { case Full(o) => o } - //there must be an owner view + //there should be an owner view val views = Views.views.vend.permittedViews(owner, BankAccountUID(foundAccount.bankId, foundAccount.accountId)) val ownerView = views.find(v => v.viewId.value == "owner") ownerView.isDefined must equal(true) - //and the owners must have access to it + //and the owners should have access to it Views.views.vend.getOwners(ownerView.get).map(_.idGivenByProvider) must equal(account.owners.toSet) } @@ -623,7 +623,7 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with MustM response.code must equal(403) - //nothing must be created + //nothing should be created Connector.connector.vend.getBanks must equal(Nil) } @@ -635,7 +635,7 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with MustM response.code must equal(403) - //nothing must be created + //nothing should be created Connector.connector.vend.getBanks must equal(Nil) } @@ -655,13 +655,13 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with MustM getResponse(bankWithoutId).code must equal(FAILED) - //no banks must have been created + //no banks should have been created Connector.connector.vend.getBanks.size must equal(0) val bankWithEmptyId = addIdField(bankWithoutId, "") getResponse(bankWithEmptyId).code must equal(FAILED) - //no banks must have been created + //no banks should have been created Connector.connector.vend.getBanks.size must equal(0) //Check that the same json becomes valid when a non-empty id is added @@ -727,10 +727,10 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with MustM val otherBank = bank2 - //when we try to add bank1 and another valid bank it must now fail + //when we try to add bank1 and another valid bank it should now fail getResponse(List(bank1Json, Extraction.decompose(bank2))).code must equal(FAILED) - //and the other bank must not have been created + //and the other bank should not have been created Connector.connector.vend.getBank(BankId(otherBank.id)).isDefined must equal(false) } @@ -749,7 +749,7 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with MustM val userWithEmptyEmail = addEmailField(userWithoutEmail, "") - //there must be no user with a blank id before we try to add one + //there should be no user with a blank id before we try to add one Users.users.vend.getUserByProviderId(defaultProvider, "") match { case ParamFailure(_,x,y,_) => x must equal(Empty) // Returned result in case when akka is used case Empty => Empty must equal(Empty) @@ -783,7 +783,7 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with MustM getResponse(userWithValidEmail).code must equal(SUCCESS) - //a user must now have been created + //a user should now have been created val createdUser = Users.users.vend.getUserByProviderId(defaultProvider, user1.user_name) match { case Full(c) => c case Empty => null @@ -825,7 +825,7 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with MustM getResponse(List(user1Json, userWithSameUsernameAsUser1)).code must equal(FAILED) - //no user with firstUserId must be created + //no user with firstUserId should be created Users.users.vend.getUserByProviderId(defaultProvider, user1.user_name) match { case ParamFailure(_,x,y,_) => x must equal(Empty) // Returned result in case when akka is used case Empty => Empty must equal(Empty) @@ -837,7 +837,7 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with MustM getResponse(List(user1Json, userWithUsername2)).code must equal(SUCCESS) - //and both users must be created + //and both users should be created val firstUser = Users.users.vend.getUserByProviderId(defaultProvider, user1.user_name) match { case Full(fu) => fu case Empty => null @@ -871,10 +871,10 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with MustM val otherUser = user2 - //when we try to add user1 and another valid new user it must now fail + //when we try to add user1 and another valid new user it should now fail getResponse(List(user1Json, Extraction.decompose(otherUser))).code must equal(FAILED) - //and the other user must not have been created + //and the other user should not have been created Users.users.vend.getUserByProviderId(defaultProvider, otherUser.user_name) } @@ -888,12 +888,12 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with MustM val userWithoutPassword = removeField(goodUser, "password") getResponse(List(userWithoutPassword)).code must equal(FAILED) - //no user must be created + //no user should be created Users.users.vend.getUserByProviderId(defaultProvider, user1.user_name).isDefined must equal(false) val userWithBlankPassword = replaceField(goodUser, "password", "") getResponse(List(userWithBlankPassword)).code must equal(FAILED) - //no user must be created + //no user should be created Users.users.vend.getUserByProviderId(defaultProvider, user1.user_name).isDefined must equal(false) //check that a normal password is okay @@ -943,7 +943,7 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with MustM getResponse(List(acc1AtBank1Json)).code must equal(SUCCESS) - //an account must now exist + //an account should now exist verifyAccountCreated(account1AtBank1) } @@ -961,7 +961,7 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with MustM //might be nice to test a case where the only similar attribute between the accounts is the id getResponse(List(account1AtBank1Json, accountWithSameId)).code must equal(FAILED) - //no accounts must have been created + //no accounts should have been created Connector.connector.vend.getBankAccount(BankId(account1AtBank1.bank), AccountId(account1AtBank1.id)).isDefined must equal(false) val accountIdTwo = "2" @@ -971,7 +971,7 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with MustM getResponse(List(account1AtBank1Json, accountWithDifferentId)).code must equal(SUCCESS) - //two accounts must have been created + //two accounts should have been created Connector.connector.vend.getBankAccount(BankId(account1AtBank1.bank), AccountId(account1AtBank1.id)).isDefined must equal(true) Connector.connector.vend.getBankAccount(BankId(account1AtBank1.bank), AccountId(accountIdTwo)).isDefined must equal(true) @@ -990,10 +990,10 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with MustM getResponse(List(account1AtBank1Json)).code must equal(SUCCESS) val otherAccount = account1AtBank2 - //when we try to add account1AtBank1 and another valid account it must now fail + //when we try to add account1AtBank1 and another valid account it should now fail getResponse(List(account1AtBank1Json, Extraction.decompose(otherAccount))).code must equal(FAILED) - //and the other account must not have been created + //and the other account should not have been created Connector.connector.vend.getBankAccount(BankId(otherAccount.bank), AccountId(otherAccount.id)).isDefined must equal(false) } @@ -1014,7 +1014,7 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with MustM getResponse(List(badBankAccount)).code must equal(FAILED) - //no account must have been created + //no account should have been created Connector.connector.vend.getBankAccount(BankId(badBankId), AccountId(account1AtBank1.id)).isDefined must equal(false) } @@ -1055,14 +1055,14 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with MustM getResponse(List(Extraction.decompose(accountWithInvalidOwner))).code must equal(FAILED) - //it must not have been created + //it should not have been created Connector.connector.vend.getBankAccount(BankId(accountWithInvalidOwner.bank), AccountId(accountWithInvalidOwner.id)).isDefined must equal(false) //a mix of valid an invalid owners must also not work val accountWithSomeValidSomeInvalidOwners = accountWithInvalidOwner.copy(owners = List(accountWithInvalidOwner.owners + user1.user_name)) getResponse(List(Extraction.decompose(accountWithSomeValidSomeInvalidOwners))).code must equal(FAILED) - //it must not have been created + //it should not have been created Connector.connector.vend.getBankAccount(BankId(accountWithSomeValidSomeInvalidOwners.bank), AccountId(accountWithSomeValidSomeInvalidOwners.id)).isDefined must equal(false) } @@ -1085,14 +1085,14 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with MustM getResponse(List(acc1Json, sameNumberJson)).code must equal(FAILED) - //no accounts must have been created + //no accounts should have been created Connector.connector.vend.getBankAccount(BankId(acc1.bank), AccountId(acc1.id)).isDefined must equal(false) Connector.connector.vend.getBankAccount(BankId(acc1.bank), AccountId(acc2.id)).isDefined must equal(false) //check it works with the normal different number getResponse(List(acc1Json, acc2Json)).code must equal(SUCCESS) - //and the accounts must be created + //and the accounts should be created Connector.connector.vend.getBankAccount(BankId(acc1.bank), AccountId(acc1.id)).isDefined must equal(true) Connector.connector.vend.getBankAccount(BankId(acc1.bank), AccountId(acc2.id)).isDefined must equal(true) } @@ -1184,7 +1184,7 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with MustM val otherTransaction = transactionWithCounterparty - //when we try to add t1Json and another valid transaction it must now fail + //when we try to add t1Json and another valid transaction it should now fail getResponse(List(t1Json, Extraction.decompose(otherTransaction))).code must equal(FAILED) //and no new transaction must exist @@ -1561,7 +1561,7 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with MustM val counter1 = foundTransaction1Box.otherAccount val counter2 = foundTransaction2Box.otherAccount - //transactions must have the same counterparty + //transactions should have the same counterparty counter1.counterPartyId must not equal(counter2.counterPartyId) counter1.counterPartyId.isEmpty must equal(false) counter2.counterPartyId.isEmpty must equal(false) @@ -1662,7 +1662,7 @@ class SandboxDataLoadingTest extends FlatSpec with SendServerRequests with MustM TransactionId(newTransId)).isDefined must equal(exist) } - //no transactions must be created + //no transactions should be created checkNoTransactionsExist() //check transaction with bad value diff --git a/src/test/scala/code/setup/DefaultUsers.scala b/src/test/scala/code/setup/DefaultUsers.scala index 312b18c08..157f36317 100644 --- a/src/test/scala/code/setup/DefaultUsers.scala +++ b/src/test/scala/code/setup/DefaultUsers.scala @@ -1,10 +1,12 @@ package code.setup +import code.api.util.APIUtil import code.api.util.APIUtil.OAuth.{Consumer, Token} import code.consumer.Consumers import code.model.TokenType._ import code.model.{User, Consumer => OBPConsumer, Token => OBPToken} import code.token.Tokens +import net.liftweb.common.Full import net.liftweb.util.Helpers._ import net.liftweb.util.Props import net.liftweb.util.TimeHelpers.TimeSpan @@ -15,7 +17,7 @@ import net.liftweb.util.TimeHelpers.TimeSpan * The login users are tuples (consumer, token), contains the consumer and token, used for direct login. */ trait DefaultUsers { - + //create the application(consumer, used it in the Login credential, mainly used the consume_key and consumer_secret) lazy val testConsumer = Consumers.consumers.vend.createConsumer( key = Some(randomString(40).toLowerCase), @@ -27,8 +29,11 @@ trait DefaultUsers { developerEmail = None, redirectURL = None, createdByUserId = None //Internally, the consumer is not relevant to UserId. - ).get - lazy val consumer = Consumer(testConsumer.key, testConsumer.secret) + ) match { + case Full(t) => t + } + + lazy val consumer = Consumer(testConsumer.key.get, testConsumer.secret.get) // create the access token val expiration = Props.getInt("token_expiration_weeks", 4) @@ -38,50 +43,62 @@ trait DefaultUsers { val defaultProvider = Props.get("hostname", "") // create some resource user for test purposes - lazy val resourceUser1 = User.createResourceUser(defaultProvider, None, None, None, None).get - lazy val resourceUser2 = User.createResourceUser(defaultProvider, None, None, None, None).get - lazy val resourceUser3 = User.createResourceUser(defaultProvider, None, None, None, None).get + lazy val resourceUser1 = User.createResourceUser(defaultProvider, None, None, None, None) match { + case Full(u1) => u1 + } + lazy val resourceUser2 = User.createResourceUser(defaultProvider, None, None, None, None) match { + case Full(u2) => u2 + } + lazy val resourceUser3 = User.createResourceUser(defaultProvider, None, None, None, None) match { + case Full(u3) => u3 + } // create the tokens in database, we only need token-key and token-secret lazy val testToken1 = Tokens.tokens.vend.createToken( Access, - Some(testConsumer.id), - Some(resourceUser1.id.toLong), + Some(testConsumer.id.get), + Some(resourceUser1.id.get), Some(randomString(40).toLowerCase), Some(randomString(40).toLowerCase), Some(tokenDuration), Some({ (now: TimeSpan) + tokenDuration }), Some(now), None - ).get + ) match { + case Full(t) => t + } lazy val testToken2 = Tokens.tokens.vend.createToken( Access, - Some(testConsumer.id), - Some(resourceUser2.id.toLong), + Some(testConsumer.id.get), + Some(resourceUser2.id.get), Some(randomString(40).toLowerCase), Some(randomString(40).toLowerCase), Some(tokenDuration), Some({ (now: TimeSpan) + tokenDuration }), Some(now), None - ).get + ) match { + case Full(t) => t + } lazy val testToken3 = Tokens.tokens.vend.createToken(Access, - Some(testConsumer.id), - Some(resourceUser3.id.toLong), + Some(testConsumer.id.get), + Some(resourceUser3.id.get), Some(randomString(40).toLowerCase), Some(randomString(40).toLowerCase), Some(tokenDuration), Some({ (now: TimeSpan) + tokenDuration }), Some(now), None - ).get + ) match { + case Full(t) => t + } // prepare the tokens - lazy val token1 = Token(testToken1.key, testToken1.secret) - lazy val token2 = Token(testToken2.key, testToken2.secret) - lazy val token3 = Token(testToken3.key, testToken3.secret) + lazy val token1 = Token(testToken1.key.get, testToken1.secret.get) + lazy val token2 = Token(testToken2.key.get, testToken2.secret.get) + lazy val token3 = Token(testToken3.key.get, testToken3.secret.get) // prepare the OAuth users to login lazy val user1 = Some(consumer, token1) diff --git a/src/test/scala/code/setup/LocalMappedConnectorTestSetup.scala b/src/test/scala/code/setup/LocalMappedConnectorTestSetup.scala index 1ffa77c89..a9e760b19 100644 --- a/src/test/scala/code/setup/LocalMappedConnectorTestSetup.scala +++ b/src/test/scala/code/setup/LocalMappedConnectorTestSetup.scala @@ -127,7 +127,7 @@ trait LocalMappedConnectorTestSetup extends TestConnectorSetupWithStandardPermis } override protected def wipeTestData() = { - //returns true if the model must not be wiped after each test + //returns true if the model should not be wiped after each test def exclusion(m : MetaMapper[_]) = { m == Nonce || m == Token || m == Consumer || m == AuthUser || m == ResourceUser } diff --git a/src/test/scala/code/setup/SendServerRequests.scala b/src/test/scala/code/setup/SendServerRequests.scala index 89361b16b..7b17f4cad 100644 --- a/src/test/scala/code/setup/SendServerRequests.scala +++ b/src/test/scala/code/setup/SendServerRequests.scala @@ -12,7 +12,7 @@ *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *GNU Affero General Public License for more details. ** - *You must have received a copy of the GNU Affero General Public License + *you should have received a copy of the GNU Affero General Public License *along with this program. If not, see . ** *Email: contact@tesobe.com diff --git a/src/test/scala/code/setup/ServerSetup.scala b/src/test/scala/code/setup/ServerSetup.scala index ef10f7d68..9604803d1 100644 --- a/src/test/scala/code/setup/ServerSetup.scala +++ b/src/test/scala/code/setup/ServerSetup.scala @@ -12,7 +12,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. -You must have received a copy of the GNU Affero General Public License +you should have received a copy of the GNU Affero General Public License along with this program. If not, see . Email: contact@tesobe.com diff --git a/src/test/scala/code/setup/TestConnectorSetupWithStandardPermissions.scala b/src/test/scala/code/setup/TestConnectorSetupWithStandardPermissions.scala index 2f085edb0..83f73b4c5 100644 --- a/src/test/scala/code/setup/TestConnectorSetupWithStandardPermissions.scala +++ b/src/test/scala/code/setup/TestConnectorSetupWithStandardPermissions.scala @@ -54,7 +54,7 @@ trait TestConnectorSetupWithStandardPermissions extends TestConnectorSetup { //drop the mongo Database after each test MongoDB.getDb(DefaultConnectionIdentifier).foreach(_.dropDatabase()) - //returns true if the model must not be wiped after each test + //returns true if the model should not be wiped after each test def exclusion(m : MetaMapper[_]) = { m == Nonce || m == Token || m == Consumer || m == AuthUser || m == ResourceUser } diff --git a/src/test/scala/code/util/OAuthClient.scala b/src/test/scala/code/util/OAuthClient.scala index 7ce960c01..48bbb20ee 100644 --- a/src/test/scala/code/util/OAuthClient.scala +++ b/src/test/scala/code/util/OAuthClient.scala @@ -12,7 +12,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. -You must have received a copy of the GNU Affero General Public License +you should have received a copy of the GNU Affero General Public License along with this program. If not, see . Email: contact@tesobe.com