/** * Accuracy test for the method <code>deleteProjectMetadataKey(long projectMetadataKeyId, * long userId)</code>.<br> * The result should be correct. * * @throws Exception to JUnit. */ @Test public void test_deleteProjectMetadataKey() throws Exception { instance.createProjectMetadataKey(projectMetadataKey, userId); instance.deleteProjectMetadataKey(projectMetadataKey.getId(), userId); assertNull( "'deleteProjectMetadataKey' should be correct.", em.find(DirectProjectMetadataKey.class, projectMetadataKey.getId())); }
/** * Failure test for the method <code>deleteProjectMetadataKey(long projectMetadataKeyId, * long userId)</code> with requested entity is not found in db.<br> * <code>EntityNotFoundException</code> is expected. * * @throws Exception to JUnit. */ @Test(expected = EntityNotFoundException.class) public void test_deleteProjectMetadataKey_EntityNotFoundError() throws Exception { instance.deleteProjectMetadataKey(Long.MAX_VALUE, userId); }