@Test
public void testPut() throws Exception {

  Upload upload = EasyMock.createStrictMock(Upload.class);
  upload.waitForCompletion();
  EasyMock.expectLastCall().once();
  EasyMock.replay(upload);
  EasyMock.expect(s3Transfer.upload(BUCKET_NAME, KEY_VERSION_1 + ASSET_ID + ".xml", sampleFile)).andReturn(upload);
  EasyMock.expect(s3Client.getObject(BUCKET_NAME, KEY_VERSION_1 + ASSET_ID + ".xml")).andReturn(s3Object);
  EasyMock.replay(s3Object, s3Client, s3Transfer);
  StoragePath path = new StoragePath(ORG_ID, MP_ID, new VersionImpl(1L), ASSET_ID);
  store.put(path, Source.mk(uri));
  // Check if mapping saved to db
  AwsAssetMapping mapping = database.findMapping(path);
  Assert.assertNotNull(mapping);
  Assert.assertEquals(ORG_ID, mapping.getOrganizationId());
  Assert.assertEquals(MP_ID, mapping.getMediaPackageId());
  Assert.assertEquals(1L, mapping.getVersion().longValue());
  Assert.assertEquals(ASSET_ID, mapping.getMediaPackageElementId());
}