Announcement Announcement Module
No announcement yet.
OAuth 1 test cases Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • OAuth 1 test cases

    I want to write some integration test cases. Are there any examples of internal test cases that I could use to base mine from? I basically want to use HttpRequestMock to test the request_token, access_token and other end points.



  • #2
    There are unit tests in . I assume that's what you mean when you say you want to use mocks (but you said "integration test" which is confusing)? The OAuth1 piece has no integration tests right now - nobody ever did that, but feel free to contribute something in the sparklr project.


    • #3
      Well.. for all my other REST end points I use the AnnotationMethodHandlerAdapter & MockHttpServletRequest etc to test the end points.

      I'd like to be able to hit the end point via a unit test to test my nonce & token providers integrating with the spring filters, etc..


      • #4
        AnnotationMethodHandlerAdapter isn't relevant here because the OAuth 1 server support doesn't have a @Controller (it's all filters). I guess you could grab the Spring Security filter out of the config and send it a MockHttpServlet*.


        • #5
          Yeah. That's why I was asking for advice. I'll check out trying to hit the filter directly.
          But from reading through the filters before, it didn't seem like there was "one" filter for each end point.
          It seemed like there was a chain of filters that needed to all be run.


          • #6
            Yes, it's a chain, so you proably have to get the whole chain. That's easy though, since you know the bean definition id (same as filter name in web.xml or equivalent).