diff --git a/src/test/associations.cpp b/src/test/associations.cpp
index 4e1b2bd..cf2f7d0 100644
--- a/src/test/associations.cpp
+++ b/src/test/associations.cpp
@@ -21,7 +21,7 @@
     std::string sourcePath = "/xyz/openbmc_project/no/association";
     AssociationMaps assocMaps;
 
-    removeAssociation(sourcePath, DEFAULT_DBUS_SVC, *server, assocMaps);
+    removeAssociation(sourcePath, defaultDbusSvc, *server, assocMaps);
 }
 
 // Verify call when owner is not in associated owners
@@ -30,8 +30,7 @@
     AssociationMaps assocMaps;
     assocMaps.owners = createDefaultOwnerAssociation();
 
-    removeAssociation(DEFAULT_SOURCE_PATH, DEFAULT_DBUS_SVC, *server,
-                      assocMaps);
+    removeAssociation(defaultSourcePath, defaultDbusSvc, *server, assocMaps);
 }
 
 // Verify call when path is not in associated interfaces
@@ -41,8 +40,7 @@
 
     assocMaps.owners = createDefaultOwnerAssociation();
 
-    removeAssociation(DEFAULT_SOURCE_PATH, DEFAULT_DBUS_SVC, *server,
-                      assocMaps);
+    removeAssociation(defaultSourcePath, defaultDbusSvc, *server, assocMaps);
 
     EXPECT_TRUE(assocMaps.owners.empty());
 }
@@ -56,17 +54,16 @@
     assocMaps.owners = createDefaultOwnerAssociation();
     assocMaps.ifaces = createDefaultInterfaceAssociation(server);
 
-    removeAssociation(DEFAULT_SOURCE_PATH, DEFAULT_DBUS_SVC, *server,
-                      assocMaps);
+    removeAssociation(defaultSourcePath, defaultDbusSvc, *server, assocMaps);
 
     // Verify owner association was deleted
     EXPECT_TRUE(assocMaps.owners.empty());
 
     // Verify endpoint was deleted from interface association
     auto intfEndpoints =
-        std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_FWD_PATH]);
+        std::get<endpointsPos>(assocMaps.ifaces[defaultFwdPath]);
     EXPECT_EQ(intfEndpoints.size(), 0);
-    intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_REV_PATH]);
+    intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[defaultRevPath]);
     EXPECT_EQ(intfEndpoints.size(), 0);
 }
 
@@ -82,60 +79,58 @@
     // Add another endpoint to the assoc interfaces
     addEndpointToInterfaceAssociation(assocMaps.ifaces);
 
-    removeAssociation(DEFAULT_SOURCE_PATH, DEFAULT_DBUS_SVC, *server,
-                      assocMaps);
+    removeAssociation(defaultSourcePath, defaultDbusSvc, *server, assocMaps);
 
     // Verify owner association was deleted
     EXPECT_TRUE(assocMaps.owners.empty());
 
     // Verify all endpoints are deleted since source path was deleted
     auto intfEndpoints =
-        std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_FWD_PATH]);
+        std::get<endpointsPos>(assocMaps.ifaces[defaultFwdPath]);
     EXPECT_EQ(intfEndpoints.size(), 0);
-    intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_REV_PATH]);
+    intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[defaultRevPath]);
     EXPECT_EQ(intfEndpoints.size(), 0);
 }
 
 // Verify no associations or endpoints removed when the change is identical
 TEST_F(TestAssociations, checkAssociationEndpointRemovesNoEpRemove)
 {
-    AssociationPaths newAssocPaths = {
-        {DEFAULT_FWD_PATH, {DEFAULT_ENDPOINT}},
-        {DEFAULT_REV_PATH, {DEFAULT_SOURCE_PATH}}};
+    AssociationPaths newAssocPaths = {{defaultFwdPath, {defaultEndpoint}},
+                                      {defaultRevPath, {defaultSourcePath}}};
 
     AssociationMaps assocMaps;
     assocMaps.owners = createDefaultOwnerAssociation();
     assocMaps.ifaces = createDefaultInterfaceAssociation(server);
 
-    checkAssociationEndpointRemoves(DEFAULT_SOURCE_PATH, DEFAULT_DBUS_SVC,
+    checkAssociationEndpointRemoves(defaultSourcePath, defaultDbusSvc,
                                     newAssocPaths, *server, assocMaps);
 
     // Verify endpoints were not deleted because they matche with what was
     // in the original
     auto intfEndpoints =
-        std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_FWD_PATH]);
+        std::get<endpointsPos>(assocMaps.ifaces[defaultFwdPath]);
     EXPECT_EQ(intfEndpoints.size(), 1);
