Skip to content

qx57/tdo-example-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example for TDO usage in Java/TestNG tests

Requirements

  • Java ^1.8
  • Docker

Description

TDO (Test entity Definition Object) is the class of objects which defines testing entities such as web pages, API endpoints, DB tablest and other. TDO usage makes your autotests more uniform, maintenanceable and readable.

See the TestDriven Conf presentation for more info.

ATTENTION! API and DB tests fail on 3rd step - it's ok because used lazy stub have no behavior changing order status.

Before run tests

  1. Before you run this example tests needed up all docker containers:
> docker run --name wiremock -p 4231:8080 -d rodolpheche/wiremock
> docker run --name postgres -e POSTGRES_PASSWORD=pwd123 -e POSTGRES_USER=postgres -e POSTGRES_DB=test -p 6543:5432 -d postgres
  1. Set wiremock through API requests POST http://localhost:4231/__admin/mappings/, use body from resource directory. More info about Wiremock settings here.

  2. Set DB through any client, send next SQL queries:

CREATE TABLE orders (
    id SERIAL PRIMARY KEY,
    status VARCHAR
);

and then

INSERT INTO orders (id, status) VALUES (123, 'new');

You are ready to check exanple tests! =)

Test running

You can start tests in IDEA or use maven:

> mvn clean test

Contributors

qx57

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages