@Test
@DatabaseSetup(value = DATASET_SERVICE_ADMIN_DOCUMENT_X1)
@DatabaseTearDown(value = DATASET_SERVICE_ADMIN_DOCUMENT_X1, type = DatabaseOperation.DELETE)
public void testRemoveName() throws Exception {
List<DocumentDTO> documents = documentService.findAllByName("document 1");
DocumentDTO document;
assertNotNull(documents);
assertSame(1, documents.size());
document = documents.get(0);
assertNotNull(document);
document.setName(null);
// The deletion should fail (the name of the document is set to "not null")
try {
documentService.update(document);
ModelValidator.validate(document);
fail("The name of a document should not be null.");