4
4
package org .lfenergy .compas .scl .data .rest ;
5
5
6
6
import org .junit .jupiter .api .Test ;
7
+ import org .lfenergy .compas .scl .data .basex .client .BaseXClient ;
7
8
import org .lfenergy .compas .scl .data .basex .client .BaseXClientFactory ;
8
9
import org .lfenergy .compas .scl .data .util .SclDataModelMarshaller ;
9
10
11
+ import java .io .IOException ;
12
+
10
13
import static org .junit .jupiter .api .Assertions .assertNotNull ;
11
14
import static org .mockito .Mockito .mock ;
15
+ import static org .mockito .Mockito .when ;
12
16
13
17
class CompasSclDataServiceBaseXConfigurationTest {
14
18
@ Test
@@ -18,11 +22,12 @@ void createBaseXClientFactoryProduction_WhenCalled_ThenObjectReturned() {
18
22
}
19
23
20
24
@ Test
21
- void creatCompasSclDataRepositoryProduction_WhenCalled_ThenObjectReturned () {
25
+ void creatCompasSclDataRepositoryProduction_WhenCalled_ThenObjectReturned () throws IOException {
22
26
var baseXClientFactory = mock (BaseXClientFactory .class );
23
- ;
24
27
var sclDataModelMarshaller = mock (SclDataModelMarshaller .class );
25
28
29
+ when (baseXClientFactory .createClient ()).thenReturn (mock (BaseXClient .class ));
30
+
26
31
assertNotNull (new CompasSclDataServiceBaseXConfiguration ()
27
32
.creatCompasSclDataRepositoryProduction (baseXClientFactory , sclDataModelMarshaller ));
28
33
}
@@ -34,11 +39,12 @@ void createBaseXClientFactoryDevelopment_WhenCalled_ThenObjectReturned() {
34
39
}
35
40
36
41
@ Test
37
- void creatCompasSclDataRepositoryDevelopment_WhenCalled_ThenObjectReturned () {
42
+ void creatCompasSclDataRepositoryDevelopment_WhenCalled_ThenObjectReturned () throws IOException {
38
43
var baseXClientFactory = mock (BaseXClientFactory .class );
39
- ;
40
44
var sclDataModelMarshaller = mock (SclDataModelMarshaller .class );
41
45
46
+ when (baseXClientFactory .createClient ()).thenReturn (mock (BaseXClient .class ));
47
+
42
48
assertNotNull (new CompasSclDataServiceBaseXConfiguration ()
43
49
.creatCompasSclDataRepositoryDevelopment (baseXClientFactory , sclDataModelMarshaller ));
44
50
}
0 commit comments