1
2
3
4
5
6
7
8
9
10
11 package psiprobe.beans.accessors;
12
13 import com.zaxxer.hikari.HikariDataSource;
14
15 import java.sql.SQLException;
16
17 import mockit.Mocked;
18 import mockit.Tested;
19
20 import org.apache.openejb.resource.jdbc.managed.local.ManagedDataSource;
21 import org.junit.jupiter.api.Assertions;
22 import org.junit.jupiter.api.BeforeEach;
23 import org.junit.jupiter.api.Disabled;
24 import org.junit.jupiter.api.Test;
25
26
27
28
29 class OpenEjbManagedDatasourceAccessorTest {
30
31
32 @Tested
33 OpenEjbManagedDatasourceAccessor accessor;
34
35
36 @Mocked
37 ManagedDataSource source;
38
39
40 HikariDataSource badSource;
41
42
43
44
45 @BeforeEach
46 void before() {
47 accessor = new OpenEjbManagedDatasourceAccessor();
48 badSource = new HikariDataSource();
49 }
50
51
52
53
54 @Disabled
55 @Test
56 void canMapTest() {
57 Assertions.assertTrue(accessor.canMap(source));
58 }
59
60
61
62
63 @Test
64 void cannotMapTest() {
65 Assertions.assertFalse(accessor.canMap(badSource));
66 }
67
68
69
70
71
72
73 @Test
74 void getInfoTest() throws SQLException {
75 accessor.getInfo(source);
76 }
77
78 }