-    intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_REV_PATH]);
+    intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[defaultRevPath]);
     EXPECT_EQ(intfEndpoints.size(), 1);
 }
 
 // Verify endpoint is removed when assoc path is different
 TEST_F(TestAssociations, checkAssociationEndpointRemovesEpRemoveApDiff)
 {
-    AssociationPaths newAssocPaths = {{"/different/path", {DEFAULT_ENDPOINT}}};
+    AssociationPaths newAssocPaths = {{"/different/path", {defaultEndpoint}}};
 
     AssociationMaps assocMaps;
     assocMaps.owners = createDefaultOwnerAssociation();
     assocMaps.ifaces = createDefaultInterfaceAssociation(server);
 
-    checkAssociationEndpointRemoves(DEFAULT_SOURCE_PATH, DEFAULT_DBUS_SVC,
+    checkAssociationEndpointRemoves(defaultSourcePath, defaultDbusSvc,
                                     newAssocPaths, *server, assocMaps);
 
     // Verify initial endpoints were deleted because the new path
     auto intfEndpoints =
-        std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_FWD_PATH]);
+        std::get<endpointsPos>(assocMaps.ifaces[defaultFwdPath]);
     EXPECT_EQ(intfEndpoints.size(), 0);
-    intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_REV_PATH]);
+    intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[defaultRevPath]);
     EXPECT_EQ(intfEndpoints.size(), 0);
 }
 
@@ -143,21 +138,21 @@
 TEST_F(TestAssociations, checkAssociationEndpointRemovesEpRemoveEpChanged)
 {
     AssociationPaths newAssocPaths = {
-        {DEFAULT_FWD_PATH, {DEFAULT_ENDPOINT + "/different"}},
-        {DEFAULT_REV_PATH, {DEFAULT_SOURCE_PATH + "/different"}}};
+        {defaultFwdPath, {defaultEndpoint + "/different"}},
+        {defaultRevPath, {defaultSourcePath + "/different"}}};
 
     AssociationMaps assocMaps;
     assocMaps.owners = createDefaultOwnerAssociation();
     assocMaps.ifaces = createDefaultInterfaceAssociation(server);
 
-    checkAssociationEndpointRemoves(DEFAULT_SOURCE_PATH, DEFAULT_DBUS_SVC,
+    checkAssociationEndpointRemoves(defaultSourcePath, defaultDbusSvc,
                                     newAssocPaths, *server, assocMaps);
 
     // Verify initial endpoints were deleted because of different endpoints
     auto intfEndpoints =
-        std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_FWD_PATH]);
+        std::get<endpointsPos>(assocMaps.ifaces[defaultFwdPath]);
     EXPECT_EQ(intfEndpoints.size(), 0);
-    intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_REV_PATH]);
+    intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[defaultRevPath]);
     EXPECT_EQ(intfEndpoints.size(), 0);
 }
 
@@ -166,21 +161,21 @@
 {
     std::vector<Association> associations = {
         {"inventory_cee", "error_cee", ""}};
-    interface_map_type interfaceMap;
+    InterfaceMapType interfaceMap;
 
     AssociationMaps assocMaps;
     assocMaps.owners = createDefaultOwnerAssociation();
     assocMaps.ifaces = createDefaultInterfaceAssociation(server);
 
     // Empty endpoint will result in deletion of corresponding assocInterface
-    associationChanged(*server, associations, DEFAULT_SOURCE_PATH,
-                       DEFAULT_DBUS_SVC, interfaceMap, assocMaps);
+    associationChanged(*server, associations, defaultSourcePath, defaultDbusSvc,
+                       interfaceMap, assocMaps);
 
     // Both of these should be 0 since we have an invalid endpoint
     auto intfEndpoints =
-        std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_FWD_PATH]);
+        std::get<endpointsPos>(assocMaps.ifaces[defaultFwdPath]);
     EXPECT_EQ(intfEndpoints.size(), 0);
-    intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_REV_PATH]);
+    intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[defaultRevPath]);
     EXPECT_EQ(intfEndpoints.size(), 0);
 
     EXPECT_EQ(assocMaps.pending.size(), 0);
@@ -197,12 +192,12 @@
     assocMaps.ifaces = createDefaultInterfaceAssociation(server);
 
     // Make it look like the assoc endpoints are on D-Bus
-    interface_map_type interfaceMap = {
-        {"/new/source/path", {{DEFAULT_DBUS_SVC, {"a"}}}},
-        {"/xyz/openbmc_project/new/endpoint", {{DEFAULT_DBUS_SVC, {"a"}}}}};
+    InterfaceMapType interfaceMap = {
+        {"/new/source/path", {{defaultDbusSvc, {"a"}}}},
+        {"/xyz/openbmc_project/new/endpoint", {{defaultDbusSvc, {"a"}}}}};
 
     associationChanged(*server, associations, "/new/source/path",
-                       DEFAULT_DBUS_SVC, interfaceMap, assocMaps);
+                       defaultDbusSvc, interfaceMap, assocMaps);
 
     // Two source paths
     EXPECT_EQ(assocMaps.owners.size(), 2);
