我有一个集成测试,我正在使用 Arquillian 和 ShrinkWrap 解析器在 Wildfly 中部署 2 个 Web 服务。这两个服务都是独立的,因此在任何 Maven 依赖意义上都不依赖于另一个。服务 2 对服务 1 进行 HTTP 调用。这纯粹是一个 B2B 场景,其中一个组件调用另一个组件。也就是说,这是我的测试。问题是,Arquillian 未能部署服务 1。由于 ShrinkWrap 错误消息毫无用处(实际上没有消息),我试图找出我做错了什么。我已经验证了服务 1 的工件确实存在于我的本地 Maven 存储库中。
@Deployment(name = AVAILABILITY_SERVICE_NAME, order = 1)
public static WebArchive createAvailabilityServiceDeployment() {
WebArchive availabilityService = Maven.configureResolver()
.workOffline().withMavenCentralRepo(false)
.withClassPathResolution(true)
.resolve(AVAILABILITY_SERVICE_MVN_COORD).withoutTransitivity()
.asSingle(WebArchive.class);
System.out.println(availabilityService.toString(true));
return availabilityService;
}
@Deployment(name = APPOINTMENT_SERVICE_NAME, order = 2)
public static WebArchive createAppointmentServiceDeployment()
throws FileNotFoundException {
WebArchive appointmentService = create(WebArchive.class,
APPOINTMENT_SERVICE_NAME + ".war").addPackages(true,
Filters.exclude(".*Test.*"), AppointmentApp.class.getPackage())
.addAsWebInfResource(EmptyAsset.INSTANCE,
ArchivePaths.create("beans.xml"));
System.out.println(appointmentService.toString(true));
return appointmentService;
}
java.lang.RuntimeException: Could not invoke deployment method: public static org.jboss.shrinkwrap.api.spec.WebArchive name.abhijitsarkar.microservices.appointment.AppointmentResourceIT.createAvailabilityServiceDeployment()
at org.jboss.shrinkwrap.resolver.spi.format.FormatProcessors.find(FormatProcessors.java:53)
at org.jboss.shrinkwrap.resolver.impl.maven.MavenFormatStageImpl.as(MavenFormatStageImpl.java:82)
at org.jboss.shrinkwrap.resolver.impl.maven.MavenFormatStageImpl.asSingle(MavenFormatStageImpl.java:100)
at name.abhijitsarkar.microservices.appointment.AppointmentResourceIT.createAvailabilityServiceDeployment(AppointmentResourceIT.java:50)