在JUNIT中传递参数时错误

发布于 2025-01-17 23:15:17 字数 1274 浏览 1 评论 0原文

我在 junit 中传递参数时遇到错误,任何人都可以建议我传递参数的正确格式。提前致谢

Feature Elevation Messaging Service Test
Service Test
C Campaign Messaging Service.java
5
Git: 0 FileReadUtils.java >
Messaging Service.javax FeatureElevation Messaging Service Testjava x CampaignMessaging Service Test.java
@InjectMocks FeatureElevationMessagingService notificationMessage Processor;
Not
A4
@Mock Sender sender;
@Test @Parameters({ "{\"featureElevation\": {\"files\": [{\"name\": "policy.cab\", \"epochTime\": 12324324}, {\"name\": \"driver.cab\"," +
\"epochTime\": 12324327}],\"hubName\": \"DEV-APAC1\", \"filepath\": \"csv_file/filePath.csv\"}",
})
public void invalidEventData_processNotificationMessage_throwsException_for_featureElevation(String eventBody, String expectedException)
EventData eventData = new EventData(eventBody); Throwable thrown = cotchThrowoble(() -> notificationMessage Processor.processEventMessage (eventData)); Assertions.assertThat(thrown) withFailMessage( newErrorMessage: "InvalidDataException is not thrown")
.isNotNullO) .is Instanceof(InvalidDataException.class) .hasToString(expectedException);
@Test @Parameters
"{\"campaign\": {\"filepath\", \"filepath.csv\"
,\"id\": "testCampaign1\"\\,\"expiryDateTime": 1640772505000\\,\"hubName\":\"/

I am getting the error while passing the parameters in junit, can anyone suggest me the right format to pass the parameters. thanks in advance

Feature Elevation Messaging Service Test
Service Test
C Campaign Messaging Service.java
5
Git: 0 FileReadUtils.java >
Messaging Service.javax FeatureElevation Messaging Service Testjava x CampaignMessaging Service Test.java
@InjectMocks FeatureElevationMessagingService notificationMessage Processor;
Not
A4
@Mock Sender sender;
@Test @Parameters({ "{\"featureElevation\": {\"files\": [{\"name\": "policy.cab\", \"epochTime\": 12324324}, {\"name\": \"driver.cab\"," +
\"epochTime\": 12324327}],\"hubName\": \"DEV-APAC1\", \"filepath\": \"csv_file/filePath.csv\"}",
})
public void invalidEventData_processNotificationMessage_throwsException_for_featureElevation(String eventBody, String expectedException)
EventData eventData = new EventData(eventBody); Throwable thrown = cotchThrowoble(() -> notificationMessage Processor.processEventMessage (eventData)); Assertions.assertThat(thrown) withFailMessage( newErrorMessage: "InvalidDataException is not thrown")
.isNotNullO) .is Instanceof(InvalidDataException.class) .hasToString(expectedException);
@Test @Parameters
"{\"campaign\": {\"filepath\", \"filepath.csv\"
,\"id\": "testCampaign1\"\\,\"expiryDateTime": 1640772505000\\,\"hubName\":\"/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文