Merge branch 'master' of https://gitlab.gcp.windtre.it/olympus_ai/hermione
This commit is contained in:
@@ -27,6 +27,18 @@ public class ScenarioController {
|
||||
return scenarioRepository.findAll();
|
||||
}
|
||||
|
||||
|
||||
// Get single scenario
|
||||
|
||||
|
||||
|
||||
//Exec scenario che prende in input un json con l'id dello scenario e gli input dell'utente e restituisce il risultato dell'esecuzione
|
||||
// {scenarioid: 1, input: {input1: "valore1", input2: "valore2"}} =)> devi definire un DTO per questo json
|
||||
//nuovo metodo executeScenarioNew dello ScenarioExecutionService che prende in input l oggetto definito sopra
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("scenarios")
|
||||
public Scenario createScenario(@RequestBody Scenario scenario) {
|
||||
return scenarioRepository.save(scenario);
|
||||
|
||||
@@ -15,7 +15,7 @@ public class TestController {
|
||||
@GetMapping("/test/scenario_execution")
|
||||
public String testScenarioExecution(){
|
||||
|
||||
String result = scenarioExecutionService.executeScenario("66a7bbb7c5c2e1863e5d6db0","How a testcase is made on ATF ? What is the meaning of a Task?");
|
||||
String result = scenarioExecutionService.executeScenario("66aa162debe80dfcd17f0ef4","How i can change the path where uploaded documents are stored ?");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,4 +16,6 @@ public class Scenario {
|
||||
private String name;
|
||||
private String description;
|
||||
private List<ScenarioStep> steps;
|
||||
private List<ScenarioInputs> inputs;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.olympus.hermione.models;
|
||||
|
||||
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class ScenarioInputs {
|
||||
|
||||
private String name;
|
||||
private String type;
|
||||
private String label;
|
||||
}
|
||||
@@ -43,6 +43,13 @@ public class ScenarioExecutionService {
|
||||
|
||||
private Logger logger = LoggerFactory.getLogger(ScenarioExecutionService.class);
|
||||
|
||||
/*
|
||||
public String executeScenarioNew(ScenarioExecutionInput scenarioExecutionInput){
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
public String executeScenario(String scenarioId, String input){
|
||||
|
||||
Optional<Scenario> o_scenario = scenarioRepository.findById(scenarioId);
|
||||
|
||||
Reference in New Issue
Block a user