@@ -215,7 +210,7 @@
 
     // New endpoint so assocMaps.ifaces should be same size
     auto intfEndpoints =
-        std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_FWD_PATH]);
+        std::get<endpointsPos>(assocMaps.ifaces[defaultFwdPath]);
     EXPECT_EQ(intfEndpoints.size(), 1);
 }
 
@@ -233,10 +228,10 @@
     AssociationMaps assocMaps;
 
     // Make it look like the assoc endpoints are on D-Bus
-    interface_map_type interfaceMap = createDefaultInterfaceMap();
+    InterfaceMapType interfaceMap = createDefaultInterfaceMap();
 
-    associationChanged(*server, associations, DEFAULT_SOURCE_PATH,
-                       DEFAULT_DBUS_SVC, interfaceMap, assocMaps);
+    associationChanged(*server, associations, defaultSourcePath, defaultDbusSvc,
+                       interfaceMap, assocMaps);
 
     // New associations so ensure it now contains a single entry
     EXPECT_EQ(assocMaps.owners.size(), 1);
@@ -246,8 +241,8 @@
 
     // Verify corresponding assoc paths each have one endpoint in assoc
     // interfaces and that those endpoints match
-    auto singleOwner = assocMaps.owners[DEFAULT_SOURCE_PATH];
-    auto singleIntf = singleOwner[DEFAULT_DBUS_SVC];
+    auto singleOwner = assocMaps.owners[defaultSourcePath];
+    auto singleIntf = singleOwner[defaultDbusSvc];
     for (auto i : singleIntf)
     {
         auto intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[i.first]);
@@ -265,13 +260,13 @@
          "/xyz/openbmc_project/inventory/system/chassis"}};
 
     // Make it look like the assoc endpoints are on D-Bus
-    interface_map_type interfaceMap = createDefaultInterfaceMap();
+    InterfaceMapType interfaceMap = createDefaultInterfaceMap();
 
     AssociationMaps assocMaps;
     assocMaps.owners = createDefaultOwnerAssociation();
     assocMaps.ifaces = createDefaultInterfaceAssociation(server);
 
-    associationChanged(*server, associations, DEFAULT_SOURCE_PATH, newOwner,
+    associationChanged(*server, associations, defaultSourcePath, newOwner,
                        interfaceMap, assocMaps);
 
     // New endpoint so assocOwners should be same size
@@ -279,11 +274,11 @@
 
     // Ensure only one endpoint under first path
     auto intfEndpoints =
-        std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_FWD_PATH]);
+        std::get<endpointsPos>(assocMaps.ifaces[defaultFwdPath]);
     EXPECT_EQ(intfEndpoints.size(), 1);
 
     // Ensure the 2 new association endpoints are under the new owner
-    auto a = assocMaps.owners.find(DEFAULT_SOURCE_PATH);
+    auto a = assocMaps.owners.find(defaultSourcePath);
     auto o = a->second.find(newOwner);
     EXPECT_EQ(o->second.size(), 2);
 
@@ -298,14 +293,14 @@
         {"abc", "error", "/xyz/openbmc_project/inventory/system/chassis"}};
 
     // Make it look like the assoc endpoints are on D-Bus
-    interface_map_type interfaceMap = createDefaultInterfaceMap();
+    InterfaceMapType interfaceMap = createDefaultInterfaceMap();
 
     AssociationMaps assocMaps;
     assocMaps.owners = createDefaultOwnerAssociation();
     assocMaps.ifaces = createDefaultInterfaceAssociation(server);
 
-    associationChanged(*server, associations, DEFAULT_SOURCE_PATH,
-                       DEFAULT_DBUS_SVC, interfaceMap, assocMaps);
+    associationChanged(*server, associations, defaultSourcePath, defaultDbusSvc,
+                       interfaceMap, assocMaps);
 
     // Should have 3 entries in AssociationInterfaces, one is just missing an
     // endpoint
@@ -313,12 +308,12 @@
 
     // Change to existing interface so it will be removed here
     auto intfEndpoints =
-        std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_FWD_PATH]);
+        std::get<endpointsPos>(assocMaps.ifaces[defaultFwdPath]);
     EXPECT_EQ(intfEndpoints.size(), 0);
 
     // The new endpoint should exist though in it's place
     intfEndpoints = std::get<endpointsPos>(
-        assocMaps.ifaces[DEFAULT_SOURCE_PATH + "/" + "abc"]);
+        assocMaps.ifaces[defaultSourcePath + "/" + "abc"]);
     EXPECT_EQ(intfEndpoints.size(), 1);
 
     // Added to an existing owner path so still 1
