- Project: https://github.com/architects4j/devoxx-be-2022
- Step by step guide: https://architects4j.github.io/devoxx-be-2022/
| @PostMapping("/") | |
| @ResponseStatus(HttpStatus.CREATED) | |
| public ResponseEntity<Simulation> newSimulation(@Valid @RequestBody SimulationDto simulation) { | |
| checkForRestriction(simulation.getCpf()); | |
| Simulation createdSimulation = repository.save(new ModelMapper().map(simulation, Simulation.class)); | |
| URI location = ServletUriComponentsBuilder.fromCurrentRequest().path("/{cpf}"). | |
| buildAndExpand(createdSimulation.getCpf()).toUri(); | |
| return ResponseEntity.created(location).build(); |
Build robust API tests with RestAssured
This workshop will show you how to use a different approach from SpringTest or any other tool to build robust API tests in the integration later or intra-services.
Rest-Assured is a well-known Java DSL for testing REST services, giving software engineers a lot of freedom during the test automation process creation.
Parallel frontend test execution using Selenium and Docker
Nowadays, the main problem regarding front-end test execution is the time spent to cover the necessary scenarios to get the proper quality feedback. It's no wonder that we are focusing more on the earlier test stages like unit and integration. But frontend tests are also important, so how to make them faster?
I could reduce 2 days of manual tests to 35min sequential tests to 6min parallel tests for the same test suite! So you also can!
Managing Testing Data
Have you ever tried to troubleshoot an issue taking a looking at the log files? I bet you did! And it turns out the issue is related to data usage because, you know, users will use real data! Developers won't! A good thing about your recent troubleshooting is that you can understand the data. It's not a bunch of numbers or UUIDs in the name field. How about your development environment? Probably you use either hard-coded data or random strings. We must fix that!
🟢 abstract ready | 🔵 no abstract | 🟡 need improvement
How to fast generate your API Test with OpenAPI Tools and Rest-Assured
API testing is, nowadays, a common activity for any team. Some still use record-and-play or tools that provide an IDE because it accelerates the test creation at the beginning, but in the mid to long term, it does not scale. Most of them have reasons: lack of programming skill, patterns, or simply time to do it.
In this presentation, you will learn how to speed up the API test automation using Java and Rest-Assured while the OpenAPI tools will create all the standard code to deal with the HTTP requests
| public class PageObject extends AbstractPageObject { | |
| // WebElements ignored | |
| protected PageObject(WebDriver driver) { | |
| super(driver); | |
| } | |
| // action steps ignored | |
| } |
| public abstract class AbstractPageObject { | |
| private WebDriver driver; | |
| protected AbstractPageObject(WebDriver driver) { | |
| PageFactory.initElements(new AjaxElementLocatorFactory(driver, 5), this); | |
| } | |
| } |
| public class PageObjectExample { | |
| private WebDriver driver; | |
| // WebElements ignored | |
| public PageObjectExample(WebDriver driver) { | |
| PageFactory.initElements(new AjaxElementLocatorFactory(driver, 5), this); | |
| } | |
| } |