更新:存储库链接已移至答案,因为存储库现在已使用下面答案中的代码进行更新。
问题描述
当前代码正在运行,但它使用来自google/cloud-sdk的gcloud beta 模拟器 pubsub进行集成测试。
我需要在maven-surefire-plugin.
<environmentVariables>
<PUBSUB_EMULATOR_HOST>localhost:8085</PUBSUB_EMULATOR_HOST>
</environmentVariables>
Run Code Online (Sandbox Code Playgroud)
如何在 Spring Boot 中完成此操作
根据测试容器 | Gcloud Module,在Spring Boot中与PubSubEmulatorContainer实现集成测试的正确方法是这样的:https: //github.com/saturnism/testcontainers-gcloud-examples/blob/main/springboot/pubsub-example/src/test/java /com/example/springboot/pubsub/PubSubIntegrationTests.java
这将在随机端口上启动容器,这在DynamicPropertyRegistrySpring 中是可能的。看来Micronaut缺少这种可能性。
文档: https: //www.testcontainers.org/modules/gcloud/
我正在寻找在 Micronaut 3.x 中实现的 JUnit5 或 Spock 集成测试的工作示例,该测试使用PubSubEmulatorContainer上述文档中描述的方式。
相关文档:https://micronaut-projects.github.io/micronaut-gcp/latest/guide/#emulator
GitHub 上有一些关于配置的评论TransportChannelProvider。我能够注入一个实例并检查它,但我仍然不知道到底要做什么。
这些是迄今为止最接近的线索: https://github.com/micronaut-projects/micronaut-gcp/issues/257 https://github.com/micronaut-projects/micronaut-gcp/pull/259
我在我的应用程序中使用vue-i18n(版本 8.24.2),一切都按预期工作,除非使用 locale = nb-NO(挪威语)渲染日期。预期格式:dd.MM.yyyy。实际格式:MM/dd/yyyy。将区域设置切换为德语(使用与挪威语相同的日期格式)时,将应用正确的日期格式。
这个悬而未决的问题可能会解决我的问题:https : //github.com/kazupon/vue-i18n/issues/625
我已经花了几个小时调查这个问题,但我目前被困住了,因此任何帮助将不胜感激。
我的i18n.ts(我省略了与此问题无关的语言的配置)
import Vue from "vue";
import VueI18n from "vue-i18n";
enum Locales {
NO = "nb-NO"
}
const LOCALES = [
{ value: Locales.NO, caption: "Norsk" }
];
import nb_NO from "./locales/nb-NO.json";
export const messages = {
[Locales.NO]: nb_NO
};
const defaultLocale = Locales.NO;
const dateTimeFormats = {
"nb-NO": {
short: {
year: "numeric",
month: "2-digit",
day: "2-digit",
},
long: {
year: "numeric", …Run Code Online (Sandbox Code Playgroud)