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
import java.io.IOException; | |
import java.nio.charset.StandardCharsets; | |
import org.apache.http.Header; | |
import org.apache.http.HttpResponse; | |
import org.apache.http.client.methods.HttpDelete; | |
import org.apache.http.client.methods.HttpGet; | |
import org.apache.http.client.methods.HttpPost; | |
import org.apache.http.client.methods.HttpPut; | |
import org.apache.http.entity.StringEntity; |
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 class Response { | |
private ResponseStatus status; | |
public Response(HttpResponse httpResponse) { | |
this.status = new ResponseStatus(httpResponse); | |
} | |
public ResponseStatus getStatus() { | |
return status; | |
} |
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
import java.io.IOException; | |
import io.lenar.examples.spring.clients.response.BookResponse; | |
import io.lenar.examples.spring.clients.response.BooksResponse; | |
import io.lenar.examples.spring.clients.response.Response; | |
import io.lenar.examples.spring.http.HttpClient; | |
import io.lenar.examples.spring.model.Book; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.stereotype.Component; |
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
import java.io.IOException; | |
import java.nio.charset.StandardCharsets; | |
import java.util.Arrays; | |
import java.util.List; | |
import io.lenar.examples.spring.TestNGWithSpringApplication; | |
import io.lenar.examples.spring.http.HttpClient; | |
import io.lenar.examples.spring.model.Book; | |
import org.apache.commons.io.IOUtils; |
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
@SpringBootTest(classes = TestNGWithSpringApplication.class) | |
public class BookServiceClientExampleIT extends AbstractTestNGSpringContextTests { | |
@Autowired | |
BookServiceClient client; | |
@Test | |
public void createUpdateDeleteScenarioTest() throws IOException { | |
Book createdBook = client.createBook(new Book("Title", "Author")).dto(); | |
String id = createdBook.getId(); |
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
sudo mount -t vboxsf hostfolder guestFolder |
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
<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
String path = this.getClass().getResource("/my-local-form-page.html").getPath(); | |
driver.get("file://" + path); | |
driver.findElement(By.id("button")).click(); |
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
String script = "arguments[0].innerHTML='" + StringEscapeUtils.escapeEcmaScript(innerHtml) + "'"; | |
((JavascriptExecutor) driver).executeScript(script, webElement); |