vendredi 14 août 2020

How do you "inherit" @WebAppConfiguration from another context?

I was writing an integration test harness and provided a common set of beans that would be used by a group of tests so that I can just update one in case there's a new common component.

It got to the point where I needed the ServletContext but rather than adding my own mock servlet context, I wanted to utilize @WebAppConfiguration. I tried putting in the @Configuration that I was using, but that didn't work, instead I had to put @WebAppConfiguration annotation in every test class. I was wondering if there was a way to avoid that repetition even if it is a single line.

Aucun commentaire:

Enregistrer un commentaire