@@ -332,16 +327,16 @@
 {
     AssociationMaps assocMaps;
 
-    addPendingAssociation(DEFAULT_SOURCE_PATH, "inventory", DEFAULT_ENDPOINT,
-                          "error", DEFAULT_DBUS_SVC, assocMaps);
+    addPendingAssociation(defaultSourcePath, "inventory", defaultEndpoint,
+                          "error", defaultDbusSvc, assocMaps);
 
     EXPECT_TRUE(assocMaps.ifaces.empty());
     EXPECT_TRUE(assocMaps.owners.empty());
 
     EXPECT_EQ(assocMaps.pending.size(), 1);
 
-    addPendingAssociation("some/other/path", "inventory", DEFAULT_ENDPOINT,
-                          "error", DEFAULT_DBUS_SVC, assocMaps);
+    addPendingAssociation("some/other/path", "inventory", defaultEndpoint,
+                          "error", defaultDbusSvc, assocMaps);
 
     EXPECT_TRUE(assocMaps.ifaces.empty());
     EXPECT_TRUE(assocMaps.owners.empty());
@@ -354,19 +349,18 @@
 {
     AssociationMaps assocMaps;
 
-    addPendingAssociation(DEFAULT_SOURCE_PATH, "inventory", DEFAULT_ENDPOINT,
-                          "error", DEFAULT_DBUS_SVC, assocMaps);
+    addPendingAssociation(defaultSourcePath, "inventory", defaultEndpoint,
+                          "error", defaultDbusSvc, assocMaps);
 
     EXPECT_EQ(assocMaps.pending.size(), 1);
 
-    addPendingAssociation(DEFAULT_SOURCE_PATH, "inventory",
-                          "some/other/endpoint", "error", DEFAULT_DBUS_SVC,
-                          assocMaps);
+    addPendingAssociation(defaultSourcePath, "inventory", "some/other/endpoint",
+                          "error", defaultDbusSvc, assocMaps);
 
     // Same pending path, so still just 1 entry
     EXPECT_EQ(assocMaps.pending.size(), 1);
 
-    auto assoc = assocMaps.pending.find(DEFAULT_SOURCE_PATH);
+    auto assoc = assocMaps.pending.find(defaultSourcePath);
     EXPECT_NE(assoc, assocMaps.pending.end());
 
     auto& endpoints = assoc->second;
@@ -378,17 +372,17 @@
 {
     AssociationMaps assocMaps;
 
-    addPendingAssociation(DEFAULT_SOURCE_PATH, "inventory", DEFAULT_ENDPOINT,
-                          "error", DEFAULT_DBUS_SVC, assocMaps);
+    addPendingAssociation(defaultSourcePath, "inventory", defaultEndpoint,
+                          "error", defaultDbusSvc, assocMaps);
 
     EXPECT_EQ(assocMaps.pending.size(), 1);
 
-    addPendingAssociation(DEFAULT_SOURCE_PATH, "inventory", DEFAULT_ENDPOINT,
+    addPendingAssociation(defaultSourcePath, "inventory", defaultEndpoint,
                           "error", "new owner", assocMaps);
 
     EXPECT_EQ(assocMaps.pending.size(), 1);
 
-    auto assoc = assocMaps.pending.find(DEFAULT_SOURCE_PATH);
+    auto assoc = assocMaps.pending.find(defaultSourcePath);
     EXPECT_NE(assoc, assocMaps.pending.end());
 
     auto& endpoints = assoc->second;
@@ -402,10 +396,10 @@
         {"abc", "def", "/xyz/openbmc_project/new/endpoint"}};
 
     AssociationMaps assocMaps;
-    interface_map_type interfaceMap;
+    InterfaceMapType interfaceMap;
 
     associationChanged(*server, associations, "/new/source/path",
-                       DEFAULT_DBUS_SVC, interfaceMap, assocMaps);
+                       defaultDbusSvc, interfaceMap, assocMaps);
 
     // No associations were actually added
     EXPECT_EQ(assocMaps.owners.size(), 0);
@@ -420,12 +414,11 @@
 {
     AssociationMaps assocMaps;
 
-    addPendingAssociation(DEFAULT_SOURCE_PATH, "inventory", DEFAULT_ENDPOINT,
-                          "error", DEFAULT_DBUS_SVC, assocMaps);
+    addPendingAssociation(defaultSourcePath, "inventory", defaultEndpoint,
+                          "error", defaultDbusSvc, assocMaps);
 
-    addPendingAssociation(DEFAULT_SOURCE_PATH, "inventory",
-                          "some/other/endpoint", "error", DEFAULT_DBUS_SVC,
-                          assocMaps);
+    addPendingAssociation(defaultSourcePath, "inventory", "some/other/endpoint",
+                          "error", defaultDbusSvc, assocMaps);
 
     EXPECT_EQ(assocMaps.pending.size(), 1);
 
@@ -434,13 +427,13 @@
     // Still 1 pending entry, but down to 1 endpoint
     EXPECT_EQ(assocMaps.pending.size(), 1);
 
-    auto assoc = assocMaps.pending.find(DEFAULT_SOURCE_PATH);
+    auto assoc = assocMaps.pending.find(defaultSourcePath);
     EXPECT_NE(assoc, assocMaps.pending.end());
     auto& endpoints = assoc->second;
     EXPECT_EQ(endpoints.size(), 1);
 
     // Now nothing pending
-    removeFromPendingAssociations(DEFAULT_ENDPOINT, assocMaps);
+    removeFromPendingAssociations(defaultEndpoint, assocMaps);
     EXPECT_EQ(assocMaps.pending.size(), 0);
 }
 
@@ -448,17 +441,16 @@
 TEST_F(TestAssociations, checkIfPending)
 {
     AssociationMaps assocMaps;
-    interface_map_type interfaceMap = {
-        {DEFAULT_SOURCE_PATH, {{DEFAULT_DBUS_SVC, {"a"}}}},
-        {DEFAULT_ENDPOINT, {{DEFAULT_DBUS_SVC, {"b"}}}}};
+    InterfaceMapType interfaceMap = {
+        {defaultSourcePath, {{defaultDbusSvc, {"a"}}}},
+        {defaultEndpoint, {{defaultDbusSvc, {"b"}}}}};
 
-    addPendingAssociation(DEFAULT_SOURCE_PATH, "inventory_cip",
-                          DEFAULT_ENDPOINT, "error_cip", DEFAULT_DBUS_SVC,
-                          assocMaps);
+    addPendingAssociation(defaultSourcePath, "inventory_cip", defaultEndpoint,
+                          "error_cip", defaultDbusSvc, assocMaps);
     EXPECT_EQ(assocMaps.pending.size(), 1);
 
     // Move the pending association to a real association
-    checkIfPendingAssociation(DEFAULT_SOURCE_PATH, interfaceMap, assocMaps,
+    checkIfPendingAssociation(defaultSourcePath, interfaceMap, assocMaps,
                               *server);
 
     EXPECT_TRUE(assocMaps.pending.empty());
@@ -523,7 +515,7 @@
     AssociationMaps assocMaps;
 
     // Not an association, so it shouldn't do anything
-    moveAssociationToPending(DEFAULT_ENDPOINT, assocMaps, *server);
+    moveAssociationToPending(defaultEndpoint, assocMaps, *server);
 
     EXPECT_TRUE(assocMaps.pending.empty());
     EXPECT_TRUE(assocMaps.owners.empty());
@@ -536,18 +528,18 @@
     assocMaps.owners = createDefaultOwnerAssociation();
     assocMaps.ifaces = createDefaultInterfaceAssociation(server);
 
-    moveAssociationToPending(DEFAULT_ENDPOINT, assocMaps, *server);
+    moveAssociationToPending(defaultEndpoint, assocMaps, *server);
 
     // Check it's now pending
     EXPECT_EQ(assocMaps.pending.size(), 1);
-    EXPECT_EQ(assocMaps.pending.begin()->first, DEFAULT_ENDPOINT);
+    EXPECT_EQ(assocMaps.pending.begin()->first, defaultEndpoint);
 
     // No more assoc owners
     EXPECT_TRUE(assocMaps.owners.empty());
 
     // Check the association interfaces were removed
     {
-        auto assocs = assocMaps.ifaces.find(DEFAULT_FWD_PATH);
+        auto assocs = assocMaps.ifaces.find(defaultFwdPath);
         auto& iface = std::get<ifacePos>(assocs->second);
         auto& endpoints = std::get<endpointsPos>(assocs->second);
 
@@ -555,7 +547,7 @@
         EXPECT_TRUE(endpoints.empty());
     }
     {
-        auto assocs = assocMaps.ifaces.find(DEFAULT_REV_PATH);
+        auto assocs = assocMaps.ifaces.find(defaultRevPath);
         auto& iface = std::get<ifacePos>(assocs->second);
         auto& endpoints = std::get<endpointsPos>(assocs->second);
 
diff --git a/src/test/interfaces_added.cpp b/src/test/interfaces_added.cpp
index 20d8716..1ada2a0 100644
--- a/src/test/interfaces_added.cpp
+++ b/src/test/interfaces_added.cpp
@@ -37,20 +37,20 @@
     auto intfAdded =
         createInterfacesAdded(assocDefsInterface, assocDefsProperty);
 
-    processInterfaceAdded(interfaceMap, DEFAULT_SOURCE_PATH, intfAdded,
-                          DEFAULT_DBUS_SVC, assocMaps, *server);
+    processInterfaceAdded(interfaceMap, defaultSourcePath, intfAdded,
+                          defaultDbusSvc, assocMaps, *server);
 
     // Interface map will get the following:
     // /logging/entry/1 /logging/entry /logging/ / system/chassis
-    // dump_InterfaceMapType(interfaceMap);
+    // dumpInterfaceMapType(interfaceMap);
     EXPECT_EQ(interfaceMap.size(), 5);
 
     // New association ower created so ensure it now contains a single entry
-    // dump_AssociationOwnersType(assocOwners);
+    // dumpAssociationOwnersType(assocOwners);
     EXPECT_EQ(assocMaps.owners.size(), 1);
 
     // Ensure the 2 association interfaces were created
-    // dump_AssociationInterfaces(assocInterfaces);
+    // dumpAssociationInterfaces(assocInterfaces);
     EXPECT_EQ(assocMaps.ifaces.size(), 2);
 
     // No pending associations
diff --git a/src/test/name_change.cpp b/src/test/name_change.cpp
index 32ad56c..cd491a5 100644
--- a/src/test/name_change.cpp
+++ b/src/test/name_change.cpp
@@ -16,7 +16,7 @@
         {":1.99", "test-name"}};
     std::string wellKnown = {"test-name"};
     std::string oldOwner = {":1.99"};
-    interface_map_type interfaceMap;
+    InterfaceMapType interfaceMap;
     AssociationMaps assocMaps;
 
     processNameChangeDelete(nameOwners, wellKnown, oldOwner, interfaceMap,
@@ -28,7 +28,7 @@
 TEST_F(TestNameChange, UniqueNameAssociationsAndInterface)
 {
     boost::container::flat_map<std::string, std::string> nameOwners = {
-        {":1.99", DEFAULT_DBUS_SVC}};
+        {":1.99", defaultDbusSvc}};
     std::string oldOwner = {":1.99"};
     boost::container::flat_set<std::string> assocInterfacesSet = {
         assocDefsInterface};
@@ -38,11 +38,11 @@
     AssociationMaps assocMaps;
     assocMaps.owners = createDefaultOwnerAssociation();
     assocMaps.ifaces = createDefaultInterfaceAssociation(server);
-    auto interfaceMap = createInterfaceMap(
-        DEFAULT_SOURCE_PATH, DEFAULT_DBUS_SVC, assocInterfacesSet);
+    auto interfaceMap = createInterfaceMap(defaultSourcePath, defaultDbusSvc,
+                                           assocInterfacesSet);
 
-    processNameChangeDelete(nameOwners, DEFAULT_DBUS_SVC, oldOwner,
-                            interfaceMap, assocMaps, *server);
+    processNameChangeDelete(nameOwners, defaultDbusSvc, oldOwner, interfaceMap,
+                            assocMaps, *server);
     EXPECT_EQ(nameOwners.size(), 0);
 
     // Verify owner association was deleted
@@ -50,9 +50,9 @@
 
     // Verify endpoint was deleted from interface association
     auto intfEndpoints =
-        std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_FWD_PATH]);
+        std::get<endpointsPos>(assocMaps.ifaces[defaultFwdPath]);
     EXPECT_EQ(intfEndpoints.size(), 0);
-    intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_REV_PATH]);
+    intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[defaultRevPath]);
     EXPECT_EQ(intfEndpoints.size(), 0);
 
     // Verify interface map was deleted
