public void testEqualFoodProductionConsumptionCase() { Game game = ServerTestHelper.startServerGame(getTestMap(desert)); // Setting test colony Tile colonyTile = game.getMap().getTile(5, 8); Colony colony = FreeColTestUtils.getColonyBuilder().colonyTile(colonyTile).initialColonists(1).build(); // Set the food production of the center tile of the colony to 2 // This will be the only food production of the colony List<AbstractGoods> colonyTileProduction = colonyTile.getType().getPossibleProduction(true); for (int i = 0; i < colonyTileProduction.size(); i++) { AbstractGoods production = colonyTileProduction.get(i); if (production.getType() == foodGoodsType) { production.setAmount(2); break; } } Unit unit = colony.getUnitList().get(0); unit.setLocation(colony.getWorkLocationFor(unit, bellsType)); // Verify that there is enough food stored colony.addGoods(foodGoodsType, colony.getFoodConsumption() * 2); assertEquals( "Production not equal to consumption", colony.getFoodConsumption(), colony.getFoodProduction()); int colonists = colony.getUnitCount(); assertEquals("Unexpected change of colonists in colony", colonists, colony.getUnitCount()); assertEquals( "Unexpected change of production/consumption ratio", colony.getFoodProduction(), colony.getFoodConsumption()); }