9
9
import io .quarkus .test .security .TestSecurity ;
10
10
import io .restassured .http .ContentType ;
11
11
import org .junit .jupiter .api .Test ;
12
- import org .lfenergy .compas .core .jaxrs .JaxrsConstants ;
13
12
import org .lfenergy .compas .scl .validator .exception .NsdocFileNotFoundException ;
14
13
import org .lfenergy .compas .scl .validator .exception .SclValidatorErrorCode ;
15
14
import org .lfenergy .compas .scl .validator .model .NsdocFile ;
22
21
import static io .restassured .path .xml .config .XmlPathConfig .xmlPathConfig ;
23
22
import static org .junit .jupiter .api .Assertions .assertEquals ;
24
23
import static org .junit .jupiter .api .Assertions .assertNotNull ;
24
+ import static org .lfenergy .compas .core .commons .CommonConstants .COMPAS_COMMONS_V1_NS_URI ;
25
25
import static org .lfenergy .compas .scl .validator .SclValidatorConstants .SCL_VALIDATOR_SERVICE_V1_NS_URI ;
26
26
import static org .lfenergy .compas .scl .validator .rest .SclResourceConstants .ID_PARAM ;
27
- import static org .mockito .Mockito .*;
27
+ import static org .mockito .Mockito .verify ;
28
+ import static org .mockito .Mockito .when ;
28
29
29
30
@ QuarkusTest
30
31
@ TestHTTPEndpoint (NsdocResource .class )
@@ -52,7 +53,7 @@ void list_WhenCalled_ThenListReturned() {
52
53
var files = xmlPath .getList ("svs:NsdocListResponse.svs:NsdocFile" );
53
54
assertNotNull (files );
54
55
assertEquals (1 , files .size ());
55
- verify (nsdocService , times ( 1 ) ).list ();
56
+ verify (nsdocService ).list ();
56
57
}
57
58
58
59
@ Test
@@ -78,7 +79,7 @@ void get_WhenCalled_ThenContentReturned() {
78
79
var nsdocFile = xmlPath .getString ("svs:NsdocResponse.svs:NsdocFile" );
79
80
assertNotNull (nsdocFile );
80
81
assertEquals (result , nsdocFile );
81
- verify (nsdocService , times ( 1 ) ).get (id );
82
+ verify (nsdocService ).get (id );
82
83
}
83
84
84
85
@ Test
@@ -99,14 +100,14 @@ void get_WhenCalledWithUnknownFile_Then404Returned() {
99
100
.response ();
100
101
101
102
var xmlPath = response .xmlPath ()
102
- .using (xmlPathConfig ().declaredNamespace ("commons" , JaxrsConstants . COMPAS_COMMONS_V1_NS_URI ));
103
+ .using (xmlPathConfig ().declaredNamespace ("commons" , COMPAS_COMMONS_V1_NS_URI ));
103
104
var messages = xmlPath .getList ("commons:ErrorResponse.commons:ErrorMessage" );
104
105
assertNotNull (messages );
105
106
assertEquals (1 , messages .size ());
106
107
107
108
var code = xmlPath .getString ("commons:ErrorResponse.commons:ErrorMessage.commons:Code" );
108
109
assertEquals (SclValidatorErrorCode .NSDOC_FILE_NOT_FOUND , code );
109
110
110
- verify (nsdocService , times ( 1 ) ).get (id );
111
+ verify (nsdocService ).get (id );
111
112
}
112
113
}
0 commit comments