Map attributeValues = attributes.getValue();
final String name = MapValueConverter.getStringAttribute(org.apache.qpid.server.model.Exchange.NAME, attributeValues);
final UUID id = MapValueConverter.getUUIDAttribute(org.apache.qpid.server.model.Exchange.ID, attributeValues);
final ExchangeImpl exchange = mock(ExchangeImpl.class);
ExchangeType exType = mock(ExchangeType.class);
when(exchange.getName()).thenReturn(name);
when(exchange.getId()).thenReturn(id);
when(exchange.getExchangeType()).thenReturn(exType);
final String typeName = MapValueConverter.getStringAttribute(org.apache.qpid.server.model.Exchange.TYPE, attributeValues);
when(exType.getType()).thenReturn(typeName);
when(exchange.getTypeName()).thenReturn(typeName);
when(_virtualHost.getExchange(eq(name))).thenReturn(exchange);
when(_virtualHost.getExchange(eq(id))).thenReturn(exchange);