diff --git a/src/test/need_to_introspect.cpp b/src/test/need_to_introspect.cpp
index 51972ef..1b4fa86 100644
--- a/src/test/need_to_introspect.cpp
+++ b/src/test/need_to_introspect.cpp
@@ -7,9 +7,9 @@
 {
     AllowDenyList allowList;
     AllowDenyList denyList;
-    std::string process_name;
+    std::string processName;
 
-    EXPECT_FALSE(needToIntrospect(process_name, allowList, denyList));
+    EXPECT_FALSE(needToIntrospect(processName, allowList, denyList));
 }
 
 // Verify if name is on allowlist, true is returned
@@ -17,9 +17,9 @@
 {
     AllowDenyList allowList = {"xyz.openbmc_project"};
     AllowDenyList denyList;
-    std::string process_name = "xyz.openbmc_project.State.Host";
+    std::string processName = "xyz.openbmc_project.State.Host";
 
-    EXPECT_TRUE(needToIntrospect(process_name, allowList, denyList));
+    EXPECT_TRUE(needToIntrospect(processName, allowList, denyList));
 }
 
 // Verify if name is on denylist, false is returned
@@ -27,9 +27,9 @@
 {
     AllowDenyList allowList;
     AllowDenyList denyList = {"xyz.openbmc_project.State.Host"};
-    std::string process_name = "xyz.openbmc_project.State.Host";
+    std::string processName = "xyz.openbmc_project.State.Host";
 
-    EXPECT_FALSE(needToIntrospect(process_name, allowList, denyList));
+    EXPECT_FALSE(needToIntrospect(processName, allowList, denyList));
 }
 
 // Verify if name is on allowlist and denylist, false is returned
