404 mit Zitrus 3,0Java

Java-Forum
Guest
 404 mit Zitrus 3,0

Post by Guest »

Nach der Migration zur neuesten Zitrusabhängigkeit geben alle meine Anforderungszuordnung 404.
pom.xml:-

Code: Select all

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0

org.springframework.boot
spring-boot-starter-parent
3.3.2
  

com.example
your-artifact-id
1.0.0-SNAPSHOT
demo
Demo project for Spring Boot

17
3.3.2
3.0.2



org.springframework.boot
spring-boot-starter-web


org.springframework.boot
spring-boot-starter


org.glassfish.jersey.core
jersey-client


org.glassfish.jersey.core
jersey-common


org.glassfish.jersey.inject
jersey-hk2
2.26


org.citrusframework
citrus-simulator
3.0.2
pom


org.citrusframework
citrus-simulator-starter
2.1.1



jakarta.xml.soap
jakarta.xml.soap-api
3.0.2


org.springframework.boot
spring-boot-starter-actuator


org.codehaus.groovy
groovy
2.5.23






org.springframework.boot
spring-boot-maven-plugin




< /code>
Konfiguration:-< /p>
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import org.citrusframework.simulator.http.HttpRequestAnnotationScenarioMapper;
import org.citrusframework.simulator.http.HttpRequestPathScenarioMapper;
import org.citrusframework.simulator.http.SimulatorRestAdapter;
import org.citrusframework.simulator.http.SimulatorRestConfigurationProperties;
import org.citrusframework.simulator.scenario.mapper.ContentBasedXPathScenarioMapper;
import org.citrusframework.simulator.scenario.mapper.ScenarioMapper;
import org.citrusframework.simulator.scenario.mapper.ScenarioMappers;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.http.HttpStatus;
import com.consol.citrus.endpoint.EndpointAdapter;
import com.consol.citrus.endpoint.adapter.StaticEndpointAdapter;
import com.consol.citrus.http.message.HttpMessage;
import com.consol.citrus.message.Message;

import jakarta.xml.soap.MessageFactory;

@SpringBootApplication(exclude = SecurityAutoConfiguration.class)
@componentscan(basePackages = {"com.example.demo.*"})
public class DemoApplication extends SimulatorRestAdapter {

@Override
public String urlMapping(SimulatorRestConfigurationProperties simulatorRestConfiguration) {
return "**";
}

@Override
public EndpointAdapter fallbackEndpointAdapter()  {
return new StaticEndpointAdapter() {
@Override
protected Message handleMessageInternal(Message message) {
return new HttpMessage().status(HttpStatus.INTERNAL_SERVER_ERROR);
}
};
}

// Note these run on all requests in order, so avoid collisions!
@Override
public ScenarioMapper scenarioMapper() {
return ScenarioMappers.of(new ContentBasedXPathScenarioMapper().addXPathExpression("//:request-id"),
new HttpRequestPathScenarioMapper(), new HttpRequestAnnotationScenarioMapper());
}

public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
< /code>
Szenarioklasse:-< /p>
package com.example.demo.controller;

import org.citrusframework.simulator.scenario.AbstractSimulatorScenario;
import org.citrusframework.simulator.scenario.Scenario;
import org.citrusframework.simulator.scenario.ScenarioDesigner;
import org.springframework.core.io.ClassPathResource;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Scenario("GetCircuit")
@RequestMapping(value = "/sim/accessMigration/v1/inventory/circuits/BBEC.000099..ATI", method = RequestMethod.GET)
public class TestClass extends AbstractSimulatorScenario {

@Override
public void run(ScenarioDesigner scenario) {

scenario.http().receive().get();
scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
.payload(new ClassPathResource("datamanager/GetCircuit.json"));

}
}
< /code>
[b] Application.Properties[/b]:-
spring.Application.Name=demo
spring.jackson.serialization.FAIL_ON_EMPTY_BEANS=false
logging.level.org.springframework.web=DEBUG
logging.level.org.citrusframework=DEBUG

info.simulator.name=REST Simulator
logging.file=debug.log
logging.level.com.consol.citrus=DEBUG
logging.level.com.att.mso=DEBUG
logging.level.org.reflections.Reflections=ERROR
< /code>
Aktivieren Sie die HTTP -REST -Unterstützung < /p>
citrus.simulator.rest.enabled=true
citrus.simulator.ws.enabled=true
citrus.simulator.ws.servlet.mapping=/services/ws/*
< /code>
Default Timeout -Einstellung < /p>
citrus.simulator.default.timeout=120000
citrus.simulator.defaultTimeout=120000
< /code>
Standardmeldungsvorlage Pfad < /p>
citrus.simulator.templatePath=templates
< /code>
Standardszenario -Name < /p>
citrus.simulator.defaultScenario=Default
< /code>
Sollte Zitrusfrüchte eingehende Nachrichten über Syntax und Semantik < /p>
validierencitrus.simulator.templateValidation=true

management.endpoints.web.exposure.include=*
Es gibt 404 nach dem Upgrade auf den neuesten Citrus Framework und Java 17.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post