/** * Removes a {@link BlobStoreConfigurationListener} from each {@link BlobStoreConfiguration} * tracked by this aggregator * * @param listener the listener */ public void removeListener(BlobStoreConfigurationListener listener) { for (BlobStoreConfiguration c : getConfigs()) { c.removeBlobStoreListener(listener); } }
@Test public void testRemoveListener() throws Exception { BlobStoreConfigurationListener listener1 = EasyMock.createMock("listener1", BlobStoreConfigurationListener.class); BlobStoreConfigurationListener listener2 = EasyMock.createMock("listener2", BlobStoreConfigurationListener.class); this.config.addBlobStoreListener(listener1); this.config.addBlobStoreListener(listener2); this.config.removeBlobStoreListener(listener1); BlobStoreInfo goodInfo = this.getGoodInfo("test", 1); listener2.handleAddBlobStore(EasyMock.eq(goodInfo)); EasyMock.expectLastCall().once(); EasyMock.replay(listener1, listener2); this.addInfo(this.config, goodInfo); EasyMock.verify(listener1, listener2); }