Skip to content
Merged

Tests #2640

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions obp-api/src/test/scala/code/api/v3_1_0/ConsentTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,18 @@ import com.openbankproject.commons.util.ApiVersion
import net.liftweb.json.Serialization.write
import org.scalatest.Tag

import java.util.Date

class ConsentTest extends V310ServerSetup {

override def beforeAll() {
super.beforeAll()
}

override def afterAll() {
super.afterAll()
}

/**
* Test tags
* Example: To run tests with tag "getPermissions":
Expand All @@ -63,13 +73,16 @@ class ConsentTest extends V310ServerSetup {
lazy val bankAccount = randomPrivateAccount(bankId)
lazy val entitlements = List(PostConsentEntitlementJsonV310("", CanGetAnyUser.toString()))
lazy val views = List(PostConsentViewJsonV310(bankId, bankAccount.id, Constant.SYSTEM_OWNER_VIEW_ID))
lazy val postConsentEmailJsonV310 = SwaggerDefinitionsJSON.postConsentEmailJsonV310
.copy(entitlements=entitlements)
def postConsentEmailJsonV310 = SwaggerDefinitionsJSON.postConsentEmailJsonV310
.copy(consumer_id=Some(testConsumer.consumerId.get))
.copy(valid_from = Some(new Date()))
.copy(views=views)
lazy val postConsentImplicitJsonV310 = SwaggerDefinitionsJSON.postConsentImplicitJsonV310
.copy(entitlements=entitlements)

def postConsentImplicitJsonV310 = SwaggerDefinitionsJSON.postConsentImplicitJsonV310
.copy(consumer_id=Some(testConsumer.consumerId.get))
.copy(entitlements=entitlements)
.copy(valid_from = Some(new Date()))
.copy(views=views)

val maxTimeToLive = APIUtil.getPropsAsIntValue(nameOfProperty="consents.max_time_to_live", defaultValue=3600)
Expand Down