Hi Godwin, You can simply use spring-test module if your project already has dependency for spring.
*org.springframework.mock.web.MockHttpServletRequest [1] *class will do the required things. [1] http://docs.spring.io/spring/docs/3.0.x/api/org/springframework/mock/web/MockHttpServletRequest.html Thanks, Rajeevan On Tue, Oct 21, 2014 at 11:38 AM, Manoj Gunawardena <[email protected]> wrote: > Hi Amila, > > You have to create mock object of HttpservletRequest. Can we use EasyMock > in our products. Or currently we are using any other mock object creation > frameworks? > > http://easymock.org > > Thanks > > > > On Tue, Oct 21, 2014 at 11:27 AM, Godwin Amila Shrimal <[email protected]> > wrote: > >> Hi, >> >> I am working on test automation of OAuth, In that I need to pass a >> HttpServletRequest object to apache amber oauth2 API and get the >> authorization code. Can any one suggest me a better way to programmatically >> create a HttpServletRequest. Please see below the code snippet used to get >> the authorization code. >> >> OAuthAuthzResponse authzResponse = OAuthAuthzResponse >> .oauthCodeAuthzResponse(request) >> >> String code = authzResponse.getCode(); >> >> Thanks >> Godwin >> >> -- >> *Godwin Amila Shrimal* >> Senior Software Engineer >> WSO2 Inc.; http://wso2.com >> lean.enterprise.middleware >> >> mobile: *+94772264165* >> linkedin: *http://lnkd.in/KUum6D <http://lnkd.in/KUum6D>* >> twitter: https://twitter.com/godwinamila >> >> _______________________________________________ >> Dev mailing list >> [email protected] >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > Manoj Gunawardena > Tech Lead > WSO2, Inc.: http://wso2.com > lean.enterprise.middleware > Mobile : +94 77 2291643 > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Best Regards, V.Rajeevan Software Engineer, WSO2 Inc. :http://wso2.com Mobile : +94 773090875 Email : [email protected]
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
