@@ -436,4 +436,32 @@ public void testGetDisputeNotificationRequestWithEmptyJson() {
436436 Optional <DisputeNotificationRequest > result = handler .getDisputeNotificationRequest ();
437437 assertFalse (result .isPresent ());
438438 }
439+
440+ @ Test
441+ public void testScoreNotificationRequest () {
442+
443+ String json = getFileContents ("mocks/balancePlatform-webhooks/balancePlatform-score-triggered.json" );
444+
445+ ConfigurationWebhooksHandler handler = new ConfigurationWebhooksHandler (json );
446+ Optional <ScoreNotificationRequest > optionalRequest = handler .getScoreNotificationRequest ();
447+
448+ assertTrue ("The ScoreNotificationRequest should be present" , optionalRequest .isPresent ());
449+
450+ ScoreNotificationRequest request = optionalRequest .get ();
451+ assertEquals (ScoreNotificationRequest .TypeEnum .BALANCEPLATFORM_SCORE_TRIGGERED , request .getType ());
452+ assertEquals ("test" , request .getEnvironment ());
453+
454+ BankScoreSignalTriggeredData data = request .getData ();
455+ assertNotNull (data );
456+ assertEquals ("2235e7be-fcb0-4b88-a79b-895b68cfb855" , data .getId ());
457+ assertEquals (Integer .valueOf (100 ), data .getRiskScore ());
458+
459+ assertNotNull (data .getAccountHolder ());
460+ assertEquals ("AH00000000000001" , data .getAccountHolder ().getId ());
461+
462+ assertNotNull (data .getScoreSignalsTriggered ());
463+ assertEquals (2 , data .getScoreSignalsTriggered ().size ());
464+ assertEquals ("ChargebackCardholderDispute" , data .getScoreSignalsTriggered ().get (0 ));
465+ assertEquals ("ChargebackNonReceipt" , data .getScoreSignalsTriggered ().get (1 ));
466+ }
439467}
0 commit comments