* Tests the bound setting.
*/
@Test
public void overwriteBoundTest() {
SinkEntityInspector inspector = new SinkEntityInspector();
Bound newBound = new Bound(2, 1, 4, 3, "NewBound");
BoundSetter setter = new BoundSetter(newBound);
setter.setSink(inspector);
setter.process(new BoundContainer(new Bound("Test")));
setter.process(new NodeContainer(new Node(
new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
setter.complete();
setter.release();
Iterator<EntityContainer> iterator = inspector.getProcessedEntities().iterator();
EntityContainer ec = iterator.next();
Assert.assertEquals(EntityType.Bound, ec.getEntity().getType());
Bound bound = (Bound) ec.getEntity();
Assert.assertEquals(bound, newBound);
// Ensure there is no second bound
ec = iterator.next();
Assert.assertEquals(EntityType.Node, ec.getEntity().getType());