We have custom annotations like
@AuthTokenRequired(Permissions.SOME_PERMISSION)
or
@ClientAppKeyRequired
which we add to certain REST-Endpoints in our java code.
This looks something like this:
@Path("somePath")
@Consumes("application/json")
@Produces("application/json")
public class SomeResource {
@GET
@AuthTokenRequired(Permissions.SOME_PERMISSION)
@ClientAppKeyRequired
public Response getSomeData(){
//some code
}
@GET
@ClientAppKeyRequired
public Response getSomeOtherData(){
//some code
}
@DELETE
@AuthTokenRequired(Permissions.SOME_PERMISSION)
public Response deleteSomeData(){
//some code
}
}
What we want to test is if these endpoints are annotated correctly on method level.
We are using JUnit4, MockitoJunit and Hamcrest for assertions. There is also a possibility to use Powermock but we would prefer not to.