vendredi 22 décembre 2017

Run tests with Spring reading data from a csv file

I'm trying to run a test multiple times, reading the input data needed from a csv file. I want to run the test for each line of the file.

I was going to do it manually, but I discovered Spring Batch. I'm new to spring batch, but I thought the following:

  • Create a spring boot application implementing command line runner.
  • In the run method, launch a spring batch job
  • This job would read the data from the csv file line by line, and for each line would run the @Test method for the data of the current line.

Is this approach ok? Is there a better way to do it? Can you provide any example code about how could it be done?

Thank you.

Aucun commentaire:

Enregistrer un commentaire