fixed test to mock headers; some duplication reduced