Skip to content

dependency for creating tests based on the monitoring system

Notifications You must be signed in to change notification settings

bitDive/bitdive-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BitDive Testing (Starter Skeleton)

A minimal two-module testing skeleton:

  • bitdive-testing-core – fluent API BitDiveTest, trace store, replay skeletons (HTTP/DB), basic comparisons.
  • bitdive-testing-spring-boot-starter – auto-config for the bitdive-test profile, registers @Primary replayers.

Usage in a Test

BitDiveTest.run()
  .springBootApp(App.class)
  .traceId("51df62ed-7544-11f0-8895-81497df45889")
  .classForTest(Controller.class)
  .methodForTest("updateStudent", StudentRecord.class, Integer.class)
  .typeComparison(BitDiveTest.ComparisonMode.ALL)
  .replayHttp(true).replayDb(true)
  .execute().assertOk();

By default, the trace is loaded from the classpath: /bitdive/traces/<traceId>.json
and extracts the args and methodReturn fields.

Important: in this skeleton, the DataSource and HTTP replay are placeholders.
They compile, but SQL replay requires implementing Connection/Statement/ResultSet,
and the HTTP record lookup must be wired to your own restCalls format.

Build

mvn -q -DskipTests clean install

Where to Add Logic

  • HTTP: io.bitdive.testing.core.http.BitDiveRestReplayInterceptor + mapping store.findHttp(...)
  • DB: io.bitdive.testing.core.db.BitDiveReplayDataSource (implement replay connections/statements)
  • Store/Loader: parse sqlCalls, restCalls, queueCalls and return them by keys/order
  • Comparison: Comparator (currently simple Jackson-based comparison), SequenceVerifier for call ordering

About

dependency for creating tests based on the monitoring system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages