The structure of my SpringBoot project is:
There is no main class, and I have compiled the project into a jar
file.
Now I want to run a method named "testEmailSending" in the test class shown in the very last line of the screenshot, Send1000EmailsIn24hours
, from the jar
file from command line.
The reason why I want to run this test in a jar
file is that the whole project is just a test, but I think that since it is a test, so I shouldn't put the code in the main
class, instead, putting it in a test would be better.
I am not sure if this is correct. Should I put the code for testing just in the main class?