@Test
public void addRemoveBufferMapping() throws InvalidConfigException, DatabusException {
createBufMult();
PhysicalSourceStaticConfig pConfig = convertToPhysicalSourceConfig(_configSource2).build();
PhysicalPartition pPart = _eventBufferMult.getPhysicalPartition(11);
Assert.assertNotNull(pPart);
DbusEventBuffer buf = _eventBufferMult.getDbusEventBuffer(pConfig.getSources()[0].getLogicalSource());
Assert.assertNotNull(buf);
DbusEventBuffer buf1 = _eventBufferMult.getOneBuffer(pPart);
Assert.assertNotNull(buf1);
Assert.assertTrue(buf == buf1, "same references to the buffer");
// now remove the buffer and the mapping
_eventBufferMult.removeBuffer(pConfig);
_eventBufferMult.deallocateRemovedBuffers(true);
// same should fail
pPart = _eventBufferMult.getPhysicalPartition(11);
Assert.assertNull(pPart);
buf = _eventBufferMult.getDbusEventBuffer(pConfig.getSources()[0].getLogicalSource());
Assert.assertNull(buf);
buf1 = _eventBufferMult.getOneBuffer(pPart);
Assert.assertNull(buf1);