Package org.apache.shindig.protocol

Examples of org.apache.shindig.protocol.RestHandler.execute()


        eq(DEFAULT_FIELDS),
        eq(token)))
        .andReturn(ImmediateFuture.newInstance(data));

    replay();
    assertEquals(data, operation.execute(Maps.<String, String[]>newHashMap(), null,
        token, converter).get());
    verify();
  }

  @Test
View Full Code Here


        eq(DEFAULT_FIELDS),
        eq(token)))
        .andReturn(ImmediateFuture.newInstance(data));

    replay();
    assertEquals(data, operation.execute(Maps.<String, String[]>newHashMap(),
        null, token, converter).get());
    verify();
  }

  @Test
View Full Code Here

        eq(new GroupId(GroupId.Type.friends, null)), eq(options),
        eq(ImmutableSortedSet.of("money", "fame", "fortune")), eq(token)))
        .andReturn(ImmediateFuture.newInstance(data));

    replay();
    assertEquals(data, operation.execute(params, null, token, converter).get());
    verify();
  }

  @Test
  public void testHandleGetFriendById() throws Exception {
View Full Code Here

        eq(new GroupId(GroupId.Type.self, null)), eq(DEFAULT_OPTIONS),
        eq(DEFAULT_FIELDS), eq(token)))
        .andReturn(ImmediateFuture.newInstance(data));

    replay();
    assertEquals(person, operation.execute(Maps.<String, String[]>newHashMap(),
        null, token, converter).get());
    verify();
  }

  @Test
View Full Code Here

    Person data = new PersonImpl();
    expect(personService.getPerson(eq(JOHN_DOE.iterator().next()),
        eq(DEFAULT_FIELDS), eq(token))).andReturn(ImmediateFuture.newInstance(data));

    replay();
    assertEquals(data, operation.execute(Maps.<String, String[]>newHashMap(),
        null, token, converter).get());
    verify();
  }

  @Test
View Full Code Here

        eq(DEFAULT_OPTIONS),
        eq(DEFAULT_FIELDS),
        eq(token))).andReturn(ImmediateFuture.newInstance(data));

    replay();
    assertEquals(data, operation.execute(Maps.<String, String[]>newHashMap(),
        null, token, converter).get());
    verify();
  }

  @Test
View Full Code Here

    expect(personService.updatePerson(eq(JOHN_DOE.iterator().next()),
        eq(person),
        eq(token))).andReturn(ImmediateFuture.newInstance(person));

    replay();
    assertEquals(person, operation.execute(Maps.<String, String[]>newHashMap(),
        new StringReader(jsonPerson), token, converter).get());
    verify();
  }

  @Test
View Full Code Here

    String path = "/people/@supportedFields";
    RestHandler operation = registry.getRestHandler(path, "GET");

    replay();
    @SuppressWarnings("unchecked")
    List<Object> received = (List<Object>) operation.execute(Maps.<String, String[]>newHashMap(),
        null, token, converter).get();
    assertEquals(2, received.size());
    assertEquals("id", received.get(0).toString());
    @SuppressWarnings("unchecked")
    Map<String, Object> map = (Map<String, Object>) received.get(1);
View Full Code Here

        eq(ImmutableSet.of("userX")),
        eq(token));
    expectLastCall();

    replay();
    operation.execute(params, null, token, converter).get();
    verify();
    reset();
  }

  @Test
View Full Code Here

        eq(ImmutableSet.of(Uri.parse("http://www.example.org/gadget.xml"))),
        eq(token));
    expectLastCall();

    replay();
    operation.execute(params, null, token, converter).get();
    verify();
    reset();
  }

  @Test
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.