Skip to content

bitDive/bitdive-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BitDive Testing (Starter Skeleton)

Минимальный скелет двух модулей:

  • bitdive-testing-core — fluent API BitDiveTest, стор трассы, каркасы реплеев (HTTP/DB), простые сравнения.
  • bitdive-testing-spring-boot-starter — авто‑конфиг для профиля bitdive-test, регистрирует @Primary реплееры.

Использование в тесте

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();

По умолчанию trace грузится с classpath: /bitdive/traces/<traceId>.json и вытаскивает поля args и methodReturn.

Важно: в этом скелете DataSource и HTTP‑реплей — заготовки. Они компилируются, но SQL‑реплей требует реализации Connection/Statement/ResultSet, а HTTP‑поиск записей нужно связать с вашим форматом restCalls.

Сборка

mvn -q -DskipTests clean install

Куда дописывать логику

  • HTTP: io.bitdive.testing.core.http.BitDiveRestReplayInterceptor + маппинг store.findHttp(...)
  • DB: io.bitdive.testing.core.db.BitDiveReplayDataSource (реализовать replay соединение/стейтменты)
  • Store/loader: распарсить sqlCalls, restCalls, queueCalls и выдавать их по ключам/порядку.
  • Сравнение: Comparator (сейчас простое сравнение через Jackson), SequenceVerifier для порядков.

About

dependency for creating tests based on the monitoring system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published