Endava / cats

CATS is a REST API Fuzzer and negative testing tool for OpenAPI endpoints. CATS automatically generates, runs and reports tests with minimum configuration and no coding effort. Tests are self-healing and do not require maintenance.
Apache License 2.0
1.17k stars 74 forks source link

Unsupported Operation Exception when supplying headers via -H flag #73

Closed VytautasKz closed 1 year ago

VytautasKz commented 1 year ago

Hello,

Since updating CATS to v9.0.0, I've noticed that whenever headers are supplied with the -H flag, an UnsupportedOperationException is thrown. Issue does not occur with version 8.4.0, which I have been using previously. In the CLI, I start cats like so: cats run example.yml -c spec.yml -s http://example/api --debug -H "Authorization=Bearer xxxxx" This throws the following error:

java.lang.UnsupportedOperationException
    at java.base@17.0.8/java.util.Collections$EmptyMap.merge(Collections.java:4782)
    at com.endava.cats.args.FilesArguments.loadHeaders(FilesArguments.java:139)
    at com.endava.cats.args.FilesArguments.loadConfig(FilesArguments.java:96)
    at com.endava.cats.command.CatsCommand.doEarlyOperations(CatsCommand.java:300)
    at com.endava.cats.command.CatsCommand.doLogic(CatsCommand.java:179)
    at com.endava.cats.command.CatsCommand.run(CatsCommand.java:137)
    at com.endava.cats.command.RunCommand.run(RunCommand.java:108)
    at picocli.CommandLine.executeUserObject(CommandLine.java:2026)
    at picocli.CommandLine.access$1500(CommandLine.java:148)
    at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
    at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
    at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
    at picocli.CommandLine.execute(CommandLine.java:2170)
    at com.endava.cats.CatsMain.run(CatsMain.java:36)
    at com.endava.cats.CatsMain_ClientProxy.run(Unknown Source)
    at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:132)
    at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
    at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
    at io.quarkus.runner.GeneratedMain.main(Unknown Source)

This happens when:

This does not happen when:

Is this something that is an issue on my end, or somehow it is something to do with this version of CATS?

Thank you!

en-milie commented 1 year ago

Thank you for reporting this. The fix will be available in 9.0.1

en-milie commented 1 year ago

This is fixed in: https://github.com/Endava/cats/releases/tag/cats-9.0.1

VytautasKz commented 1 year ago

I've tested version 9.0.1 and can confirm that the bug no longer exists, thank you for the fix. Closing issue.