File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
tests/objectbox-java-test/src/test/java/io/objectbox Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,26 @@ public void testRemoveMany() {
136
136
assertEquals (0 , box .count ());
137
137
}
138
138
139
+ // https://github.com/objectbox/objectbox-java/issues/626
140
+ @ Test
141
+ public void testGetAllAfterGetAndRemove () {
142
+ assertEquals (0 , box .count ());
143
+ assertEquals (0 , box .getAll ().size ());
144
+
145
+ List <TestEntity > entities = putTestEntities (10 );
146
+
147
+ // explicitly get an entity (any will do)
148
+ TestEntity entity = box .get (entities .get (1 ).getId ());
149
+ assertNotNull (entity );
150
+
151
+ box .removeAll ();
152
+
153
+ assertEquals (0 , box .count ());
154
+ List <TestEntity > all = box .getAll ();
155
+ // note only 1 entity is returned by getAll, it is the one we explicitly get (last) above
156
+ assertEquals (0 , all .size ());
157
+ }
158
+
139
159
@ Test
140
160
public void testPanicModeRemoveAllObjects () {
141
161
assertEquals (0 , box .panicModeRemoveAll ());
You can’t perform that action at this time.
0 commit comments