@Test
public void testToBase64EncodedPolicy() throws UnsupportedEncodingException {

  String resource = "http://mh-allinone/";
  DateTime before = new DateTime(2015, 03, 01, 00, 46, 17, 0, DateTimeZone.UTC);
  Policy policy = Policy.mkSimplePolicy("http://mh-allinone/", before);
  Policy result = PolicyUtils.fromBase64EncodedPolicy(PolicyUtils.toBase64EncodedPolicy(policy));
  assertEquals(resource, result.getBaseUrl());
  assertEquals(before, result.getValidUntil());
}