@@ -37,7 +37,7 @@
 {
     AllowDenyList allowList = {"xyz.openbmc_project"};
     AllowDenyList denyList = {"xyz.openbmc_project.State.Host"};
-    std::string process_name = "xyz.openbmc_project.State.Host";
+    std::string processName = "xyz.openbmc_project.State.Host";
 
-    EXPECT_FALSE(needToIntrospect(process_name, allowList, denyList));
+    EXPECT_FALSE(needToIntrospect(processName, allowList, denyList));
 }
diff --git a/src/test/util/association_objects.hpp b/src/test/util/association_objects.hpp
index 632e5ff..f6b6d1d 100644
--- a/src/test/util/association_objects.hpp
+++ b/src/test/util/association_objects.hpp
@@ -1,22 +1,22 @@
 #include "src/associations.hpp"
 #include "src/processing.hpp"
 
-const std::string DEFAULT_SOURCE_PATH = "/logging/entry/1";
-const std::string DEFAULT_DBUS_SVC = "xyz.openbmc_project.New.Interface";
-const std::string DEFAULT_FWD_PATH = {DEFAULT_SOURCE_PATH + "/" + "inventory"};
-const std::string DEFAULT_ENDPOINT =
+const std::string defaultSourcePath = "/logging/entry/1";
+const std::string defaultDbusSvc = "xyz.openbmc_project.New.Interface";
+const std::string defaultFwdPath = {defaultSourcePath + "/" + "inventory"};
+const std::string defaultEndpoint =
     "/xyz/openbmc_project/inventory/system/chassis";
