JSONDDMStorageAdapter implements DDMStorageAdapter { @Override public DDMStorageAdapterDeleteResponse delete( DDMStorageAdapterDeleteRequest ddmStorageAdapterDeleteRequest) throws StorageException { try { ddmContentLocalService.deleteDDMContent( ddmStorageAdapterDeleteRequest.getPrimaryKey()); DDMStorageAdapterDeleteResponse.Builder builder = DDMStorageAdapterDeleteResponse.Builder.newBuilder(); return builder.build(); } catch (Exception exception) { throw new StorageException(exception); } }  @Override DDMStorageAdapterDeleteResponse delete(
			DDMStorageAdapterDeleteRequest ddmStorageAdapterDeleteRequest); @Override DDMStorageAdapterGetResponse get(
			DDMStorageAdapterGetRequest ddmStorageAdapterGetRequest); @Override DDMStorageAdapterSaveResponse save(
			DDMStorageAdapterSaveRequest ddmStorageAdapterSaveRequest);  }
@Test public void testDelete() throws Exception { DDMStorageAdapterDeleteRequest.Builder builder = DDMStorageAdapterDeleteRequest.Builder.newBuilder(1); DDMStorageAdapterDeleteResponse expectedResponse = _jsonDDMStorageAdapter.delete(builder.build()); Assert.assertTrue(expectedResponse.isDeleted()); Mockito.verify( _ddmContentLocalService, Mockito.times(1) ).deleteDDMContent( 1 ); }
@Test(expected = StorageException.class) public void testDeleteException() throws Exception { when( _ddmContentLocalService.deleteDDMContent(2) ).thenThrow( Exception.class ); DDMStorageAdapterDeleteRequest.Builder builder = DDMStorageAdapterDeleteRequest.Builder.newBuilder(2); _jsonDDMStorageAdapter.delete(builder.build()); }