在JUNIT中传递参数时错误
我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论