File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
tests/objectbox-java-test/src/test/java/io/objectbox/sync Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 22
33import org .junit .Test ;
44
5-
5+ import io . objectbox . AbstractObjectBoxTest ;
66import io .objectbox .BoxStore ;
77
88
9+ import static org .junit .Assert .assertEquals ;
910import static org .junit .Assert .assertFalse ;
11+ import static org .junit .Assert .assertThrows ;
1012
11- public class SyncTest {
13+ public class SyncTest extends AbstractObjectBoxTest {
1214
1315 /**
1416 * Ensure that non-sync native library correctly reports sync client availability.
@@ -29,4 +31,13 @@ public void clientIsNotAvailable() {
2931 public void serverIsNotAvailable () {
3032 assertFalse (BoxStore .isSyncServerAvailable ());
3133 }
34+
35+ @ Test
36+ public void creatingSyncClient_throws () {
37+ IllegalStateException exception = assertThrows (
38+ IllegalStateException .class ,
39+ () -> Sync .client (store , "wss://127.0.0.1" , SyncCredentials .none ())
40+ );
41+ assertEquals ("This ObjectBox library (JNI) does not include sync. Please update your dependencies." , exception .getMessage ());
42+ }
3243}
You can’t perform that action at this time.
0 commit comments