@Test public void testRevokeConsent() throws Exception { final MemoryStorageService ss = getMemoryStorageService(); ss.create( "context", "key", ConsentTestingSupport.newConsentMap(), ((AbstractConsentStorageAction) action).getStorageSerializer(), null); Assert.assertNotNull(ss.read("context", "key")); ss.create( "context", "_index", Collections.singletonList("key"), ((AbstractConsentIndexedStorageAction) action).getStorageKeysSerializer(), null); action.initialize(); final Event event = action.execute(src); ActionTestingSupport.assertProceedEvent(event); Assert.assertNull(ss.read("context", "key")); Assert.assertTrue(readStorageKeysFromIndex().isEmpty()); }
@Test public void testRevokeEmptyStorage() throws Exception { action.initialize(); final Event event = action.execute(src); ActionTestingSupport.assertProceedEvent(event); }