File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
nitrite/src/test/java/org/dizitart/no2/objects Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 36
36
37
37
import static org .dizitart .no2 .DbTestOperations .getRandomTempDbFile ;
38
38
import static org .junit .Assert .assertEquals ;
39
+ import static org .junit .Assert .assertNotEquals ;
39
40
40
41
/**
41
42
* @author Anindya Chatterjee.
@@ -136,4 +137,21 @@ public void testWithObjectId() {
136
137
object .setWithOutId (id );
137
138
repository .insert (object );
138
139
}
140
+
141
+ @ Test
142
+ public void testExternalNitriteId () {
143
+ ObjectRepository <WithNitriteId > repository = db .getRepository (WithNitriteId .class );
144
+ WithNitriteId obj = new WithNitriteId ();
145
+ NitriteId id = NitriteId .createId (1L );
146
+ obj .setIdField (id );
147
+ obj .setName ("testExternalNitriteId" );
148
+ WriteResult result = repository .update (obj , true );
149
+
150
+ obj = new WithNitriteId ();
151
+ id = result .iterator ().next ();
152
+ obj .setIdField (result .iterator ().next ());
153
+ obj .setName ("testExternalNitriteId" );
154
+ result = repository .update (obj , true );
155
+ assertNotEquals (id .getIdValue (), result .iterator ().next ().getIdValue ());
156
+ }
139
157
}
You can’t perform that action at this time.
0 commit comments