embedded-toxiproxy-junit4

Toxiproxy embedded server and client for Java integration testing

License

License

Categories

Categories

JUnit Unit Testing
GroupId

GroupId

io.github.coffee-break
ArtifactId

ArtifactId

embedded-toxiproxy-junit4
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

embedded-toxiproxy-junit4
Toxiproxy embedded server and client for Java integration testing
Project URL

Project URL

https://github.com/coffee-break/embedded-toxiproxy
Source Code Management

Source Code Management

https://github.com/coffee-break/embedded-toxiproxy

Download embedded-toxiproxy-junit4

Dependencies

compile (3)

Group / Artifact Type Version
io.github.coffee-break : embedded-toxiproxy-core jar 0.2.0
junit : junit jar 4.12
eu.rekawek.toxiproxy : toxiproxy-java jar 2.1.3

runtime (1)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.30

Project Modules

There are no modules declared in this project.

embedded-toxiproxy

Toxiproxy embedded server for Java integration testing

Build Status codecov.io

Maven dependency

Maven Central:

<dependency>
  <groupId>io.github.coffee-break</groupId>
  <artifactId>embedded-toxiproxy-junit4</artifactId>
  <version>0.1.0</version>
</dependency>

Usage

Running ToxiproxyServer is as simple as:

ToxiproxyServer toxiproxyServer = new ToxiproxyServer();
toxiproxyServer.start();
// do some work
toxiproxyServer.stop();

Or you can use junit rule as:

@ClassRule
public static ToxiproxyServerRule toxiproxyServerRule = new ToxiproxyServerRule(ToxiproxyServerConfiguration.builder().timeout(5000));

Also a client junit rule has been provided to use as:

    private final static ProxyConfiguration proxyConfiguration = ProxyConfiguration.builder()
            .name("database")
            .host("localhost")
            .listenPort(9124)
            .upstreamPort(9123)
            .build();

    @ClassRule
    public static final ToxiproxyRule databaseWithToxiproxy = new ToxiproxyRule(proxyConfiguration, new SqlDatabaseServerRule());

Toxiproxy version

Currently only 2.1.4 is provided

License

Licensed under the Apache License, Version 2.0

Contributors

Changelog

0.1.0

  • Initial release

0.2.0

  • Add ToxiproxyRule for simplified setup

Versions

Version
0.2.0
0.1.0