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
// host will be passed in the groovy bindings for extended choice plugin. | |
def getVersion = { host, path -> | |
try { | |
def version = new groovy.json.JsonSlurper().parse(new URL("https://${host}${path}")).version | |
return version | |
} catch(Exception e) { | |
return null | |
} | |
} |
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
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter</artifactId> | |
<exclusions> | |
<exclusion> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-tomcat</artifactId> | |
</exclusion> | |
</exclusions> | |
</dependency> |
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
@Component | |
public class TestData extends FileReader { | |
@Value("${testData.users.file}") | |
private String usersFile; | |
public List<User> getUsers() { | |
Gson gson = new Gson(); | |
return Arrays.asList(gson.fromJson(getFileAsString(usersFile), User[].class)); | |
} |
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
public List<String> getFileAsListOfStrings(String fileName) throws IOException { | |
InputStream input = this.getClass().getResourceAsStream("/" + fileName); | |
return IOUtils.readLines(input, StandardCharsets.UTF_8); | |
} |
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
public List<String> getFileAsListOfStringsGuava(String fileName) throws IOException { | |
InputStream input = this.getClass().getResourceAsStream("/" + fileName); | |
return CharStreams.readLines(new InputStreamReader(input, StandardCharsets.UTF_8)); | |
} |
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
public String getFileIntoStringGuava(String fileName) throws IOException { | |
InputStream input = this.getClass().getResourceAsStream("/" + fileName); | |
return CharStreams.toString(new InputStreamReader(input, StandardCharsets.UTF_8)); | |
} |
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
public String readFileIntoString(String fileName) throws IOException { | |
InputStream input = this.getClass().getResourceAsStream("/" + fileName); | |
return IOUtils.toString(input, StandardCharsets.UTF_8); | |
} |
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
package io.lenar.examples.spring.start; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
@SpringBootApplication | |
public class TestNGWithSpringApplication { | |
public static void main(String[] args) { | |
SpringApplication.run(TestNGWithSpringApplication.class, args); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
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"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>io.lenar.examples.spring</groupId> | |
<artifactId>start</artifactId> | |
<version>1.0-SNAPSHOT</version> |
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
package io.lenar.examples.spring.start; | |
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; | |
import org.springframework.boot.test.context.SpringBootTest; | |
import org.testng.Assert; | |
import org.testng.annotations.Test; | |
@SpringBootTest(classes = TestNGWithSpringApplication.class) | |
public class TestNGTestsWithSpringBootIT extends AbstractTestNGSpringContextTests { |