Skip to content

kensa-dev/clearwave-testng-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clearwave Kensa Example (TestNG)

A showcase project demonstrating Kensa — BDD testing for Kotlin & Java — running on TestNG.

This is the TestNG counterpart of clearwave-example (JUnit 6). Same domain, same Given-When-Then DSL, same per-test tracking-id pattern, same auto-published Kensa report — only the test runner differs.

The domain is a fictional telecoms provider ("Clearwave") with two services under test:

  • FeasibilityService — checks whether a broadband service can be delivered to a given address

  • OrderService — places a broadband order and coordinates with external network and tracking systems

  • System View — auto-generated component diagram showing the relationships across all services exercised in tests. Available as a top-level page in the report sidebar.

Tests are written using the Kensa Given-When-Then DSL with http4k stubs standing in for downstream APIs. The HTML report generated from these tests is published as a live example at:

kensa-dev.github.io/clearwave-testng-example

Running locally

./gradlew test

Runs the http4k-driven FeasibilityServiceTest and OrderServiceTest (plus the field DSL example and the two Java equivalents). The report is written to build/kensa-output.

To open the report:

kensa --dir build/kensa-output

TestNG integration

The Kensa lifecycle listener dev.kensa.testng.KensaTestNgListener is auto-discovered via ServiceLoader, so the test classes only need to register the project's own listener:

@Listeners(ClearwaveTestNgListener::class)
@UseSetupStrategy(SetupStrategy.Grouped)
abstract class ClearwaveTest : KensaTest, WithKotest

ClearwaveTestNgListener is an ISuiteListener — stubs start in onStart(suite) and stop in onFinish(suite).

Purpose

This project serves two roles:

  1. Showcase — a realistic example of Kensa tests on TestNG that visitors to kensa.dev can explore.
  2. Canary — run as part of Kensa's CI on every commit to master, building against the latest snapshot to catch regressions early.

Dependencies

Library Role
Kensa BDD test framework
http4k HTTP client & stub server
Kotest Assertions (Kotlin)
Hamcrest Assertions (Java)
TestNG Test runner

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors