Articles Tagged ‘http’
Sunday, July 29th, 2018
When implementing distributed systems, client-server architectures and simple applications with network related functionalities, everything is fine when we’re in the development or in the testing stage because the network is reliable and the communicating systems are not as stressed as they are in production.
But to sleep well we want to validate how resilient we have implemented our systems, how they behave when the network fails, the latency rises, the bandwidth is limited, connections time out and so on.
In the following tutorial I will demonstrate how to set up a testing environment to simulate different classical network problems with a tool named Toxiproxy and I will show how to integrate it with the well known Java testing stack with Maven and JUnit.
(more…)
Tags: architecture, bandwidth, container, docker, docker-maven, downstream, failsafe, http, http-client, jigsaw, jitter, junit, latency, maven, module, network, resilient, surefire, testing, testrule, toxic, toxiproxy, toxiproxy-cli, upstream, wiremock
Posted in Java, testing | No Comments »
Thursday, April 6th, 2017
There is a new testing framework out there called Karate that is build on top of the popular Cucumber framework.
Karate makes it easy to script interactions with out web-services under test and verify the results. In addition it offers us a lot of useful features like parallelization, script/feature re-use, data-tables, JsonPath and XPath support, gherkin syntax, switchable staging-configurations and many others.
In the following tutorial we’ll be writing different scenarios and features for a real-world RESTful web-service to demonstrate some of its features.
(more…)
Tags: attd, bdd, cucumber, feature, http, Java, javascript, json, junit, karate, rest, restful, scenario, soap, tdd, testing, xml
Posted in Java, Web Services, testing | 4 Comments »
Sunday, September 18th, 2016
When it comes to writing microservices in Java, plenty of tools and frameworks exist. In the following tutorial, I’d like to demonstrate another minimalistic framework called Bootique by implementing a simple microservice exposing its functions either as a RESTful web-service or as a runnable command executed using the command line. (more…)
Tags: bootique, cli, command, di, guice, http, jax-rs, jaxrs, jetty, maven, microservice, microservices, rest, yaml
Posted in Java | No Comments »
Tuesday, January 5th, 2016
When writing tests for our software components sometimes we need to mock external services based on the HTTP protocol, might it be a RESTful web-service, an XML-RPC call or a simple GET request to some web-server.
In the following short tutorial I’d like to demonstrate how to create a mock HTTP server for testing and how to bootstrap and bind it to the life-cycle of a classical build-management tool like Maven.
(more…)
Tags: fake, http, https, integrationtest, junit, maven, mock, mockserver, rest, server, stub, test, verify
Posted in Java, testing | 3 Comments »