Skip to content

Commit 23b1dbe

Browse files
Test creating Sync client throws.
1 parent fa78a7d commit 23b1dbe

File tree

1 file changed

+13
-2
lines changed
  • tests/objectbox-java-test/src/test/java/io/objectbox/sync

1 file changed

+13
-2
lines changed

tests/objectbox-java-test/src/test/java/io/objectbox/sync/SyncTest.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
import org.junit.Test;
44

5-
5+
import io.objectbox.AbstractObjectBoxTest;
66
import io.objectbox.BoxStore;
77

88

9+
import static org.junit.Assert.assertEquals;
910
import 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
}

0 commit comments

Comments
 (0)