Examples of GetGadgetsByGadgetDefAndConsumerKeyRequest


Examples of org.eurekastreams.server.persistence.mappers.requests.opensocial.GetGadgetsByGadgetDefAndConsumerKeyRequest

     */
    @Override
    public void authorize(final PrincipalActionContext inActionContext) throws AuthorizationException
    {
        String consumerKey = (String) inActionContext.getParams();
        Long gadgetCount = verifyMapper.execute(new GetGadgetsByGadgetDefAndConsumerKeyRequest(consumerKey,
                inActionContext.getPrincipal().getId()));
        if (gadgetCount <= 0)
        {
            throw new AuthorizationException("The user supplied with this OAuth request does not have the app "
                    + "associated with this consumer key installed on their start page.");
View Full Code Here

Examples of org.eurekastreams.server.persistence.mappers.requests.opensocial.GetGadgetsByGadgetDefAndConsumerKeyRequest

     * user passed in.
     */
    @Test
    public void testSuccessfulExecution()
    {
        GetGadgetsByGadgetDefAndConsumerKeyRequest request = new GetGadgetsByGadgetDefAndConsumerKeyRequest(
                OAUTH_CONSUMERKEY_1, USER_1);
        Long returnValue = sut.execute(request);
        assertEquals(new Long(3), returnValue);
    }
View Full Code Here

Examples of org.eurekastreams.server.persistence.mappers.requests.opensocial.GetGadgetsByGadgetDefAndConsumerKeyRequest

     * Test that this mapper returns zero gadget count when no user is supplied.
     */
    @Test
    public void testFailureWithNoUserId()
    {
        GetGadgetsByGadgetDefAndConsumerKeyRequest request = new GetGadgetsByGadgetDefAndConsumerKeyRequest(
                OAUTH_CONSUMERKEY_1, null);
        Long returnValue = sut.execute(request);
        assertEquals(new Long(0), returnValue);
    }
View Full Code Here

Examples of org.eurekastreams.server.persistence.mappers.requests.opensocial.GetGadgetsByGadgetDefAndConsumerKeyRequest

     * corresponing to the consumer key installed on their start page.
     */
    @Test
    public void testFailureWithValidUserIdButNoAppInstalled()
    {
        GetGadgetsByGadgetDefAndConsumerKeyRequest request = new GetGadgetsByGadgetDefAndConsumerKeyRequest(
                OAUTH_CONSUMERKEY_1, USER_2);
        Long returnValue = sut.execute(request);
        assertEquals(new Long(0), returnValue);
    }
View Full Code Here

Examples of org.eurekastreams.server.persistence.mappers.requests.opensocial.GetGadgetsByGadgetDefAndConsumerKeyRequest

     * This test verifies that the mapper returns zero gadget count when the supplied consumer key is invalid.
     */
    @Test
    public void testFailureWithInvalidConsumerKey()
    {
        GetGadgetsByGadgetDefAndConsumerKeyRequest request = new GetGadgetsByGadgetDefAndConsumerKeyRequest(
                "badkey", USER_2);
        Long returnValue = sut.execute(request);
        assertEquals(new Long(0), returnValue);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.