|
20 | 20 |
|
21 | 21 | package com.arangodb; |
22 | 22 |
|
23 | | -import static org.hamcrest.Matchers.hasItem; |
24 | | -import static org.hamcrest.Matchers.is; |
25 | | -import static org.hamcrest.Matchers.not; |
26 | | -import static org.hamcrest.Matchers.notNullValue; |
27 | | -import static org.hamcrest.Matchers.nullValue; |
28 | | -import static org.junit.Assert.assertThat; |
29 | | -import static org.junit.Assert.fail; |
30 | | -import static org.junit.Assume.assumeTrue; |
31 | | - |
32 | | -import java.util.ArrayList; |
33 | | -import java.util.Arrays; |
34 | | -import java.util.Collection; |
35 | | - |
| 23 | +import com.arangodb.ArangoDB.Builder; |
36 | 24 | import com.arangodb.entity.*; |
37 | 25 | import com.arangodb.model.*; |
38 | 26 | import org.junit.After; |
|
41 | 29 | import org.junit.runner.RunWith; |
42 | 30 | import org.junit.runners.Parameterized; |
43 | 31 |
|
44 | | -import com.arangodb.ArangoDB.Builder; |
| 32 | +import java.util.ArrayList; |
| 33 | +import java.util.Arrays; |
| 34 | +import java.util.Collection; |
| 35 | + |
| 36 | +import static org.hamcrest.Matchers.*; |
| 37 | +import static org.junit.Assert.assertThat; |
| 38 | +import static org.junit.Assert.fail; |
| 39 | +import static org.junit.Assume.assumeTrue; |
45 | 40 |
|
46 | 41 | /** |
47 | 42 | * @author Mark Vollmary |
@@ -266,9 +261,14 @@ public void replaceEdgeIfMatchFail() { |
266 | 261 | db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).replaceEdge(createResult.getKey(), doc, options); |
267 | 262 | fail(); |
268 | 263 | } catch (final ArangoDBException e) { |
269 | | - // FIXME: atm the server replies 409 for HTTP_JSON or HTTP_VPACK |
270 | | - // assertThat(e.getResponseCode(), is(412)); |
271 | | - assertThat(e.getErrorNum(), is(1200)); |
| 264 | + if (isAtLeastVersion(3, 4)) { |
| 265 | + // FIXME: atm the server replies 409 for HTTP_JSON or HTTP_VPACK |
| 266 | + // assertThat(e.getResponseCode(), is(412)); |
| 267 | + assertThat(e.getErrorNum(), is(1200)); |
| 268 | + } else { |
| 269 | + assertThat(e.getResponseCode(), is(412)); |
| 270 | + assertThat(e.getErrorNum(), is(1903)); |
| 271 | + } |
272 | 272 | } |
273 | 273 | } |
274 | 274 |
|
@@ -351,9 +351,14 @@ public void updateEdgeIfMatchFail() { |
351 | 351 | db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).updateEdge(createResult.getKey(), doc, options); |
352 | 352 | fail(); |
353 | 353 | } catch (final ArangoDBException e) { |
354 | | - // FIXME: atm the server replies 409 for HTTP_JSON or HTTP_VPACK |
355 | | - // assertThat(e.getResponseCode(), is(412)); |
356 | | - assertThat(e.getErrorNum(), is(1200)); |
| 354 | + if (isAtLeastVersion(3, 4)) { |
| 355 | + // FIXME: atm the server replies 409 for HTTP_JSON or HTTP_VPACK |
| 356 | + // assertThat(e.getResponseCode(), is(412)); |
| 357 | + assertThat(e.getErrorNum(), is(1200)); |
| 358 | + } else { |
| 359 | + assertThat(e.getResponseCode(), is(412)); |
| 360 | + assertThat(e.getErrorNum(), is(1903)); |
| 361 | + } |
357 | 362 | } |
358 | 363 | } |
359 | 364 |
|
@@ -430,9 +435,14 @@ public void deleteEdgeIfMatchFail() { |
430 | 435 | db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).deleteEdge(createResult.getKey(), options); |
431 | 436 | fail(); |
432 | 437 | } catch (final ArangoDBException e) { |
433 | | - // FIXME: atm the server replies 409 for HTTP_JSON or HTTP_VPACK |
434 | | - // assertThat(e.getResponseCode(), is(412)); |
435 | | - assertThat(e.getErrorNum(), is(1200)); |
| 438 | + if (isAtLeastVersion(3, 4)) { |
| 439 | + // FIXME: atm the server replies 409 for HTTP_JSON or HTTP_VPACK |
| 440 | + // assertThat(e.getResponseCode(), is(412)); |
| 441 | + assertThat(e.getErrorNum(), is(1200)); |
| 442 | + } else { |
| 443 | + assertThat(e.getResponseCode(), is(412)); |
| 444 | + assertThat(e.getErrorNum(), is(1903)); |
| 445 | + } |
436 | 446 | } |
437 | 447 | } |
438 | 448 | } |
0 commit comments