1
1
use super :: Result ;
2
+ use super :: notification_service:: NotificationServiceApi ;
3
+ use super :: notification_service:: event:: IdentityChainEvent ;
2
4
use crate :: data:: validate_node_id_network;
3
5
use crate :: external:: file_storage:: FileStorageClientApi ;
4
6
use crate :: util:: file:: UploadFileType ;
@@ -17,8 +19,6 @@ use async_trait::async_trait;
17
19
use bcr_ebill_core:: identity:: validation:: { validate_create_identity, validate_update_identity} ;
18
20
use bcr_ebill_core:: identity:: { ActiveIdentityState , IdentityType } ;
19
21
use bcr_ebill_core:: { NodeId , ServiceTraitBounds , ValidationError } ;
20
- use bcr_ebill_transport:: NotificationServiceApi ;
21
- use bcr_ebill_transport:: event:: identity_events:: IdentityChainEvent ;
22
22
use log:: { debug, error, info} ;
23
23
use std:: sync:: Arc ;
24
24
@@ -678,9 +678,10 @@ mod tests {
678
678
use super :: * ;
679
679
use crate :: {
680
680
external:: file_storage:: MockFileStorageClientApi ,
681
+ service:: notification_service:: MockNotificationServiceApi ,
681
682
tests:: tests:: {
682
683
MockFileUploadStoreApiMock , MockIdentityChainStoreApiMock , MockIdentityStoreApiMock ,
683
- MockNotificationService , empty_identity, empty_optional_address, init_test_cfg,
684
+ empty_identity, empty_optional_address, init_test_cfg,
684
685
} ,
685
686
} ;
686
687
use mockall:: predicate:: eq;
@@ -691,14 +692,14 @@ mod tests {
691
692
Arc :: new ( MockFileUploadStoreApiMock :: new ( ) ) ,
692
693
Arc :: new ( MockFileStorageClientApi :: new ( ) ) ,
693
694
Arc :: new ( MockIdentityChainStoreApiMock :: new ( ) ) ,
694
- Arc :: new ( MockNotificationService :: new ( ) ) ,
695
+ Arc :: new ( MockNotificationServiceApi :: new ( ) ) ,
695
696
)
696
697
}
697
698
698
699
fn get_service_with_chain_storage (
699
700
mock_storage : MockIdentityStoreApiMock ,
700
701
mock_chain_storage : MockIdentityChainStoreApiMock ,
701
- notification : MockNotificationService ,
702
+ notification : MockNotificationServiceApi ,
702
703
) -> IdentityService {
703
704
IdentityService :: new (
704
705
Arc :: new ( mock_storage) ,
@@ -722,7 +723,7 @@ mod tests {
722
723
. returning ( || Ok ( BcrKeys :: new ( ) ) ) ;
723
724
let mut chain_storage = MockIdentityChainStoreApiMock :: new ( ) ;
724
725
chain_storage. expect_add_block ( ) . returning ( |_| Ok ( ( ) ) ) ;
725
- let mut notification = MockNotificationService :: new ( ) ;
726
+ let mut notification = MockNotificationServiceApi :: new ( ) ;
726
727
notification
727
728
. expect_send_identity_chain_events ( )
728
729
. returning ( |_| Ok ( ( ) ) )
@@ -762,7 +763,7 @@ mod tests {
762
763
. returning ( || Ok ( BcrKeys :: new ( ) ) ) ;
763
764
let mut chain_storage = MockIdentityChainStoreApiMock :: new ( ) ;
764
765
chain_storage. expect_add_block ( ) . returning ( |_| Ok ( ( ) ) ) ;
765
- let mut notification = MockNotificationService :: new ( ) ;
766
+ let mut notification = MockNotificationServiceApi :: new ( ) ;
766
767
notification
767
768
. expect_send_identity_chain_events ( )
768
769
. returning ( |_| Ok ( ( ) ) )
@@ -816,7 +817,7 @@ mod tests {
816
817
. clone ( ) ,
817
818
)
818
819
} ) ;
819
- let mut notification = MockNotificationService :: new ( ) ;
820
+ let mut notification = MockNotificationServiceApi :: new ( ) ;
820
821
notification
821
822
. expect_send_identity_chain_events ( )
822
823
. returning ( |_| Ok ( ( ) ) )
@@ -861,7 +862,7 @@ mod tests {
861
862
} ) ;
862
863
let mut chain_storage = MockIdentityChainStoreApiMock :: new ( ) ;
863
864
chain_storage. expect_add_block ( ) . returning ( |_| Ok ( ( ) ) ) ;
864
- let mut notification = MockNotificationService :: new ( ) ;
865
+ let mut notification = MockNotificationServiceApi :: new ( ) ;
865
866
notification. expect_send_identity_chain_events ( ) . never ( ) ;
866
867
867
868
let service = get_service_with_chain_storage ( storage, chain_storage, notification) ;
@@ -906,7 +907,7 @@ mod tests {
906
907
} ) ;
907
908
let mut chain_storage = MockIdentityChainStoreApiMock :: new ( ) ;
908
909
chain_storage. expect_add_block ( ) . returning ( |_| Ok ( ( ) ) ) ;
909
- let mut notification = MockNotificationService :: new ( ) ;
910
+ let mut notification = MockNotificationServiceApi :: new ( ) ;
910
911
notification. expect_send_identity_chain_events ( ) . never ( ) ;
911
912
912
913
let service = get_service_with_chain_storage ( storage, chain_storage, notification) ;
@@ -956,7 +957,7 @@ mod tests {
956
957
)
957
958
} ) ;
958
959
chain_storage. expect_add_block ( ) . returning ( |_| Ok ( ( ) ) ) ;
959
- let mut notification = MockNotificationService :: new ( ) ;
960
+ let mut notification = MockNotificationServiceApi :: new ( ) ;
960
961
notification
961
962
. expect_send_identity_chain_events ( )
962
963
. returning ( |_| Ok ( ( ) ) )
@@ -1046,7 +1047,7 @@ mod tests {
1046
1047
. expect_add_block ( )
1047
1048
. returning ( |_| Ok ( ( ) ) )
1048
1049
. once ( ) ;
1049
- let mut notification = MockNotificationService :: new ( ) ;
1050
+ let mut notification = MockNotificationServiceApi :: new ( ) ;
1050
1051
notification. expect_send_identity_chain_events ( ) . never ( ) ;
1051
1052
1052
1053
let service = get_service_with_chain_storage ( storage, chain_storage, notification) ;
0 commit comments