@Test
public void testUpdateBucketPartial() {

    final BucketEntity bucketToUpdate = new BucketEntity();
    bucketToUpdate.setId("b1");
    bucketToUpdate.setName("My Bucket");
    bucketToUpdate.setDescription("This is my bucket");
    bucketToUpdate.setCreated(new Date());
    when(metadataService.getBucketById(bucketToUpdate.getId())).thenReturn(bucketToUpdate);
    doAnswer(updateBucketAnswer()).when(metadataService).updateBucket(any(BucketEntity.class));
    final Bucket updatedBucket = new Bucket();
    updatedBucket.setIdentifier(bucketToUpdate.getId());
    updatedBucket.setName("Updated Name");
    updatedBucket.setDescription(null);
    // name should be updated but description should not be changed
    final Bucket result = registryService.updateBucket(updatedBucket);
    assertNotNull(result);
    assertEquals(updatedBucket.getName(), result.getName());
    assertEquals(bucketToUpdate.getDescription(), result.getDescription());
}