public static boolean isSentinelResource(HasMetadata resource) {
    Map<String, String> labels = resource.getMetadata().getLabels();
    if (labels == null) {
      return false;
    }
    String namespace = resource.getMetadata().getNamespace();
    return shouldSentinelWatchGivenNamespace(namespace)
        && Boolean.TRUE
            .toString()
            .equalsIgnoreCase(
                labels.getOrDefault(Constants.LABEL_SENTINEL_RESOURCE, Boolean.FALSE.toString()));
  }
@Test
  @Order(1)
  void testIsSentinelResource() {
    SparkApplication sparkApplication = new SparkApplication();
    Map<String, String> lableMap = sparkApplication.getMetadata().getLabels();
    lableMap.put(Constants.LABEL_SENTINEL_RESOURCE, "true");
    Set<String> namespaces = new HashSet<>();
    sparkApplication.getMetadata().setNamespace("spark-test");
    namespaces.add("spark-test");
    try (MockedStatic<Utils> mockUtils = mockStatic(Utils.class)) {
      mockUtils.when(Utils::getWatchedNamespaces).thenReturn(namespaces);
      assertTrue(SentinelManager.isSentinelResource(sparkApplication));
    }
  }