Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider splitting approvaltests module into several targeted ones #334

Open
vlsi opened this issue Dec 20, 2022 · 1 comment
Open

Consider splitting approvaltests module into several targeted ones #334

vlsi opened this issue Dec 20, 2022 · 1 comment

Comments

@vlsi
Copy link

vlsi commented Dec 20, 2022

Currently, com.approvaltests:approvaltests:18.5.0 has a lot of "optional" dependencies.
However, in practice, it makes it hard to use the library.

For instance, I wanted to try json approvals, so I tried JsonApprovals.verifyJson("test"), and the test failed in runtime with

com/google/gson/JsonSyntaxException
java.lang.NoClassDefFoundError: com/google/gson/JsonSyntaxException
	at org.approvaltests.JsonApprovals.verifyJson(JsonApprovals.java:20)
	at org.approvaltests.JsonApprovals.verifyJson(JsonApprovals.java:16)

Of course, I'm a programmer, and I know NoClassDefFoundError means the class is missing in runtime, because, well, my app does not really use Gson.

If Approvals wants Gson, fine, however, I would suggest adding a regular (non-optional) dependency.

So if you split modules like

approvaltests-core
approvaltests-json-gson: depends on approvaltests-core, and gson
approvaltests-json-jackson: depends on approvaltests-core, and jackson

approvaltests: depends on approvaltests-core, approvaltests-json-* dependencies for backward compatibility

Then the users would be able to pull just the libraries they need (e.g. approvaltests-json-jackson), and they would get all the needed (e.g. jackson) dependencies automatically.

@LarsEckart
Copy link
Contributor

hello and thank you for your feedback. Just acknowledging that I saw this new issue and that we'll take a look at it next time we meet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants