|
16 | 16 | import com.marklogic.client.DatabaseClient; |
17 | 17 | import com.marklogic.client.DatabaseClientFactory; |
18 | 18 | import com.marklogic.client.DatabaseClientFactory.Authentication; |
19 | | -import com.marklogic.client.MarkLogicIOException; |
| 19 | +import com.marklogic.client.ResourceNotFoundException; |
20 | 20 | import com.marklogic.client.document.DocumentManager.Metadata; |
21 | | -import com.marklogic.client.document.DocumentPatchBuilder; |
22 | 21 | import com.marklogic.client.document.DocumentWriteSet; |
23 | 22 | import com.marklogic.client.document.JSONDocumentManager; |
24 | 23 | import com.marklogic.client.io.DocumentMetadataHandle; |
25 | 24 | import com.marklogic.client.io.DocumentMetadataHandle.Capability; |
26 | | -import com.marklogic.client.io.DocumentMetadataHandle.DocumentCollections; |
27 | | -import com.marklogic.client.io.DocumentMetadataHandle.DocumentPermissions; |
28 | | -import com.marklogic.client.io.DocumentMetadataHandle.DocumentProperties; |
29 | 25 | import com.marklogic.client.io.Format; |
30 | 26 | import com.marklogic.client.io.JacksonHandle; |
31 | 27 | import com.marklogic.client.pojo.PojoRepository; |
32 | 28 | import com.marklogic.client.pojo.annotation.Id; |
33 | | -import com.marklogic.javaclient.TestPOJOMissingIdGetSetMethod.SmallArtifactMissingGetter; |
34 | 29 |
|
35 | 30 | public class TestPOJOWithDocsStoredByOthers extends BasicJavaClientREST { |
36 | 31 |
|
@@ -251,7 +246,7 @@ public void validateSmallArtifact(SmallArtifactIdInSuper artifact) { |
251 | 246 | public void validateSmallArtifactSuper(SmallArtifactNoId artifact) { |
252 | 247 | assertNotNull("Artifact object should never be Null", artifact); |
253 | 248 | assertNotNull("Id should never be Null", artifact.getId()); |
254 | | - assertEquals("Id of the object is ", -99, artifact.getId()); |
| 249 | + assertEquals("Id of the object is ", 0, artifact.getId()); |
255 | 250 | assertEquals("Name of the object is ", "SmallArtifactInSuperOnly", |
256 | 251 | artifact.getName()); |
257 | 252 | assertEquals("Inventory of the object is ", 1000, |
@@ -333,7 +328,7 @@ public void validateSubObjReferencedbySuperClassvariableOne(SmallArtifactIdInSup |
333 | 328 | * Issue 136 might solve this also. |
334 | 329 | */ |
335 | 330 |
|
336 | | - @Test |
| 331 | + @Test(expected=IllegalArgumentException.class) |
337 | 332 | public void testPOJOReadDocStoredWithInvalidContent() throws Exception { |
338 | 333 |
|
339 | 334 | String docId[] = { "com.marklogic.javaclient.TestPOJOWithDocsStoredByOthers$SmallArtifactIdInSuper/SmallArtifactIdInSuper.json" }; |
@@ -420,11 +415,11 @@ public void testPOJOReadDocStoredWithNoBeanProperty() throws Exception { |
420 | 415 | * Purpose : This test is to validate read documents with valid POJO |
421 | 416 | * specific URI and has invalid data-types for one of the bean property. |
422 | 417 | * Uses SmallArtifact class which has @Id on the name methods. Test result |
423 | | - * expectations are: read should return exception. |
| 418 | + * expectations are: read should return ResourceNotFoundException exception. |
424 | 419 | * Field inventory has a String |
425 | 420 | */ |
426 | 421 |
|
427 | | - @Test(/*expected=MarkLogicIOException.class*/) |
| 422 | + @Test(expected=ResourceNotFoundException.class) |
428 | 423 | public void testPOJOReadDocStoredWithInvalidDataType() throws Exception { |
429 | 424 |
|
430 | 425 | String docId[] = { "com.marklogic.javaclient.TestPOJOWithDocsStoredByOthers$SmallArtifact/SmallArtifact.json" }; |
|
0 commit comments