Skip to content

Commit e3604ec

Browse files
committed
feat: Add seed as output on start
1 parent 09eaa5b commit e3604ec

1 file changed

Lines changed: 16 additions & 24 deletions

File tree

src/main/java/dev/dochia/cli/core/command/TestCommand.java

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import dev.dochia.cli.core.report.TestCaseListener;
2222
import dev.dochia.cli.core.util.CommonUtils;
2323
import dev.dochia.cli.core.util.ConsoleUtils;
24+
import dev.dochia.cli.core.util.DochiaRandom;
2425
import dev.dochia.cli.core.util.OpenApiUtils;
2526
import dev.dochia.cli.core.util.VersionChecker;
2627
import dev.dochia.cli.core.util.VersionProvider;
@@ -358,25 +359,21 @@ private void printConfiguration(OpenAPI openAPI) {
358359
ansi().fg(Ansi.Color.BLUE).a(reportingArguments.getOutputReportFolder()).reset());
359360
logger.config(
360361
ansi().bold().a("{} configured playbooks out of {} total playbooks").bold().reset().toString(),
361-
ansi()
362-
.fg(Ansi.Color.BLUE)
362+
ansi().fg(Ansi.Color.BLUE)
363363
.a(filterArguments.getFirstPhasePlaybooksForPath().size())
364364
.reset()
365365
.bold(),
366-
ansi()
367-
.fg(Ansi.Color.BLUE)
366+
ansi().fg(Ansi.Color.BLUE)
368367
.a(filterArguments.getAllRegisteredPlaybooks().size())
369368
.reset()
370369
.bold());
371370
logger.config(
372-
ansi()
373-
.bold()
371+
ansi().bold()
374372
.a("{} configured paths out of {} total OpenAPI paths")
375373
.bold()
376374
.reset()
377375
.toString(),
378-
ansi()
379-
.fg(Ansi.Color.BLUE)
376+
ansi().fg(Ansi.Color.BLUE)
380377
.a(filterArguments.getPathsToRun(openAPI).size())
381378
.bold()
382379
.reset()
@@ -386,43 +383,35 @@ private void printConfiguration(OpenAPI openAPI) {
386383
ansi().bold().a("HTTP methods in scope: {}").reset().toString(),
387384
ansi().fg(Ansi.Color.BLUE).a(filterArguments.getHttpMethods()).reset());
388385
logger.config(
389-
ansi()
390-
.bold()
386+
ansi().bold()
391387
.bold()
392-
.a(
393-
"Example flags: use-request-body-examples {}, use-schema-examples {}, use-property-examples {}, use-response-body-examples {}, use-defaults {}")
388+
.a("Example flags: use-request-body-examples {}, use-schema-examples {}, use-property-examples {}, use-response-body-examples {}, use-defaults {}")
394389
.reset()
395390
.toString(),
396391
ansi().fg(Ansi.Color.BLUE).a(processingArguments.isUseRequestBodyExamples()).reset().bold(),
397392
ansi().fg(Ansi.Color.BLUE).a(processingArguments.isUseSchemaExamples()).reset().bold(),
398393
ansi().fg(Ansi.Color.BLUE).a(processingArguments.isUsePropertyExamples()).reset().bold(),
399-
ansi()
400-
.fg(Ansi.Color.BLUE)
394+
ansi().fg(Ansi.Color.BLUE)
401395
.a(processingArguments.isUseResponseBodyExamples())
402396
.reset()
403397
.bold(),
404398
ansi().fg(Ansi.Color.BLUE).a(processingArguments.isUseDefaults()).reset().bold());
405399
logger.config(
406-
ansi()
407-
.bold()
408-
.a(
409-
"self-reference-depth {}, large-strings-size {}, random-headers-number {}, limit-fuzzed-fields {}, limit-xxx-of-combinations {}")
400+
ansi().bold()
401+
.a("self-reference-depth {}, large-strings-size {}, random-headers-number {}, limit-fuzzed-fields {}, limit-xxx-of-combinations {}")
410402
.reset()
411403
.toString(),
412404
ansi().fg(Ansi.Color.BLUE).a(processingArguments.getSelfReferenceDepth()).reset().bold(),
413405
ansi().fg(Ansi.Color.BLUE).a(processingArguments.getLargeStringsSize()).reset().bold(),
414406
ansi().fg(Ansi.Color.BLUE).a(processingArguments.getRandomHeadersNumber()).reset().bold(),
415407
ansi().fg(Ansi.Color.BLUE).a(processingArguments.getLimitNumberOfFields()).reset().bold(),
416-
ansi()
417-
.fg(Ansi.Color.BLUE)
408+
ansi().fg(Ansi.Color.BLUE)
418409
.a(processingArguments.getLimitXxxOfCombinations())
419410
.reset()
420411
.bold());
421412
logger.config(
422-
ansi()
423-
.bold()
424-
.a(
425-
"How the service handles whitespaces and random unicodes: edge-spaces-strategy {}, sanitization-strategy {}")
413+
ansi().bold()
414+
.a("How the service handles whitespaces and random unicodes: edge-spaces-strategy {}, sanitization-strategy {}")
426415
.reset()
427416
.toString(),
428417
ansi().fg(Ansi.Color.BLUE).a(processingArguments.getEdgeSpacesStrategy()).reset().bold(),
@@ -432,6 +421,9 @@ private void printConfiguration(OpenAPI openAPI) {
432421
logger.config(
433422
ansi().bold().a("Total number of OpenAPI operations: {}").reset().toString(),
434423
ansi().fg(Ansi.Color.BLUE).a(nofOfOperations));
424+
logger.config(ansi().bold().a("Seed value: {}").reset().toString(),
425+
ansi().fg(Ansi.Color.BLUE).a(DochiaRandom.getStoredSeed()).reset().bold());
426+
435427
}
436428

437429
private void fuzzPath(Map.Entry<String, PathItem> pathItemEntry, OpenAPI openAPI) {

0 commit comments

Comments
 (0)