Skip to content

Commit

Permalink
dynamic retrieve method in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
esposimo committed May 2, 2024
1 parent 65a0073 commit b1dc81d
Show file tree
Hide file tree
Showing 52 changed files with 262 additions and 210 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace process\crawler\activateIOPayment;

use pagopa\crawler\MapEvents;
use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\Framework\TestCase;

Expand Down Expand Up @@ -68,7 +69,7 @@ public function testWorkFlow()
$transaction = self::$db->getTransaction(new \DateTime('2024-03-10'), '01000000000000160');

$workflow = self::$db->getWorkFlow($transaction, 0);
$this->assertEquals('21', $workflow->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('activateIOPayment', 'REQ'), $workflow->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-10 10:42:00.197', $workflow->getColumnValue('event_timestamp'));
$this->assertEquals('T000160', $workflow->getColumnValue('event_id'));
$this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione'));
Expand All @@ -77,7 +78,7 @@ public function testWorkFlow()
$this->assertNull($workflow->getColumnValue('outcome'));

$workflow = self::$db->getWorkFlow($transaction, 1);
$this->assertEquals('22', $workflow->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('activateIOPayment', 'RESP'), $workflow->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-10 10:42:01.197', $workflow->getColumnValue('event_timestamp'));
$this->assertEquals('T000161', $workflow->getColumnValue('event_id'));
$this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione'));
Expand All @@ -86,7 +87,7 @@ public function testWorkFlow()
$this->assertEquals('OK', $workflow->getColumnValue('outcome'));

$workflow = self::$db->getWorkFlow($transaction, 2);
$this->assertEquals('15', $workflow->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('pspNotifyPayment', 'REQ'), $workflow->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-10 10:45:00.197', $workflow->getColumnValue('event_timestamp'));
$this->assertEquals('T000162', $workflow->getColumnValue('event_id'));
$this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione'));
Expand All @@ -95,7 +96,7 @@ public function testWorkFlow()
$this->assertNull($workflow->getColumnValue('outcome'));

$workflow = self::$db->getWorkFlow($transaction, 3);
$this->assertEquals('16', $workflow->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('pspNotifyPayment', 'RESP'), $workflow->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-10 10:45:01.197', $workflow->getColumnValue('event_timestamp'));
$this->assertEquals('T000163', $workflow->getColumnValue('event_id'));
$this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione'));
Expand All @@ -105,7 +106,7 @@ public function testWorkFlow()


$workflow = self::$db->getWorkFlow($transaction, 4);
$this->assertEquals('5', $workflow->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('sendPaymentOutcome', 'REQ'), $workflow->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-10 10:47:00.197', $workflow->getColumnValue('event_timestamp'));
$this->assertEquals('T000164', $workflow->getColumnValue('event_id'));
$this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione'));
Expand All @@ -114,7 +115,7 @@ public function testWorkFlow()
$this->assertEquals('OK', $workflow->getColumnValue('outcome'));

$workflow = self::$db->getWorkFlow($transaction, 5);
$this->assertEquals('6', $workflow->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('sendPaymentOutcome', 'RESP'), $workflow->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-10 10:47:01.197', $workflow->getColumnValue('event_timestamp'));
$this->assertEquals('T000165', $workflow->getColumnValue('event_id'));
$this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace process\crawler\activatePaymentNotice\BothEvents;

use Illuminate\Database\Capsule\Manager as Capsule;
use pagopa\crawler\MapEvents;
use pagopa\database\sherlock\Transaction;
use pagopa\database\sherlock\TransactionRe;
use pagopa\database\sherlock\Workflow;
Expand Down Expand Up @@ -174,15 +175,15 @@ public function testWorkFlow()
$transaction = self::$db->getTransaction(new \DateTime('2024-03-10'), '01000000000000006' );
$event = self::$db->getWorkFlow($transaction, 0);

$this->assertEquals('1', $event->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('activatePaymentNotice', 'REQ'), $event->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-10 10:30:00.197', $event->getColumnValue('event_timestamp'));
$this->assertEquals('T000010', $event->getColumnValue('event_id'));
$this->assertEquals('77777777777_01', $event->getColumnValue('stazione'));
$this->assertEquals('88888888888_01', $event->getColumnValue('canale'));
$this->assertEquals('AGID_01', $event->getColumnValue('id_psp'));

$event = self::$db->getWorkFlow($transaction, 1);
$this->assertEquals('2', $event->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('activatePaymentNotice', 'RESP'), $event->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-10 10:31:00.197', $event->getColumnValue('event_timestamp'));
$this->assertEquals('T000011', $event->getColumnValue('event_id'));
$this->assertEquals('77777777777_01', $event->getColumnValue('stazione'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace process\crawler\activatePaymentNotice\BothEvents;

use Illuminate\Database\Capsule\Manager as Capsule;
use pagopa\crawler\MapEvents;
use pagopa\database\sherlock\Transaction;
use pagopa\database\sherlock\TransactionRe;
use pagopa\database\sherlock\Workflow;
Expand Down Expand Up @@ -188,15 +189,15 @@ public function testWorkFlow()
$transaction = self::$db->getTransaction(new \DateTime('2024-03-10'), '01000000000000007' );
$event = self::$db->getWorkFlow($transaction, 0);

$this->assertEquals('1', $event->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('activatePaymentNotice', 'REQ'), $event->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-10 10:31:00.197', $event->getColumnValue('event_timestamp'));
$this->assertEquals('T000012', $event->getColumnValue('event_id'));
$this->assertEquals('77777777777_01', $event->getColumnValue('stazione'));
$this->assertEquals('88888888888_01', $event->getColumnValue('canale'));
$this->assertEquals('AGID_01', $event->getColumnValue('id_psp'));

$event = self::$db->getWorkFlow($transaction, 1);
$this->assertEquals('2', $event->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('activatePaymentNotice', 'RESP'), $event->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-10 10:32:00.197', $event->getColumnValue('event_timestamp'));
$this->assertEquals('T000013', $event->getColumnValue('event_id'));
$this->assertEquals('77777777777_01', $event->getColumnValue('stazione'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace process\crawler\activatePaymentNotice\BothEvents;

use Illuminate\Database\Capsule\Manager as Capsule;
use pagopa\crawler\MapEvents;
use pagopa\database\sherlock\Transaction;
use pagopa\database\sherlock\TransactionRe;
use pagopa\database\sherlock\Workflow;
Expand Down Expand Up @@ -174,15 +175,15 @@ public function testWorkFlow()
$transaction = self::$db->getTransaction(new \DateTime('2024-03-10'), '01000000000000008' );
$event = self::$db->getWorkFlow($transaction, 0);

$this->assertEquals('1', $event->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('activatePaymentNotice', 'REQ'), $event->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-10 10:35:00.197', $event->getColumnValue('event_timestamp'));
$this->assertEquals('T000014', $event->getColumnValue('event_id'));
$this->assertEquals('77777777777_01', $event->getColumnValue('stazione'));
$this->assertEquals('88888888888_01', $event->getColumnValue('canale'));
$this->assertEquals('PSP_01', $event->getColumnValue('id_psp'));

$event = self::$db->getWorkFlow($transaction, 1);
$this->assertEquals('2', $event->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('activatePaymentNotice', 'RESP'), $event->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-10 10:36:00.197', $event->getColumnValue('event_timestamp'));
$this->assertEquals('T000015', $event->getColumnValue('event_id'));
$this->assertEquals('77777777777_01', $event->getColumnValue('stazione'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace process\crawler\activatePaymentNotice\BothEvents;

use Illuminate\Database\Capsule\Manager as Capsule;
use pagopa\crawler\MapEvents;
use pagopa\database\sherlock\Transaction;
use pagopa\database\sherlock\TransactionRe;
use pagopa\database\sherlock\Workflow;
Expand Down Expand Up @@ -188,15 +189,15 @@ public function testWorkFlow()
$transaction = self::$db->getTransaction(new \DateTime('2024-03-10'), '01000000000000009', 't0000000000000000000000000000009');

$event = self::$db->getWorkFlow($transaction, 0);
$this->assertEquals('1', $event->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('activatePaymentNotice', 'REQ'), $event->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-10 10:38:00.197', $event->getColumnValue('event_timestamp'));
$this->assertEquals('T000016', $event->getColumnValue('event_id'));
$this->assertEquals('77777777777_01', $event->getColumnValue('stazione'));
$this->assertEquals('88888888888_01', $event->getColumnValue('canale'));
$this->assertEquals('PSP_01', $event->getColumnValue('id_psp'));

$event = self::$db->getWorkFlow($transaction, 1);
$this->assertEquals('2', $event->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('activatePaymentNotice', 'RESP'), $event->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-10 10:39:00.197', $event->getColumnValue('event_timestamp'));
$this->assertEquals('T000017', $event->getColumnValue('event_id'));
$this->assertEquals('77777777777_01', $event->getColumnValue('stazione'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace process\crawler\activatePaymentNotice\BothEvents;

use Illuminate\Database\Capsule\Manager as Capsule;
use pagopa\crawler\MapEvents;
use pagopa\database\sherlock\Transaction;
use pagopa\database\sherlock\TransactionRe;
use pagopa\database\sherlock\Workflow;
Expand Down Expand Up @@ -151,7 +152,7 @@ public function testWorkFlow()
$transaction = self::$db->getTransaction(new \DateTime('2024-03-10'), '01000000000000010' );
$event = self::$db->getWorkFlow($transaction, 0);

$this->assertEquals('1', $event->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('activatePaymentNotice', 'REQ'), $event->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-10 10:43:00.197', $event->getColumnValue('event_timestamp'));
$this->assertEquals('T000018', $event->getColumnValue('event_id'));
$this->assertEquals('77777777777_01', $event->getColumnValue('stazione'));
Expand All @@ -162,7 +163,7 @@ public function testWorkFlow()
$transaction = self::$db->getTransaction(new \DateTime('2024-03-10'), '01000000000000010' );
$event = self::$db->getWorkFlow($transaction, 1);

$this->assertEquals('2', $event->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('activatePaymentNotice', 'RESP'), $event->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-10 10:44:00.197', $event->getColumnValue('event_timestamp'));
$this->assertEquals('T000019', $event->getColumnValue('event_id'));
$this->assertEquals('77777777777_01', $event->getColumnValue('stazione'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace process\crawler\activatePaymentNotice\BothEvents;

use Illuminate\Database\Capsule\Manager as Capsule;
use pagopa\crawler\MapEvents;
use pagopa\database\sherlock\Transaction;
use pagopa\database\sherlock\TransactionRe;
use pagopa\database\sherlock\Workflow;
Expand Down Expand Up @@ -167,7 +168,7 @@ public function testWorkFlow()
$transaction = self::$db->getTransaction(new \DateTime('2024-03-10'), '01000000000000040');

$event = self::$db->getWorkFlow($transaction, 0);
$this->assertEquals('1', $event->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('activatePaymentNotice', 'REQ'), $event->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-10 08:05:00.201', $event->getColumnValue('event_timestamp'));
$this->assertEquals('T100062', $event->getColumnValue('event_id'));
$this->assertEquals('77777777777_01', $event->getColumnValue('stazione'));
Expand All @@ -176,7 +177,7 @@ public function testWorkFlow()


$event = self::$db->getWorkFlow($transaction, 1);
$this->assertEquals('2', $event->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('activatePaymentNotice', 'RESP'), $event->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-10 08:06:00.201', $event->getColumnValue('event_timestamp'));
$this->assertEquals('T100063', $event->getColumnValue('event_id'));
$this->assertEquals('77777777777_01', $event->getColumnValue('stazione'));
Expand All @@ -186,7 +187,7 @@ public function testWorkFlow()


$event = self::$db->getWorkFlow($transaction, 2);
$this->assertEquals('1', $event->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('activatePaymentNotice', 'REQ'), $event->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-10 08:07:00.201', $event->getColumnValue('event_timestamp'));
$this->assertEquals('T200062', $event->getColumnValue('event_id'));
$this->assertEquals('77777777777_01', $event->getColumnValue('stazione'));
Expand All @@ -195,7 +196,7 @@ public function testWorkFlow()


$event = self::$db->getWorkFlow($transaction, 3);
$this->assertEquals('2', $event->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('activatePaymentNotice', 'RESP'), $event->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-10 08:08:00.201', $event->getColumnValue('event_timestamp'));
$this->assertEquals('T200063', $event->getColumnValue('event_id'));
$this->assertEquals('77777777777_01', $event->getColumnValue('stazione'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace process\crawler\activatePaymentNotice\SingleEvent;

use Illuminate\Database\Capsule\Manager as Capsule;
use pagopa\crawler\MapEvents;
use pagopa\database\sherlock\Transaction;
use pagopa\database\sherlock\TransactionRe;
use pagopa\database\sherlock\Workflow;
Expand Down Expand Up @@ -139,7 +140,7 @@ public function testWorkflow()
$transaction = self::$db->getTransaction(new \DateTime('2024-03-10'), '01000000000000001', 't0000000000000000000000000000001');
$workflow = self::$db->getWorkFlow($transaction, 0);

$this->assertEquals('1', $workflow->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('activatePaymentNotice', 'REQ'), $workflow->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-10 09:29:25.232', $workflow->getColumnValue('event_timestamp'));
$this->assertEquals('T000001', $workflow->getColumnValue('event_id'));
$this->assertEquals('AGID_01', $workflow->getColumnValue('id_psp'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace process\crawler\activatePaymentNotice\SingleEvent;

use Illuminate\Database\Capsule\Manager as Capsule;
use pagopa\crawler\MapEvents;
use pagopa\database\sherlock\Transaction;
use pagopa\database\sherlock\TransactionRe;
use pagopa\database\sherlock\Workflow;
Expand Down Expand Up @@ -139,7 +140,7 @@ public function testWorkFlow()
$event = self::$db->getWorkFlow($transaction, 0);

$this->assertEquals('T000002', $event->getColumnValue('event_id'));
$this->assertEquals('1', $event->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('activatePaymentNotice', 'REQ'), $event->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-10 09:30:00.232', $event->getColumnValue('event_timestamp'));
$this->assertEquals('T000002', $event->getColumnValue('event_id'));
$this->assertEquals('77777777777_01', $event->getColumnValue('stazione'));
Expand All @@ -149,7 +150,7 @@ public function testWorkFlow()
$event = self::$db->getWorkFlow($transaction, 1);

$this->assertEquals('T000007', $event->getColumnValue('event_id'));
$this->assertEquals('1', $event->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('activatePaymentNotice', 'REQ'), $event->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-11 09:49:25.232', $event->getColumnValue('event_timestamp'));
$this->assertEquals('T000007', $event->getColumnValue('event_id'));
$this->assertEquals('77777777777_01', $event->getColumnValue('stazione'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace process\crawler\activatePaymentNotice\SingleEvent;

use Illuminate\Database\Capsule\Manager as Capsule;
use pagopa\crawler\MapEvents;
use pagopa\database\sherlock\Transaction;
use pagopa\database\sherlock\TransactionRe;
use pagopa\database\sherlock\Workflow;
Expand Down Expand Up @@ -141,7 +142,7 @@ public function testWorkFlow()
$event = self::$db->getWorkFlow($transaction, 0);

$this->assertEquals('T000003', $event->getColumnValue('event_id'));
$this->assertEquals('1', $event->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('activatePaymentNotice', 'REQ'), $event->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-10 09:40:00.232', $event->getColumnValue('event_timestamp'));
$this->assertEquals('T000003', $event->getColumnValue('event_id'));
$this->assertEquals('77777777777_01', $event->getColumnValue('stazione'));
Expand All @@ -151,7 +152,7 @@ public function testWorkFlow()
$event = self::$db->getWorkFlow($transaction, 1);

$this->assertEquals('T000008', $event->getColumnValue('event_id'));
$this->assertEquals('1', $event->getColumnValue('fk_tipoevento'));
$this->assertEquals(MapEvents::getMethodId('activatePaymentNotice', 'REQ'), $event->getColumnValue('fk_tipoevento'));
$this->assertEquals('2024-03-11 09:41:25.232', $event->getColumnValue('event_timestamp'));
$this->assertEquals('77777777777_01', $event->getColumnValue('stazione'));
$this->assertEquals('88888888888_01', $event->getColumnValue('canale'));
Expand Down
Loading

0 comments on commit b1dc81d

Please sign in to comment.