Preheat the oven to 200ºC, fan 180°C, gas 6. Heat the oil in a large pan, add the garlic and leeks and cook gently for 5 minutes.
Stir in the mushrooms, rosemary, roast chicken and the soup. Season with black pepper, then simmer for 5-10 minutes. Pour into a 1.5-litre pie dish.
Brush a little water along the edge of the pie dish. Unroll the pastry over the dish, trim off the excess and press to seal the edges. Make a small slit in the centre, place on a baking tray and brush the top with beaten egg. Bake for 30 minutes until golden. Serve with the beans in a separate dish.