generated from konveyor/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Juan Manuel Leflet Estrada <jleflete@redhat.com>
- Loading branch information
Showing
4 changed files
with
53 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 8 additions & 2 deletions
10
...nerated/spring-framework/tests/data/web-applications/src/main/java/org/konveyor/Main.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
package org.konveyor; | ||
|
||
import org.springframework.web.client.RestTemplate; | ||
|
||
import javax.xml.transform.Source; | ||
import java.beans.IntrospectionException; | ||
import java.net.URI; | ||
import java.net.URISyntaxException; | ||
|
||
public class Main { | ||
|
||
public static void main(String[] args) throws IntrospectionException { | ||
|
||
public static void main(String[] args) throws IntrospectionException, URISyntaxException { | ||
RestTemplate rest = new RestTemplate(); | ||
rest.getForObject(new URI("http://www.example.com/"), Source.class); | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
.../tests/data/web-applications/src/main/java/org/konveyor/controller/XmlRestController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.konveyor.controller; | ||
|
||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import javax.xml.transform.Source; | ||
import javax.xml.transform.stream.StreamSource; | ||
import java.io.StringReader; | ||
|
||
@RestController | ||
public class XmlRestController { | ||
|
||
public Source method(@RequestBody String xmlInput) { | ||
// For example, log the input or perform some processing here | ||
System.out.println("Received XML: " + xmlInput); | ||
|
||
// Assuming we want to respond with a modified version of the XML | ||
String responseXml = "<response><status>Success</status><originalMessage>%s</originalMessage></response>"; | ||
|
||
// Return the new XML wrapped in a StreamSource | ||
return new StreamSource(new StringReader(responseXml)); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,4 @@ tests: | |
analysisParams: | ||
mode: "source-only" | ||
hasIncidents: | ||
exactly: 2 | ||
exactly: 3 |