File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
main/java/com/ericsson/ei/subscriptionhandler
test/java/com/ericsson/ei/subscriptionhandler/test Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,9 @@ public void validateSubscription(Subscription subscription) throws SubscriptionV
46
46
this .validateNotificationMessageKeyValues (subscription .getNotificationMessageKeyValues (), subscription .getRestPostBodyMediaType () );
47
47
this .validateNotificationMeta (subscription .getNotificationMeta ());
48
48
this .validateNotificationType (subscription .getNotificationType ());
49
- this .RestPostMediaType (subscription .getRestPostBodyMediaType ());
49
+ if (subscription .getNotificationType ().equals ("REST_POST" )) {
50
+ this .RestPostMediaType (subscription .getRestPostBodyMediaType ());
51
+ }
50
52
// List<Requirement> reqList = subscription.getRequirements();
51
53
// for (int i=0; i < reqList.size(); i++) {
52
54
// this.validateJmespath(reqList.get(i).getConditions().get(0).getJmespath());
@@ -87,7 +89,7 @@ public void validateNotificationMessageKeyValues(List<NotificationMessageKeyValu
87
89
String test_key = item .getFormkey ();
88
90
String test_value = item .getFormvalue ();
89
91
90
- if (restPostBodyMediaType .equals (MediaType .APPLICATION_FORM_URLENCODED .toString ())) { // FORM/POST PARAMETERS
92
+ if (restPostBodyMediaType != null && restPostBodyMediaType .equals (MediaType .APPLICATION_FORM_URLENCODED .toString ())) { // FORM/POST PARAMETERS
91
93
if ((test_key == null || test_key .isEmpty () || StringUtils .isBlank (test_key )) || (test_value == null || test_value .isEmpty () || StringUtils .isBlank (test_value ))){
92
94
throw new SubscriptionValidationException ("Value & Key in notificationMessage must have a values: " + notificationMessage );
93
95
}
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ public SubscriptionValidatorTest() {
75
75
subscritptionInvalid .setSubscriptionName ("Kalle1" );
76
76
77
77
// new stuff
78
- subscritptionInvalid .setRestPostBodyMediaType (MediaType . APPLICATION_FORM_URLENCODED . toString () );
78
+ subscritptionInvalid .setRestPostBodyMediaType (null );
79
79
80
80
NotificationMessageKeyValue notificationMessageKeyValueinvalid = new NotificationMessageKeyValue ();
81
81
notificationMessageKeyValueinvalid .setFormkey ("" );
You can’t perform that action at this time.
0 commit comments