Refactor mapper application to enable unit tests
Change-Id: I58cac8879f93ce49bfb654a1bf559d7f77b5b486
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
diff --git a/phosphor-ldap-mapper/ldap_mapper_serialize.cpp b/phosphor-ldap-mapper/ldap_mapper_serialize.cpp
index 534e0a1..3ef809e 100644
--- a/phosphor-ldap-mapper/ldap_mapper_serialize.cpp
+++ b/phosphor-ldap-mapper/ldap_mapper_serialize.cpp
@@ -54,9 +54,8 @@
privilege(privilege, true);
}
-fs::path serialize(const LDAPMapperEntry& entry, Id id)
+fs::path serialize(const LDAPMapperEntry& entry, Id id, const fs::path& dir)
{
- fs::path dir(LDAP_MAPPER_PERSIST_PATH);
auto path = dir / std::to_string(id);
std::ofstream os(path.c_str(), std::ios::binary);
cereal::BinaryOutputArchive oarchive(os);