public static void validateApplicationConfig(ApplicationConfig config) {
        if (config == null) {
            return;
        }

        if (!config.isValid()) {
            throw new IllegalStateException("No application config found or it's not a valid config! "
                    + "Please add <dubbo:application name=\"...\" /> to your spring config.");
        }

        // backward compatibility
        ScopeModel scopeModel = ScopeModelUtil.getOrDefaultApplicationModel(config.getScopeModel());
        PropertiesConfiguration configuration = scopeModel.modelEnvironment().getPropertiesConfiguration();
        String wait = configuration.getProperty(SHUTDOWN_WAIT_KEY);
        if (wait != null && wait.trim().length() > 0) {
            System.setProperty(SHUTDOWN_WAIT_KEY, wait.trim());
        } else {
            wait = configuration.getProperty(SHUTDOWN_WAIT_SECONDS_KEY);
            if (wait != null && wait.trim().length() > 0) {
                System.setProperty(SHUTDOWN_WAIT_SECONDS_KEY, wait.trim());
            }
        }

        checkName(NAME, config.getName());
        checkMultiName(OWNER, config.getOwner());
        checkName(ORGANIZATION, config.getOrganization());
        checkName(ARCHITECTURE, config.getArchitecture());
        checkName(ENVIRONMENT, config.getEnvironment());
        checkParameterName(config.getParameters());
        checkQosDependency(config);
    }
@Test
    void testValidateApplicationConfig() throws Exception {
        try (MockedStatic<ConfigValidationUtils> mockedStatic = Mockito.mockStatic(ConfigValidationUtils.class); ) {
            mockedStatic
                    .when(() -> ConfigValidationUtils.validateApplicationConfig(any()))
                    .thenCallRealMethod();
            ApplicationConfig config = new ApplicationConfig();
            Assertions.assertThrows(IllegalStateException.class, () -> {
                ConfigValidationUtils.validateApplicationConfig(config);
            });

            config.setName("testName");
            config.setOwner("testOwner");
            config.setOrganization("testOrg");
            config.setArchitecture("testArchitecture");
            config.setEnvironment("test");
            Map<String, String> map = new HashMap();
            map.put("k1", "v1");
            map.put("k2", "v2");
            config.setParameters(map);
            ConfigValidationUtils.validateApplicationConfig(config);
            mockedStatic.verify(
                    () -> {
                        ConfigValidationUtils.checkName(any(), any());
                    },
                    times(4));
            mockedStatic.verify(
                    () -> {
                        ConfigValidationUtils.checkMultiName(any(), any());
                    },
                    times(1));
            mockedStatic.verify(
                    () -> {
                        ConfigValidationUtils.checkParameterName(any());
                    },
                    times(1));
        }
    }