private NodeType findNodeType(
            ApplicationEnvironmentPreparedEvent event,
            Class<?> applicationClass) {
        Application application = applicationClass.getDeclaredAnnotation(Application.class);
        if (application != null) {
            return application.nodeType();
        }
        Class<?> currentClass = applicationClass;
        do {
            for (Annotation annotation : currentClass.getDeclaredAnnotations()) {
                String annotationName = annotation.annotationType()
                        .getName();
                if (!"org.springframework.boot.test.context.SpringBootTest"
                        .equals(annotationName)) {
                    continue;
                }
                for (Object source : event.getSpringApplication()
                        .getAllSources()) {
                    if (source instanceof Class<?> clazz) {
                        application = clazz.getDeclaredAnnotation(Application.class);
                        if (application != null) {
                            return application.nodeType();
                        }
                    }
                }
            }
            currentClass = currentClass.getSuperclass();
        } while (currentClass != null);
        throw new RuntimeException(
                "Could not find the node type of the application: "
                        + applicationClass.getName());
    }
@implNote We don't use {@link ApplicationContextInitializedEvent} because it is still too
          late for logging.
turms-server-common/src/main/java/im/turms/server/common/infra/application/ApplicationEnvironmentEventListener.java