![](/img/trans.png)
[英]How to mock an instance method on injected instance of the class under test?
我正在嘗試模擬一個真實的 object 中的實例方法,該實例方法被注入到我在spock中的測試 class 中,並且我正在使用 Micronaut(使用 Java)編寫我的應用程序。 它是這樣的: ClassUnderTest是這樣的:@Singleton class ClassUnderTes ...
[英]How to mock an instance method on injected instance of the class under test?
我正在嘗試模擬一個真實的 object 中的實例方法,該實例方法被注入到我在spock中的測試 class 中,並且我正在使用 Micronaut(使用 Java)編寫我的應用程序。 它是這樣的: ClassUnderTest是這樣的:@Singleton class ClassUnderTes ...
[英]How to select the correct TransactionManager when using R2DBC together with Flyway and JDBC
設置: 微航 3.7.2 micronaut-data 3.8.1,micronaut-data-r2dbc,r2dbc-postgresql 0.9.2 Flyway 8.5.13、micronaut-jdbc-hikari、micronaut-flyway 5.4.1、postgresql ...
[英]Micronaut Test Resources: How to extend AbstractTestContainersProvider class
Micronaut 文檔說: 對於使用 Testcontainers 的測試資源,您可以擴展基礎 AbstractTestContainersProvider class。 我的問題是:如何將此 class 正確添加到測試資源源集的類路徑中(我正在使用 Gradle) ...
[英]How to Override a OnApplicationEvent method from Running on StartupEvent in Tests in Micronaut Application
我有一個 OnApplicationEvent,它會在服務器啟動時執行一些花哨的預定代碼。 我想要做的是至少對我的所有單元測試禁用/覆蓋此調用。 我在 Micronaut 應用程序中工作。 我怎樣才能做到這一點? ...
[英]Setting Test MongoDBContainer with Junit 5 and Micronaut
嘗試使用 Junit 5 和 micronaut 設置測試 MongoDBContainer,而不是在使用 application.yml 配置的測試環境上的隨機端口上盯着 MongoDB。 應用程序.yml Junit測試 在shouldSearchBasedOnTheName方法上,返回值來 ...
[英]Junit 5 functional testing the Micronaut Messaging-Driven Application
我有一個 Rabbit MQ Micronaut 消息驅動應用程序。 該應用程序僅包含消費者端,生產者端在另一個 REST API 應用程序上。 現在我只想在消費者端進行 JUnit 5 測試。 試圖獲得測試僅包含 Rabbit MQ 偵聽器的消息驅動應用程序的最佳想法 經過一番研究,我發現我們可以 ...