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 testCheckQosInApplicationConfig() throws Exception {
        ConfigValidationUtils mock = Mockito.mock(ConfigValidationUtils.class);
        ErrorTypeAwareLogger loggerMock = Mockito.mock(ErrorTypeAwareLogger.class);
        injectField(mock.getClass().getDeclaredField("logger"), loggerMock);
        ApplicationConfig config = new ApplicationConfig();
        config.setName("testName");
        config.setQosEnable(false);
        mock.validateApplicationConfig(config);
        verify(loggerMock, never()).warn(any(), any());

        config.setQosEnable(true);
        mock.validateApplicationConfig(config);
        verify(loggerMock)
                .warn(
                        eq(COMMON_CLASS_NOT_FOUND),
                        eq(""),
                        eq(""),
                        eq(
                                "No QosProtocolWrapper class was found. Please check the dependency of dubbo-qos whether was imported correctly."),
                        any());
    }