@@ -829,7 +829,7 @@ public void testIndexAutoCreationDoesnotWorkWithMultipleInequality() {
829829 }
830830
831831 @ Test
832- public void testDocumentTypeIsSetWhenDocumentedAdded () {
832+ public void testDocumentTypeIsSetToFoundWhenFoundDocumentAdded () {
833833 Query query = query ("coll" );
834834 int targetId = allocateQuery (query );
835835 MutableDocument doc = doc ("coll/a" , 10 , map ("foo" , 42 ));
@@ -842,7 +842,20 @@ public void testDocumentTypeIsSetWhenDocumentedAdded() {
842842 }
843843
844844 @ Test
845- public void testDocumentTypeIsUpdatedWhenDocumentedDeleted () {
845+ public void testDocumentTypeIsSetToNoDocumentWhenUnknownDocumentDeleted () {
846+ Query query = query ("coll" );
847+ int targetId = allocateQuery (query );
848+ MutableDocument doc = doc ("coll/a" , 10 , map ("foo" , 42 ));
849+
850+ applyRemoteEvent (removedRemoteEvent (doc .getKey (), 10 , targetId ));
851+
852+ Map <ResourcePath , Integer > expected = new HashMap <>();
853+ expected .put (doc .getKey ().getPath (), 1 ); // 1 is a "no" document
854+ assertThat (getDocumentTypeByPathFromRemoteDocumentsTable ()).containsExactlyEntriesIn (expected );
855+ }
856+
857+ @ Test
858+ public void testDocumentTypeIsUpdatedToNoDocumentWhenFoundDocumentDeleted () {
846859 Query query = query ("coll" );
847860 int targetId = allocateQuery (query );
848861 MutableDocument doc = doc ("coll/a" , 10 , map ("foo" , 42 ));
0 commit comments