SigningMediaPackageSerializer implements MediaPackageSerializer, ManagedService { @SuppressWarnings("rawtypes") @Override public void updated(Dictionary properties) throws ConfigurationException { expireSeconds = UrlSigningServiceOsgiUtil.getUpdatedSigningExpiration(properties, this.getClass().getSimpleName()); signWithClientIP = UrlSigningServiceOsgiUtil.getUpdatedSignWithClientIP(properties, this.getClass().getSimpleName()); } SigningMediaPackageSerializer(); void setUrlSigningService(UrlSigningService urlSigningService); @SuppressWarnings("rawtypes") @Override void updated(Dictionary properties); @Override URI encodeURI(URI uri); @Override URI decodeURI(URI uri); @Override int getRanking(); @Override String toString(); static final int RANKING; }
@Test public void testUpdated() throws ConfigurationException { Long testValue = 1339L; Properties properties = new Properties(); SigningMediaPackageSerializer serializer = new SigningMediaPackageSerializer(); assertEquals(new Long(UrlSigningServiceOsgiUtil.DEFAULT_URL_SIGNING_EXPIRE_DURATION), serializer.getExpirationSeconds()); serializer.updated(properties); assertEquals(new Long(UrlSigningServiceOsgiUtil.DEFAULT_URL_SIGNING_EXPIRE_DURATION), serializer.getExpirationSeconds()); properties.put(UrlSigningServiceOsgiUtil.URL_SIGNING_EXPIRES_DURATION_SECONDS_KEY, testValue.toString()); serializer.updated(properties); assertEquals(testValue, serializer.getExpirationSeconds()); }