@Test public void testListenerDoesntHearFailureToAddDueToBackend() throws Exception { BlobStoreConfigurationListener listener = EasyMock.createMock("listener", BlobStoreConfigurationListener.class); this.config.addBlobStoreListener(listener); BlobStoreInfo goodInfo = this.getGoodInfo("test", 1); // listener.handleAddBlobStore(EasyMock.eq(badInfo)); EasyMock.expectLastCall().once(); EasyMock.replay(listener); this.failNextWrite(); try { this.addInfo(this.config, goodInfo); } catch (ConfigurationPersistenceException ex) { // Do Nothing } EasyMock.verify(listener); }
@Test public void testListenerDoesntHearFailureToRenameDueToBackend() throws Exception { BlobStoreConfigurationListener listener = EasyMock.createMock("listener", BlobStoreConfigurationListener.class); BlobStoreInfo goodInfo = this.getGoodInfo("test", 1); this.addInfo(this.config, goodInfo); this.config.addBlobStoreListener(listener); EasyMock.replay(listener); this.failNextWrite(); try { this.removeInfo(this.config, "test"); } catch (ConfigurationPersistenceException ex) { // Do Nothing } EasyMock.verify(listener); }
@Test public void testListenerDoesntHearFailureToRemoveDueToBackend() throws Exception { BlobStoreConfigurationListener listener = EasyMock.createMock("listener", BlobStoreConfigurationListener.class); BlobStoreInfo goodInfo = this.getGoodInfo("test", 1); this.addInfo(this.config, goodInfo); this.config.addBlobStoreListener(listener); EasyMock.replay(listener); this.failNextWrite(); try { this.removeInfo(this.config, "test"); } catch (ConfigurationPersistenceException ex) { // Do Nothing } EasyMock.verify(listener); }
@Test public void testListenerDoesntHearFailureToModifyDueToBackend() throws Exception { BlobStoreConfigurationListener listener = EasyMock.createMock("listener", BlobStoreConfigurationListener.class); BlobStoreInfo goodInfo = this.getGoodInfo("test", 1); this.addInfo(this.config, goodInfo); this.config.addBlobStoreListener(listener); goodInfo = this.getGoodInfo("test", 2); EasyMock.replay(listener); this.failNextWrite(); try { this.modifyInfo(this.config, goodInfo); } catch (ConfigurationPersistenceException ex) { // Do Nothing } EasyMock.verify(listener); }