Проблемы с запуском модульных тестов в QuarkusJAVA

Программисты JAVA общаются здесь
Ответить
Anonymous
 Проблемы с запуском модульных тестов в Quarkus

Сообщение Anonymous »

Я пытаюсь начать модульное тестирование, но при выполнении любого теста возникают ошибки:

Код: Выделить всё

@QuarkusTest
class AccountResourceTest {
@BeforeEach
void setUp() {
}

@Test
void getUserProfile() {
assertEquals("UserTest", "UserTest");
}
Однако при запуске этого теста я получаю следующие ошибки:

Код: Выделить всё

java.lang.RuntimeException: io.quarkus.bootstrap.BootstrapException: Failed to create the application model for backend-account::jar:2024.3.1-SNAPSHOTnull

at io.quarkus.test.junit.QuarkusTestExtension.throwBootFailureException(QuarkusTestExtension.java:642)
at io.quarkus.test.junit.QuarkusTestExtension.interceptTestClassConstructor(QuarkusTestExtension.java:726)
at java.base/java.util.Optional.orElseGet(Optional.java:364)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
Caused by: io.quarkus.bootstrap.BootstrapException: Failed to create the application model for backend-account::jar:2024.3.1-SNAPSHOTnull
at io.quarkus.bootstrap.BootstrapAppModelFactory.resolveAppModel(BootstrapAppModelFactory.java:308)
at io.quarkus.bootstrap.app.QuarkusBootstrap.bootstrap(QuarkusBootstrap.java:133)
at io.quarkus.test.junit.AbstractJvmQuarkusTestExtension.createAugmentor(AbstractJvmQuarkusTestExtension.java:190)
at io.quarkus.test.junit.QuarkusTestExtension.doJavaStart(QuarkusTestExtension.java:218)
at io.quarkus.test.junit.QuarkusTestExtension.ensureStarted(QuarkusTestExtension.java:609)
at io.quarkus.test.junit.QuarkusTestExtension.beforeAll(QuarkusTestExtension.java:659)
... 1 more
Caused by: java.lang.RuntimeException: Failed to create application model resolver for backend-account
at io.quarkus.bootstrap.BootstrapAppModelFactory.getAppModelResolver(BootstrapAppModelFactory.java:165)
at io.quarkus.bootstrap.BootstrapAppModelFactory.resolveAppModel(BootstrapAppModelFactory.java:293)
... 6 more
Caused by: java.lang.RuntimeException: Cannot get declared constructors from class org.apache.maven.profiles.activation.FileProfileActivator
at io.smallrye.beanbag.sisu.Sisu.findConstructor(Sisu.java:874)
at io.smallrye.beanbag.sisu.Sisu.addBeanFromXml(Sisu.java:453)
at io.smallrye.beanbag.sisu.Sisu.addClassLoader(Sisu.java:124)
at io.smallrye.beanbag.maven.MavenFactory.(MavenFactory.java:71)
at io.smallrye.beanbag.maven.MavenFactory.create(MavenFactory.java:96)
at io.smallrye.beanbag.maven.MavenFactory.create(MavenFactory.java:111)
at io.smallrye.beanbag.maven.MavenFactory.create(MavenFactory.java:124)
at io.quarkus.bootstrap.resolver.maven.BootstrapMavenContext.configureMavenFactory(BootstrapMavenContext.java:889)
at io.quarkus.bootstrap.resolver.maven.BootstrapMavenContext.initRepoSystemAndManager(BootstrapMavenContext.java:876)
at io.quarkus.bootstrap.resolver.maven.BootstrapMavenContext.getRepositorySystem(BootstrapMavenContext.java:292)
at io.quarkus.bootstrap.resolver.maven.MavenArtifactResolver.(MavenArtifactResolver.java:114)
at io.quarkus.bootstrap.BootstrapAppModelFactory.getAppModelResolver(BootstrapAppModelFactory.java:161)
... 7 more
Caused by: java.lang.NoClassDefFoundError: org/codehaus/plexus/util/interpolation/ValueSource
at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3549)
at java.base/java.lang.Class.getDeclaredConstructors(Class.java:2727)
at io.smallrye.beanbag.sisu.Sisu.findConstructor(Sisu.java:872)
... 18 more
Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.util.interpolation.ValueSource
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
...  22 more

Чтобы вы лучше поняли мою настройку, вот зависимости, которые я использую

Код: Выделить всё

 

io.quarkus
quarkus-junit5
test


io.rest-assured
rest-assured
test


io.quarkus
quarkus-junit5-mockito
test


io.quarkus
quarkus-test-security
test


org.wiremock
wiremock
${org.wiremock.version}
provided


io.quarkus
quarkus-jacoco
test

Я хотел бы знать:
  • Какие шаги я могу предпринять для их решения?
Будем очень признательны за любые советы и предложения. Заранее спасибо!

Подробнее здесь: https://stackoverflow.com/questions/792 ... in-quarkus
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «JAVA»