Нет подходящего компонента типа [org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping] - PullRequest
0 голосов
/ 06 октября 2018

У меня приложение весенней загрузки с настроенным чванством.Я получаю сообщение об ошибке при тестировании огурца.Вот конфигурация:

@Configuration
@EnableSwagger2
@EnableWebMvc
public class SwaggerConfig {  
}

@Category(IntegrationTest.class)
@RunWith(Cucumber.class)
@ContextConfiguration("classpath:cucumber-spring-beans.xml")
@CucumberOptions(snippets = SnippetType.CAMELCASE, strict = true, monochrome = true, tags = {"~@ManualTest", "~@SlowTest", "~@IgnoreTest", "~@AdHoc", "@IntegrationTest"}, 
features = {CucumberRunnerUtil.CukeFormat.FEATURE_FILE_LOCATION},
plugin = {"pretty", CucumberRunnerUtil.CukeFormat.CD_HTML_REPORT_INTEGRATION, 
        CucumberRunnerUtil.CukeFormat.CD_JSON_RESULTS_INTEGRATION + "integration-test-reports.json",
        CucumberRunnerUtil.CukeFormat.CD_JUNIT_XML_REPORT_INTEGRATION + "integration-test-reports.xml"})
public class RunIntegrationCukeTest {



}

cucumber-spring-beans.xml:

<context:component-scan base-package="org.springframework.samples.mvc" />
<context:annotation-config/>

    <context:annotation-config/>
    <mvc:annotation-driven/>

    <context:component-scan base-package="com...." >
        <context:exclude-filter type="assignable" expression="com...."/>
    </context:component-scan>

    <context:component-scan base-package="com...." >

    </context:component-scan>

1 Ответ

0 голосов
/ 08 октября 2018

Исключая связанные с Swagger классы конфигурации Java из cucumber-spring-beans.xml сделали свое дело:

<context:component-scan base-package="...webservice.resource" >
        <context:exclude-filter type="assignable" expression="...webservice.resource.Application"/>
        <context:exclude-filter type="assignable" expression="...webservice.resource.SwaggerConfig"/>
        <context:exclude-filter type="assignable" expression="...webservice.resource.JerseyConfig"/>
        <context:exclude-filter type="assignable" expression="...webservice.resource.CombinedResourceProvider"/>    
    </context:component-scan>
...