-const std::string DEFAULT_REV_PATH = {DEFAULT_ENDPOINT + "/" + "error"};
-const std::string EXTRA_ENDPOINT = "/xyz/openbmc_project/differnt/endpoint";
+const std::string defaultRevPath = {defaultEndpoint + "/" + "error"};
+const std::string extraEndpoint = "/xyz/openbmc_project/differnt/endpoint";
 
 // Create a default AssociationOwnersType object
 AssociationOwnersType createDefaultOwnerAssociation()
 {
-    AssociationPaths assocPathMap = {{DEFAULT_FWD_PATH, {DEFAULT_ENDPOINT}},
-                                     {DEFAULT_REV_PATH, {DEFAULT_SOURCE_PATH}}};
+    AssociationPaths assocPathMap = {{defaultFwdPath, {defaultEndpoint}},
+                                     {defaultRevPath, {defaultSourcePath}}};
     boost::container::flat_map<std::string, AssociationPaths> serviceMap = {
-        {DEFAULT_DBUS_SVC, assocPathMap}};
-    AssociationOwnersType ownerAssoc = {{DEFAULT_SOURCE_PATH, serviceMap}};
+        {defaultDbusSvc, assocPathMap}};
+    AssociationOwnersType ownerAssoc = {{defaultSourcePath, serviceMap}};
     return ownerAssoc;
 }
 
@@ -26,15 +26,15 @@
 {
     AssociationInterfaces interfaceAssoc;
 
-    auto& iface = interfaceAssoc[DEFAULT_FWD_PATH];
+    auto& iface = interfaceAssoc[defaultFwdPath];
     auto& endpoints = std::get<endpointsPos>(iface);
-    endpoints.push_back(DEFAULT_ENDPOINT);
-    server->add_interface(DEFAULT_FWD_PATH, DEFAULT_DBUS_SVC);
+    endpoints.push_back(defaultEndpoint);
+    server->add_interface(defaultFwdPath, defaultDbusSvc);
 
-    auto& iface2 = interfaceAssoc[DEFAULT_REV_PATH];
+    auto& iface2 = interfaceAssoc[defaultRevPath];
     auto& endpoints2 = std::get<endpointsPos>(iface2);
-    endpoints2.push_back(DEFAULT_SOURCE_PATH);
-    server->add_interface(DEFAULT_REV_PATH, DEFAULT_DBUS_SVC);
+    endpoints2.push_back(defaultSourcePath);
+    server->add_interface(defaultRevPath, defaultDbusSvc);
 
     return interfaceAssoc;
 }
@@ -42,30 +42,30 @@
 // Just add an extra endpoint to the first association
 void addEndpointToInterfaceAssociation(AssociationInterfaces& interfaceAssoc)
 {
-    auto iface = interfaceAssoc[DEFAULT_FWD_PATH];
+    auto iface = interfaceAssoc[defaultFwdPath];
     auto endpoints = std::get<endpointsPos>(iface);
-    endpoints.push_back(EXTRA_ENDPOINT);
+    endpoints.push_back(extraEndpoint);
 }
 
