TieredStorageAssetManagerJobProducer extends AbstractJobProducer { protected String internalMoveByIdAndVersion(final VersionImpl version, final String mpId, final String targetStorage) throws NotFoundException { tsam.moveSnapshotToStore(version, mpId, targetStorage); return OK; } TieredStorageAssetManagerJobProducer(); @Override void activate(ComponentContext cc); boolean datastoreExists(String storeId); Job moveByIdAndVersion(final Version version, final String mpId, final String targetStorage); Job moveById(final String mpId, final String targetStorage); Job moveByDate(final Date start, final Date end, final String targetStorage); Job moveByIdAndDate(final String mpId, final Date start, final Date end, final String targetStorage); static final String JOB_TYPE; static final Float JOB_LOAD; static final Float NONTERMINAL_JOB_LOAD; }
@Test public void testInternalByIdAndVersion() throws NotFoundException, ServiceRegistryException { String[] mp = createAndAddMediaPackagesSimple(2, 2, 2, Opt.<String>none()); createIdAndVersionExpectation(mp[1], 1, 1); EasyMock.replay(sr); Assert.assertEquals("Only one version should move", "OK", tsamjp.internalMoveByIdAndVersion(new VersionImpl(1L), mp[1], REMOTE_STORE_1_ID)); EasyMock.verify(sr); }
@Test(expected = NotFoundException.class) public void testNotFoundInternalByIdAndVersion() throws NotFoundException { EasyMock.replay(sr); Assert.assertEquals("Only one version should move", "1", tsamjp.internalMoveByIdAndVersion(new VersionImpl(5L), "fake", REMOTE_STORE_1_ID)); }