unit-test: Move removeAssociationEndpoints()

Make it easier to unit test and continue reduction of main.cpp

Change-Id: I2c0eac5c301687acab14add627586170020e4fe4
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/src/associations.hpp b/src/associations.hpp
index 8ebef43..d926006 100644
--- a/src/associations.hpp
+++ b/src/associations.hpp
@@ -58,3 +58,21 @@
                        sdbusplus::asio::object_server& server,
                        AssociationOwnersType& assocOwners,
                        AssociationInterfaces& assocInterfaces);
+
+/** @brief Remove input paths from endpoints of an association
+ *
+ * If the last endpoint was removed, then remove the whole
+ * association object, otherwise just set the property
+ *
+ * @param[in] objectServer        - sdbus system object
+ * @param[in] assocPath           - Path of the object that contains the
+ *                                  org.openbmc.Associations
+ * @param[in] endpointsToRemove   - Endpoints to remove
+ * @param[in,out] assocInterfaces - Associations endpoints
+ *
+ * @return Void, objectServer and assocInterfaces updated if needed
+ */
+void removeAssociationEndpoints(
+    sdbusplus::asio::object_server& objectServer, const std::string& assocPath,
+    const boost::container::flat_set<std::string>& endpointsToRemove,
+    AssociationInterfaces& assocInterfaces);