-// Create a default interface_map_type with input values
-interface_map_type createInterfaceMap(
-    const std::string& path, const std::string& connection_name,
-    const boost::container::flat_set<std::string>& interface_names)
+// Create a default interfaceMapType with input values
+InterfaceMapType createInterfaceMap(
+    const std::string& path, const std::string& connectionName,
+    const boost::container::flat_set<std::string>& interfaceNames)
 {
     boost::container::flat_map<std::string,
                                boost::container::flat_set<std::string>>
-        connectionMap = {{connection_name, interface_names}};
-    interface_map_type interfaceMap = {{path, connectionMap}};
+        connectionMap = {{connectionName, interfaceNames}};
+    InterfaceMapType interfaceMap = {{path, connectionMap}};
     return interfaceMap;
 }
 
-// Create a default interface_map_type with 2 entries with the same
+// Create a default interfaceMapType with 2 entries with the same
 // owner.
-interface_map_type createDefaultInterfaceMap()
+InterfaceMapType createDefaultInterfaceMap()
 {
-    interface_map_type interfaceMap = {
-        {DEFAULT_SOURCE_PATH, {{DEFAULT_DBUS_SVC, {"a"}}}},
-        {DEFAULT_ENDPOINT, {{DEFAULT_DBUS_SVC, {"b"}}}}};
+    InterfaceMapType interfaceMap = {
+        {defaultSourcePath, {{defaultDbusSvc, {"a"}}}},
+        {defaultEndpoint, {{defaultDbusSvc, {"b"}}}}};
 
     return interfaceMap;
 }
diff --git a/src/test/util/debug_output.hpp b/src/test/util/debug_output.hpp
index 460f01f..3cdf42b 100644
--- a/src/test/util/debug_output.hpp
+++ b/src/test/util/debug_output.hpp
@@ -4,7 +4,7 @@
 
 // Some debug functions for dumping out the main data structures in objmgr
 
-void dump_AssociationOwnersType(AssociationOwnersType& assocOwners)
+void dumpAssociationOwnersType(AssociationOwnersType& assocOwners)
 {
     using namespace std;
     cout << "##### AssociationOwnersType #####" << endl;
@@ -31,7 +31,7 @@
     }
 }
 
-void dump_AssociationInterfaces(AssociationInterfaces& assocInterfaces)
+void dumpAssociationInterfaces(AssociationInterfaces& assocInterfaces)
 {
     using namespace std;
     cout << "##### AssociationInterfaces #####" << endl;
@@ -49,10 +49,10 @@
     }
 }
 
-void dump_InterfaceMapType(interface_map_type& intfMap)
+void dumpInterfaceMapType(InterfaceMapType& intfMap)
 {
     using namespace std;
-    cout << "##### interface_map_type #####" << endl;
+    cout << "##### interfaceMapType #####" << endl;
     for (auto i : intfMap)
     {
         cout << "------------------------------------" << endl;
diff --git a/src/test/well_known.cpp b/src/test/well_known.cpp
index c9f119c..6d9cee0 100644
--- a/src/test/well_known.cpp
+++ b/src/test/well_known.cpp
@@ -7,10 +7,10 @@
 {
     boost::container::flat_map<std::string, std::string> owners;
     const std::string request = "test";
-    std::string well_known;
+    std::string wellKnown;
 
-    EXPECT_TRUE(getWellKnown(owners, request, well_known));
-    EXPECT_EQ(well_known, request);
+    EXPECT_TRUE(getWellKnown(owners, request, wellKnown));
+    EXPECT_EQ(wellKnown, request);
 }
 
 // Verify if name is not found, false is returned
@@ -18,10 +18,10 @@
 {
     boost::container::flat_map<std::string, std::string> owners;
     const std::string request = ":test";
-    std::string well_known;
+    std::string wellKnown;
 
-    EXPECT_FALSE(getWellKnown(owners, request, well_known));
-    EXPECT_TRUE(well_known.empty());
+    EXPECT_FALSE(getWellKnown(owners, request, wellKnown));
+    EXPECT_TRUE(wellKnown.empty());
 }
 
 // Verify if name is found, true is returned and name is correct
@@ -29,9 +29,9 @@
 {
     boost::container::flat_map<std::string, std::string> owners;
     const std::string request = ":1.25";
-    std::string well_known;
+    std::string wellKnown;
 
     owners[request] = "test";
-    EXPECT_TRUE(getWellKnown(owners, request, well_known));
-    EXPECT_EQ(well_known, "test");
+    EXPECT_TRUE(getWellKnown(owners, request, wellKnown));
+    EXPECT_EQ(wellKnown, "test");
 }
