jeudi 5 septembre 2019

How to run service test multiple times using different files as input?

I've created a set of tests on local functionality and integration with an external service, but the external service can (And often does) have different functionality with different input.
So the only way to truly test it, is to send in the large set of input examples. But what I want to avoid is writing the tests over and over, and preferably don't want to shove all the data into the same configuration file.

The current code uses SpringRunner (As a necessity) so I can't just write my own runner from scratch, and I don't know how to extend SpringRunner to get this functionality. I've tried pulling multiple config files as test properties, but that requires adding to that hardcoded list and parsing through the resources, which can eventually get out of hand. (Also would not segment the tests per config file, it'd run all of test A with each piece of data instead of going test A -> Z for each file)

So I want to create a properties file per type of input and have these tests run it, once per file with that file's properties.

How can I do this? Any advice is greatly appreciated :)

Aucun commentaire:

Enregistrer un commentaire