public void updateConfig(DynamicConfigEvent event) {
        if (!isTargetConfig(event)) {
            return;
        }
        if (updateWithDefaultMode(event)) {
            afterUpdateConfig();
        }
    }
@Test
    public void testUpdateGraceConfig() {
        try (MockedStatic<PluginConfigManager> pluginConfigManagerMockedStatic = Mockito.mockStatic(PluginConfigManager.class)) {
            pluginConfigManagerMockedStatic.when(() -> PluginConfigManager.getPluginConfig(GraceConfig.class))
                    .thenReturn(new GraceConfig());
            RegistryConfigResolver configResolver = new GraceConfigResolver();
            final DynamicConfigEvent event = Mockito.mock(DynamicConfigEvent.class);
            Mockito.when(event.getContent()).thenReturn("rule:\n"
                    + "  enableSpring: true # SpringCloud Elegant On/Off Line Switch\n"
                    + "  startDelayTime: 20  # Elegant up/down line start-up delay time, in S\n"
                    + "  enableWarmUp: true # Specifies whether to enable preheating\n"
                    + "  warmUpTime: 1200    # Warm-up time, in S\n"
                    + "  enableGraceShutdown: false # Whether to enable elegant offline\n"
                    + "  shutdownWaitTime: 300  # The maximum wait time for correlation traffic detection before closing"
                    + ", in S. enabledGraceShutdown must be enabled for it to take effect\n"
                    + "  enableOfflineNotify: true # Specifies whether to enable offline notifications\n"
                    + "  httpServerPort: 26688 # Enable the HTTP server port for active notifications when you go offline\n"
                    + "  upstreamAddressMaxSize: 5000 # The default size of the cache upstream address\n"
                    + "  upstreamAddressExpiredTime: 600 # The expiration time of the upstream address of the cache");
            Mockito.when(event.getKey()).thenReturn("sermant.agent.grace");
            configResolver.updateConfig(event);
            final GraceConfig graceConfig = config(configResolver, GraceConfig.class);
            Assert.assertTrue(graceConfig.isEnableSpring());
            Assert.assertEquals(graceConfig.getStartDelayTime(), TEST_START_DELAY_TIME);
            Assert.assertTrue(graceConfig.isEnableWarmUp());
            Assert.assertEquals(graceConfig.getWarmUpTime(), TEST_WARM_UP_TIME);
            Assert.assertFalse(graceConfig.isEnableGraceShutdown());
            Assert.assertEquals(graceConfig.getShutdownWaitTime(), TEST_SHUTDOWN_WAIT_TIME);
            Assert.assertTrue(graceConfig.isEnableOfflineNotify());
            Assert.assertEquals(graceConfig.getHttpServerPort(), TEST_HTTP_SERVER_PORT);
            Assert.assertEquals(graceConfig.getUpstreamAddressMaxSize(), TEST_UPSTREAM_ADDRESS_MAXSIZE);
            Assert.assertEquals(graceConfig.getUpstreamAddressExpiredTime(), TEST_UPSTREAM_ADDRESS_EXPIRED_TIME);
            Mockito.when(event.getContent()).thenReturn("rule:\n"
                    + "  enableSpring: true # SpringCloud Elegant On/Off Line Switch");
            configResolver.updateConfig(event);
            final GraceConfig config = config(configResolver, GraceConfig.class);
            Assert.assertEquals(config.getShutdownWaitTime(), TEST_DEFAULT_SHUTDOWN_WAIT_TIME);
        }
    }