File tree Expand file tree Collapse file tree 7 files changed +655
-602
lines changed
java/com/ericsson/ei/notifications/ttl
main/java/com/ericsson/ei
test/java/com/ericsson/ei/queryservice/test Expand file tree Collapse file tree 7 files changed +655
-602
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 3
3
@TtlAndNotifications
4
4
Feature : TestTTL
5
5
6
- @TestTTL
7
- Scenario : Test time to live for missed notification and aggregated object
8
- Given Missed notification is created in database with index "expTime"
9
- And Aggregated object is created in database with index "expTime"
10
- Then "aggregated_object" document has been deleted from "eiffel_intelligence" database
11
- And "Notification" document has been deleted from "MissedNotification" database
12
-
13
6
@TestNotificationRetries
14
7
Scenario : Test notification retries
15
8
Given Subscription is created
16
9
When I want to inform subscriber
17
10
Then Verify that request has been retried
18
11
And Check missed notification is in database
12
+
13
+ @TestTTLforAutomaticSubscriptionTrigger
14
+ Scenario : Test time to live for missed notification and aggregated object with an automatic subscription trigger flow setup
15
+ Given A subscription is created at the end point "/subscriptions" with non-existent notification meta
16
+ And I send an Eiffel event and consequently aggregated object and thereafter missed notification is created
17
+ Then the Notification document should be deleted from the database according to ttl value
18
+ And the Aggregated Object document should be deleted from the database according to ttl value
Original file line number Diff line number Diff line change
1
+ [
2
+ {
3
+ "subscriptionName" : " Subscription_Test_3" ,
4
+ "repeat" : false ,
5
+ "created" : 1523473956269 ,
6
+ "notificationType" : " REST_POST" ,
7
+ "notificationMeta" : " http://eiffel-jenkins3:8080/job/ei-artifact-triggered-job/build" ,
8
+ "restPostBodyMediaType" : " application/x-www-form-urlencoded" ,
9
+ "notificationMessageKeyValues" : [
10
+ {
11
+ "formkey" : " json" ,
12
+ "formvalue" : " {parameter: [{ name: 'jsonparams', value : to_string(@) }]}"
13
+ }
14
+ ],
15
+ "requirements" : [
16
+ {
17
+ "conditions" : [
18
+ {
19
+ "jmespath" : " gav.groupId=='com.mycompany.myproduct'"
20
+ }
21
+ ]
22
+ }
23
+ ]
24
+ }
25
+ ]
Original file line number Diff line number Diff line change
1
+ package com .ericsson .ei .handlers ;
2
+
3
+ import java .text .DateFormat ;
4
+ import java .text .ParseException ;
5
+ import java .text .SimpleDateFormat ;
6
+ import java .util .Date ;
7
+
8
+ import org .slf4j .Logger ;
9
+ import org .slf4j .LoggerFactory ;
10
+
11
+
12
+ public class DateUtils {
13
+ /**
14
+ * This method creates the date object with
15
+ * the current date for appending in the document
16
+ * object before inserting it into mongoDB.
17
+ */
18
+ public static Date getDate () throws ParseException {
19
+ Logger log = (Logger ) LoggerFactory .getLogger (ObjectHandler .class );
20
+ Date date = new Date ();
21
+ try {
22
+ DateFormat dateFormat = new SimpleDateFormat ("yyyy/MM/dd HH:mm:ss" );
23
+ String time = dateFormat .format (date );
24
+ date = dateFormat .parse (time );
25
+ } catch (Exception e ) {
26
+ log .error (e .getMessage (), e );
27
+ }
28
+ return date ;
29
+ }
30
+ }
You can’t perform that action at this time.
0 commit comments