|
25 | 25 | import static org.hamcrest.Matchers.is;
|
26 | 26 | import static org.hamcrest.Matchers.notNullValue;
|
27 | 27 | import static org.hamcrest.Matchers.nullValue;
|
| 28 | +import static org.junit.jupiter.api.Assertions.assertThrows; |
28 | 29 |
|
29 | 30 | import java.util.Arrays;
|
30 | 31 | import java.util.HashMap;
|
|
36 | 37 |
|
37 | 38 | import com.fasterxml.jackson.databind.node.ObjectNode;
|
38 | 39 | import org.junit.jupiter.api.Test;
|
| 40 | +import org.springframework.dao.DataRetrievalFailureException; |
39 | 41 | import org.springframework.data.annotation.Id;
|
40 | 42 | import org.springframework.data.annotation.Transient;
|
41 | 43 | import org.springframework.data.domain.Persistable;
|
@@ -115,6 +117,13 @@ public void getDocument() {
|
115 | 117 | assertThat(customer.getAddress().getZipCode(), is("22162–1010"));
|
116 | 118 | }
|
117 | 119 |
|
| 120 | + |
| 121 | + @Test |
| 122 | + public void deleteUnknownDocument() { |
| 123 | + assertThrows(DataRetrievalFailureException.class, |
| 124 | + () -> template.delete("9999", Customer.class)); |
| 125 | + } |
| 126 | + |
118 | 127 | @Test
|
119 | 128 | public void getDocuments() {
|
120 | 129 | final Customer c1 = new Customer("John", "Doe", 30);
|
@@ -263,6 +272,12 @@ public void queryWithoutBindParams() {
|
263 | 272 | assertThat(customers.get(0).getAge(), is(30));
|
264 | 273 | }
|
265 | 274 |
|
| 275 | + @Test |
| 276 | + public void updateQueryForUnknown() { |
| 277 | + assertThrows(DataRetrievalFailureException.class, |
| 278 | + () -> template.query("UPDATE '9999' WITH { age: 99 } IN `test-customer` RETURN NEW", Customer.class)); |
| 279 | + } |
| 280 | + |
266 | 281 | @SuppressWarnings("rawtypes")
|
267 | 282 | @Test
|
268 | 283 | public void queryMap() {
|
|
0 commit comments