0

In the tech stack I'm working with we have an existing Java annotation for our unit tests which gets used like

@TeamTest(size = TestSize.Medium, timeout = 5000)
void myTest() {
  // setup and asserts and stuff
}

Is there a way to setup a separate annotation that would already have the size and timeout variables stored? Ex:

@TeamTest(size = TestSize.Medium, timeout = 5000)
public static @interface MediumTest {}

That way I could just do

@MediumTest
void myTest() {
  // setup and asserts and stuff
}
Speed Fox
  • 45
  • 4
  • Are these annotations part of your codebase? (i.e. not part of an external library) – egeorge Feb 17 '23 at 00:34
  • The @TeamTest is part of an adjacent team's codebase. I wouldn't be able to modify them in any meaningful way (the annotations support a variety of teams) but can treat like a direct build dependency. – Speed Fox Feb 17 '23 at 00:59

0 Answers0