0

i generate spring project from https://start.spring.io/ and added jaxb2 to generated classes from wsdl file (soap project).

https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.springframework.boot spring-boot-starter-parent 2.1.8.RELEASE mk.test PortingMK 0.0.1-SNAPSHOT PortingMK Demo project for Spring Boot

<properties>
    <java.version>11</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web-services</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>wsdl4j</groupId>
        <artifactId>wsdl4j</artifactId>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jaxb2-maven-plugin</artifactId>
            <version>2.5.0</version>
            <executions>
                <execution>
                    <id>xjc</id>
                    <goals>
                        <goal>xjc</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <sourceType>wsdl</sourceType>

                <sources>
                    <source>${project.basedir}/src/main/resources/wsdl/NetworkOperator_WS.wsdl</source>
                </sources>
                <wsdl>true</wsdl>
                <xmlschema>false</xmlschema>

               <!-- <schemaDirectory>${project.basedir}/src/main/resources/wsdl</schemaDirectory> -->
                <outputDirectory>${project.basedir}/src/main/java</outputDirectory>
                <!--<clearOutputDir>false</clearOutputDir>-->
            </configuration>
        </plugin>
    </plugins>
</build>

The main issue when trying to do mvn clean install is that i am getting

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.355 s <<< FAILURE! - in mk.test.PortingMK.PortingMkApplicationTests initializationError(mk.test.PortingMK.PortingMkApplicationTests) Time elapsed: 0.005 s <<< ERROR! java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test

Thank you for help!

lexicore
  • 42,748
  • 17
  • 132
  • 221
Miha Zoubek
  • 65
  • 10
  • Can you show the code of the `PortingMkApplicationTests` class? – Ortomala Lokni Sep 23 '19 at 18:01
  • @OrtomalaLokni ```package mk.test.PortingMK; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class PortingMkApplicationTests { @Test public void contextLoads() { } }``` – Miha Zoubek Sep 23 '19 at 19:14

0 Answers0