Тесты компонентов не работают из-за KieContainerJAVA

Программисты JAVA общаются здесь
Anonymous
Тесты компонентов не работают из-за KieContainer

Сообщение Anonymous »

Я учусь пускать слюни и делаю POC с помощью KieScanner. Я новичок в этом деле, поэтому столкнулся с некоторыми проблемами.
Что касается кода, он работает нормально, но когда я пытаюсь запустить другие тесты компонентов, они терпят неудачу с проблемой:

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

Cannot find KieModule: org.yaml:snakeyaml:LATEST
Поскольку я использую проект Gradle, я использую собственный файл settings.xml

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

Application.java

..

public static void main(String args[]) {
System.setProperty("kie.maven.settings.custom", "/settings.xml")
..}
У меня есть файл settings.xml в корневом каталоге моего проекта. Код работает нормально, когда я его собираю, но когда я пытаюсь запустить тесты компонентов, у меня возникает описанная выше проблема.

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

//Configuration class
@Configuration
public class SomeConfig {

@Bean
public KieContainer kieContainer() {
ReleaseId releaseId = kieServices.newReleaseId("org.yaml", "snakeyaml", "LATEST");
return kieServices.newKieContainer(releaseId);
}
}

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

Component Interface

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@ExtendWith({ SpringExtension.class })
@SpringBootTest(classes = Application.class)
@ActiveProfiles("Test")
public @interface ComponentTest {
}

Here are the annotations on every component test classes.

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

As per my understanding, what happens is, during the Application startup, the Configuration classes executes first which loads the KieContainer and I could see that latest version of Snakeyaml jar is present in my .m2. But I am not sure why the same is not happening when I am executing the Component Test. I have only provided the segments which I though is required here for the issue.


Подробнее здесь: https://stackoverflow.com/questions/785 ... econtainer

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