code: def test_datafactory(self):
      tenant_col = "tenant"
      user_col = "user"
      res_col = "res"
  
      df = spark.createDataFrame(
          DataFactory(
              single_component=False
          ).create_clustered_training_data(),
      ).withColumn(tenant_col, f.lit(0))
  
      cc = ConnectedComponents(tenant_col, user_col, res_col)
      user2components, res2components = cc.transform(df)
  
      assert user2components.select("component").distinct().count() == 3
      assert res2components.select("component").distinct().count() == 3
  
imports: import os
  import tempfile
  import unittest
  from typing import Dict, Optional, Set, Type, Union
  from pandas.testing import assert_frame_equal
  from pyspark.sql import DataFrame, types, functions
  from synapse.ml.cyber.feature import indexers
  from synapse.ml.cyber import DataFactory
  from synapse.ml.cyber.anomaly.collaborative_filtering import AccessAnomaly, AccessAnomalyModel, AccessAnomalyConfig, ConnectedComponents, ModelNormalizeTransformer, _UserResourceFeatureVectorMapping
  from synapsemltest.cyber.explain_tester import ExplainTester
  from synapsemltest.spark import *
label_desc: Use image node_id 2 for calling the TestConnectedComponents obj's underlying member method code with example usage: obj.test_datafactory() without return types