From 9c16f74fe86f1a57c00e4173f6ce70b0debb6aca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Mili=C4=87?= Date: Thu, 4 Dec 2025 13:08:58 +0100 Subject: [PATCH 1/2] test/Fix failed v3.1.0 tests --- .../test/scala/code/api/v3_1_0/ConsentTest.scala | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/obp-api/src/test/scala/code/api/v3_1_0/ConsentTest.scala b/obp-api/src/test/scala/code/api/v3_1_0/ConsentTest.scala index ee79be308a..914f063fab 100644 --- a/obp-api/src/test/scala/code/api/v3_1_0/ConsentTest.scala +++ b/obp-api/src/test/scala/code/api/v3_1_0/ConsentTest.scala @@ -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": @@ -67,9 +77,10 @@ class ConsentTest extends V310ServerSetup { .copy(entitlements=entitlements) .copy(consumer_id=Some(testConsumer.consumerId.get)) .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) From 9861d69df93393369b3cc15d0c2c01e04d404ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Mili=C4=87?= Date: Thu, 4 Dec 2025 14:24:30 +0100 Subject: [PATCH 2/2] test/Fix failed v3.1.0 tests 2 --- obp-api/src/test/scala/code/api/v3_1_0/ConsentTest.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/obp-api/src/test/scala/code/api/v3_1_0/ConsentTest.scala b/obp-api/src/test/scala/code/api/v3_1_0/ConsentTest.scala index 914f063fab..894c29dbbf 100644 --- a/obp-api/src/test/scala/code/api/v3_1_0/ConsentTest.scala +++ b/obp-api/src/test/scala/code/api/v3_1_0/ConsentTest.scala @@ -73,10 +73,12 @@ 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) + .copy(entitlements=entitlements) + def postConsentImplicitJsonV310 = SwaggerDefinitionsJSON.postConsentImplicitJsonV310 .copy(consumer_id=Some(testConsumer.consumerId.get)) .copy(entitlements=entitlements)