refacotr test_mapping with mock(stub)