@@ -70,7 +70,7 @@ fn load_nonexistent_artifact() {
7070 let artifact_path = "nonexistent_artifact.jar" ;
7171
7272 assert_panics (
73- & format ! ( "Unable to load artifact {}" , artifact_path) ,
73+ & format ! ( "Failed to load the service from {}" , artifact_path) ,
7474 || runtime. load_artifact ( & artifact_path) ,
7575 ) ;
7676}
@@ -84,7 +84,7 @@ fn load_artifact_twice() {
8484 // The second loading attempt should fail.
8585 assert_panics (
8686 & format ! (
87- "Unable to load artifact {}" ,
87+ "Failed to load the service from {}" ,
8888 artifact_path. to_string_lossy( )
8989 ) ,
9090 || runtime. load_artifact ( & artifact_path) ,
@@ -96,9 +96,10 @@ fn load_failing_artifact() {
9696 let runtime = get_runtime ( ) ;
9797 let artifact_path = create_service_artifact_non_loadable ( runtime. get_executor ( ) ) ;
9898
99- assert_panics ( "Unable to load artifact" , || {
100- runtime. load_artifact ( & artifact_path)
101- } ) ;
99+ assert_panics (
100+ "Java exception: com.exonum.binding.core.runtime.ServiceLoadingException;" ,
101+ || runtime. load_artifact ( & artifact_path) ,
102+ ) ;
102103}
103104
104105#[ test]
@@ -108,7 +109,7 @@ fn non_instantiable_service() {
108109 let artifact_id = runtime. load_artifact ( & artifact_path) ;
109110
110111 assert_panics (
111- & format ! ( "Unable to create service for artifact_id [{}]" , artifact_id ) ,
112+ "com.exonum.binding.fakes.services.invalidservice.NonInstantiableService" ,
112113 || runtime. create_service ( & artifact_id) ,
113114 ) ;
114115}
@@ -117,10 +118,9 @@ fn non_instantiable_service() {
117118fn create_service_for_unknown_artifact ( ) {
118119 let runtime = get_runtime ( ) ;
119120
120- assert_panics (
121- "Unable to create service for artifact_id [unknown:artifact:id]" ,
122- || runtime. create_service ( "unknown:artifact:id" ) ,
123- ) ;
121+ assert_panics ( "Unknown artifactId: unknown:artifact:id" , || {
122+ runtime. create_service ( "unknown:artifact:id" )
123+ } ) ;
124124}
125125
126126// Creates a new instance of JavaServiceRuntime for same JVM.
0 commit comments