@@ -699,48 +699,48 @@ func TestEventHistory(t *testing.T) {
699
699
topic := wamp .URI ("nexus.test.exact.topic" )
700
700
subscription := broker .topicSubscription [topic ]
701
701
subEvents := broker .eventHistoryStore [subscription ].entries
702
- require .Equalf (t , 3 , len ( subEvents ), "Store for topic %s should hold 3 records" , topic )
703
- require .Truef (t , broker .eventHistoryStore [subscription ].isLimitReached , "Limit for the store for topic %s should be reached" , topic )
704
- require .Equalf (t , "nexus.test.exact.topic" , subEvents [ 0 ] .event .ArgumentsKw ["topic" ], "Event store for topic %s holds invalid event" , topic )
705
- require .Equalf (t , 25509 , subEvents [ 0 ] .event .Arguments [0 ], "Event store for topic %s holds invalid event" , topic )
706
- require .Equalf (t , "nexus.test.exact.topic" , subEvents [ 1 ] .event .ArgumentsKw ["topic" ], "Event store for topic %s holds invalid event" , topic )
707
- require .Equalf (t , 25513 , subEvents [ 1 ] .event .Arguments [0 ], "Event store for topic %s holds invalid event" , topic )
708
- require .Equalf (t , "nexus.test.exact.topic" , subEvents [ 2 ] .event .ArgumentsKw ["topic" ], "Event store for topic %s holds invalid event" , topic )
709
- require .Equalf (t , 25517 , subEvents [ 2 ] .event .Arguments [0 ], "Event store for topic %s holds invalid event" , topic )
702
+ require .Equalf (t , 3 , subEvents . Len ( ), "Store for topic %s should hold 3 records" , topic )
703
+ require .Truef (t , broker .eventHistoryStore [subscription ].atLimit () , "Limit for the store for topic %s should be reached" , topic )
704
+ require .Equalf (t , "nexus.test.exact.topic" , subEvents . At ( 0 ) .event .ArgumentsKw ["topic" ], "Event store for topic %s holds invalid event" , topic )
705
+ require .Equalf (t , 25509 , subEvents . At ( 0 ) .event .Arguments [0 ], "Event store for topic %s holds invalid event" , topic )
706
+ require .Equalf (t , "nexus.test.exact.topic" , subEvents . At ( 1 ) .event .ArgumentsKw ["topic" ], "Event store for topic %s holds invalid event" , topic )
707
+ require .Equalf (t , 25513 , subEvents . At ( 1 ) .event .Arguments [0 ], "Event store for topic %s holds invalid event" , topic )
708
+ require .Equalf (t , "nexus.test.exact.topic" , subEvents . At ( 2 ) .event .ArgumentsKw ["topic" ], "Event store for topic %s holds invalid event" , topic )
709
+ require .Equalf (t , 25517 , subEvents . At ( 2 ) .event .Arguments [0 ], "Event store for topic %s holds invalid event" , topic )
710
710
711
711
topic = wamp .URI ("nexus.test" )
712
712
subscription = broker .pfxTopicSubscription [topic ]
713
713
subEvents = broker .eventHistoryStore [subscription ].entries
714
- require .Equalf (t , 4 , len ( subEvents ), "Store for topic %s should hold 3 records" , topic )
715
- require .Truef (t , broker .eventHistoryStore [subscription ].isLimitReached , "Limit for the store for topic %s should be reached" , topic )
716
- require .Equalf (t , "nexus.test.exact.topic" , subEvents [ 0 ] .event .ArgumentsKw ["topic" ], "Event store for topic %s holds invalid event" , topic )
717
- require .Equalf (t , 25517 , subEvents [ 0 ] .event .Arguments [0 ], "Event store for topic %s holds invalid event" , topic )
718
- require .Equalf (t , "nexus.test.prefix.catch" , subEvents [ 1 ] .event .ArgumentsKw ["topic" ], "Event store for topic %s holds invalid event" , topic )
719
- require .Equalf (t , 25518 , subEvents [ 1 ] .event .Arguments [0 ], "Event store for topic %s holds invalid event" , topic )
720
- require .Equalf (t , "nexus.test.wildcard.topic" , subEvents [ 2 ] .event .ArgumentsKw ["topic" ], "Event store for topic %s holds invalid event" , topic )
721
- require .Equalf (t , 25519 , subEvents [ 2 ] .event .Arguments [0 ], "Event store for topic %s holds invalid event" , topic )
722
- require .Equalf (t , "nexus.test.wildcard.miss" , subEvents [ 3 ] .event .ArgumentsKw ["topic" ], "Event store for topic %s holds invalid event" , topic )
723
- require .Equalf (t , 25520 , subEvents [ 3 ] .event .Arguments [0 ], "Event store for topic %s holds invalid event" , topic )
714
+ require .Equalf (t , 4 , subEvents . Len ( ), "Store for topic %s should hold 3 records" , topic )
715
+ require .Truef (t , broker .eventHistoryStore [subscription ].atLimit () , "Limit for the store for topic %s should be reached" , topic )
716
+ require .Equalf (t , "nexus.test.exact.topic" , subEvents . At ( 0 ) .event .ArgumentsKw ["topic" ], "Event store for topic %s holds invalid event" , topic )
717
+ require .Equalf (t , 25517 , subEvents . At ( 0 ) .event .Arguments [0 ], "Event store for topic %s holds invalid event" , topic )
718
+ require .Equalf (t , "nexus.test.prefix.catch" , subEvents . At ( 1 ) .event .ArgumentsKw ["topic" ], "Event store for topic %s holds invalid event" , topic )
719
+ require .Equalf (t , 25518 , subEvents . At ( 1 ) .event .Arguments [0 ], "Event store for topic %s holds invalid event" , topic )
720
+ require .Equalf (t , "nexus.test.wildcard.topic" , subEvents . At ( 2 ) .event .ArgumentsKw ["topic" ], "Event store for topic %s holds invalid event" , topic )
721
+ require .Equalf (t , 25519 , subEvents . At ( 2 ) .event .Arguments [0 ], "Event store for topic %s holds invalid event" , topic )
722
+ require .Equalf (t , "nexus.test.wildcard.miss" , subEvents . At ( 3 ) .event .ArgumentsKw ["topic" ], "Event store for topic %s holds invalid event" , topic )
723
+ require .Equalf (t , 25520 , subEvents . At ( 3 ) .event .Arguments [0 ], "Event store for topic %s holds invalid event" , topic )
724
724
725
725
topic = wamp .URI ("nexus.test..topic" )
726
726
subscription = broker .wcTopicSubscription [topic ]
727
727
subEvents = broker .eventHistoryStore [subscription ].entries
728
- require .Equalf (t , 4 , len ( subEvents ), "Store for topic %s should hold 3 records" , topic )
729
- require .Truef (t , broker .eventHistoryStore [subscription ].isLimitReached , "Limit for the store for topic %s should be reached" , topic )
730
- require .Equalf (t , "nexus.test.exact.topic" , subEvents [ 0 ] .event .ArgumentsKw ["topic" ], "Event store for topic %s holds invalid event" , topic )
731
- require .Equalf (t , 25513 , subEvents [ 0 ] .event .Arguments [0 ], "Event store for topic %s holds invalid event" , topic )
732
- require .Equalf (t , "nexus.test.wildcard.topic" , subEvents [ 1 ] .event .ArgumentsKw ["topic" ], "Event store for topic %s holds invalid event" , topic )
733
- require .Equalf (t , 25515 , subEvents [ 1 ] .event .Arguments [0 ], "Event store for topic %s holds invalid event" , topic )
734
- require .Equalf (t , "nexus.test.exact.topic" , subEvents [ 2 ] .event .ArgumentsKw ["topic" ], "Event store for topic %s holds invalid event" , topic )
735
- require .Equalf (t , 25517 , subEvents [ 2 ] .event .Arguments [0 ], "Event store for topic %s holds invalid event" , topic )
736
- require .Equalf (t , "nexus.test.wildcard.topic" , subEvents [ 3 ] .event .ArgumentsKw ["topic" ], "Event store for topic %s holds invalid event" , topic )
737
- require .Equalf (t , 25519 , subEvents [ 3 ] .event .Arguments [0 ], "Event store for topic %s holds invalid event" , topic )
728
+ require .Equalf (t , 4 , subEvents . Len ( ), "Store for topic %s should hold 3 records" , topic )
729
+ require .Truef (t , broker .eventHistoryStore [subscription ].atLimit () , "Limit for the store for topic %s should be reached" , topic )
730
+ require .Equalf (t , "nexus.test.exact.topic" , subEvents . At ( 0 ) .event .ArgumentsKw ["topic" ], "Event store for topic %s holds invalid event" , topic )
731
+ require .Equalf (t , 25513 , subEvents . At ( 0 ) .event .Arguments [0 ], "Event store for topic %s holds invalid event" , topic )
732
+ require .Equalf (t , "nexus.test.wildcard.topic" , subEvents . At ( 1 ) .event .ArgumentsKw ["topic" ], "Event store for topic %s holds invalid event" , topic )
733
+ require .Equalf (t , 25515 , subEvents . At ( 1 ) .event .Arguments [0 ], "Event store for topic %s holds invalid event" , topic )
734
+ require .Equalf (t , "nexus.test.exact.topic" , subEvents . At ( 2 ) .event .ArgumentsKw ["topic" ], "Event store for topic %s holds invalid event" , topic )
735
+ require .Equalf (t , 25517 , subEvents . At ( 2 ) .event .Arguments [0 ], "Event store for topic %s holds invalid event" , topic )
736
+ require .Equalf (t , "nexus.test.wildcard.topic" , subEvents . At ( 3 ) .event .ArgumentsKw ["topic" ], "Event store for topic %s holds invalid event" , topic )
737
+ require .Equalf (t , 25519 , subEvents . At ( 3 ) .event .Arguments [0 ], "Event store for topic %s holds invalid event" , topic )
738
738
739
739
topic = wamp .URI ("nexus" )
740
740
subscription = broker .pfxTopicSubscription [topic ]
741
741
subEvents = broker .eventHistoryStore [subscription ].entries
742
- require .Equalf (t , 20 , len ( subEvents ), "Store for topic %s should hold 20 records" , topic )
743
- require .Falsef (t , broker .eventHistoryStore [subscription ].isLimitReached , "Limit for the store for topic %s should not be reached" , topic )
742
+ require .Equalf (t , 20 , subEvents . Len ( ), "Store for topic %s should hold 20 records" , topic )
743
+ require .Falsef (t , broker .eventHistoryStore [subscription ].atLimit () , "Limit for the store for topic %s should not be reached" , topic )
744
744
745
745
//Now let's test Event History MetaRPCs
746
746
topic = wamp .URI ("nexus.test.exact.topic" )
@@ -885,7 +885,7 @@ func TestEventHistory(t *testing.T) {
885
885
// Let's test filtering based on publication ID
886
886
topic = wamp .URI ("nexus" )
887
887
subscription = broker .pfxTopicSubscription [topic ]
888
- pubId := broker .eventHistoryStore [subscription ].entries [ 4 ] .event .Publication
888
+ pubId := broker .eventHistoryStore [subscription ].entries . At ( 4 ) .event .Publication
889
889
inv = wamp.Invocation {
890
890
Request : wamp .ID (reqId ),
891
891
Registration : 0 ,
0 commit comments