Package com.linkedin.restli.examples.groups.client

Examples of com.linkedin.restli.examples.groups.client.ContactsBuilders


  @Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestContactsBatchDataProvider")
  public void testSubResourceBatchGet(ProtocolVersion version, String expectedUri)
    throws IOException, RestException
  {
    Request<BatchResponse<GroupContact>> request = new ContactsBuilders().batchGet().groupIdKey(1).ids(1, 3).build();
    checkRequestBuilder(request, ResourceMethod.BATCH_GET, BatchResponseDecoder.class, expectedUri, null, version);
  }
View Full Code Here


  @Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestContactsBatchDataProvider")
  public void testSubResourceBatchGetKV(ProtocolVersion version, String expectedUri)
    throws IOException, RestException
  {
    Request<BatchKVResponse<Integer, GroupContact>> request = new ContactsBuilders().batchGet().groupIdKey(1).ids(1, 3).buildKV();
    checkRequestBuilder(request, ResourceMethod.BATCH_GET, BatchKVResponseDecoder.class, expectedUri, null, version);
  }
View Full Code Here

  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testSubResourceBatchGetWithSelectedNullValues() throws IOException, RestException
  {
    new ContactsBuilders().batchGet().groupIdKey(1).ids(1, null, 3).build();
  }
View Full Code Here

  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testSubResourceBatchGetKVWithSelectedNullValues() throws IOException, RestException
  {
    new ContactsBuilders().batchGet().groupIdKey(1).ids(1, null, 3).buildKV();
  }
View Full Code Here

    contact.setFirstName("Laura");
    contact.setLastName("Smith");
    contact.setIsPreapproved(true);
    contact.setIsInvited(true);

    Request<EmptyRecord> oldRequest = new ContactsBuilders().create().groupIdKey(1).input(contact).build();
    checkRequestBuilder(oldRequest, ResourceMethod.CREATE, CreateResponseDecoder.class, expectedUri, contact, version);
  }
View Full Code Here

  private static Object[][] requestContactsBuilderDataProviderEntity()
  {
    String uriV1 = "groups/1/contacts/1";
    String uriV2 = "groups/1/contacts/1";
    return new Object[][] {
      { new RootBuilderWrapper<Integer, GroupContact>(new ContactsBuilders()), AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), uriV1 },
      { new RootBuilderWrapper<Integer, GroupContact>(new ContactsBuilders()), AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), uriV2 },
      { new RootBuilderWrapper<Integer, GroupContact>(new ContactsRequestBuilders()), AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), uriV1 },
      { new RootBuilderWrapper<Integer, GroupContact>(new ContactsRequestBuilders()), AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), uriV2 }
    };
  }
View Full Code Here

  private static Object[][] requestContactsBuilderDataProviderEntityWithFields()
  {
    String uriV1 = "groups/1/contacts/1?fields=lastName,firstName";
    String uriV2 = "groups/1/contacts/1?fields=lastName,firstName";
    return new Object[][] {
      { new RootBuilderWrapper<Integer, GroupContact>(new ContactsBuilders()), AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), uriV1 },
      { new RootBuilderWrapper<Integer, GroupContact>(new ContactsBuilders()), AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), uriV2 },
      { new RootBuilderWrapper<Integer, GroupContact>(new ContactsRequestBuilders()), AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), uriV1 },
      { new RootBuilderWrapper<Integer, GroupContact>(new ContactsRequestBuilders()), AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), uriV2 }
    };
  }
View Full Code Here

    String uriV1_1 = "SpecialGroups/42";
    String uriV1_2 = "SpecialGroups/1/contacts/42";
    String uriV2_1 = "SpecialGroups/42";
    String uriV2_2 = "SpecialGroups/1/contacts/42";
    return new Object[][] {
      { new RootBuilderWrapper<Integer, Group>(new GroupsBuilders("SpecialGroups")), new RootBuilderWrapper<Integer, GroupContact>(new ContactsBuilders("SpecialGroups")),
        AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), uriV1_1, uriV1_2 },
      { new RootBuilderWrapper<Integer, Group>(new GroupsBuilders("SpecialGroups")), new RootBuilderWrapper<Integer, GroupContact>(new ContactsBuilders("SpecialGroups")),
        AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), uriV2_1, uriV2_2 },
      { new RootBuilderWrapper<Integer, Group>(new GroupsRequestBuilders("SpecialGroups")), new RootBuilderWrapper<Integer, GroupContact>(new ContactsRequestBuilders("SpecialGroups")),
        AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), uriV1_1, uriV1_2 },
      { new RootBuilderWrapper<Integer, Group>(new GroupsRequestBuilders("SpecialGroups")), new RootBuilderWrapper<Integer, GroupContact>(new ContactsRequestBuilders("SpecialGroups")),
        AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), uriV2_1, uriV2_2},
View Full Code Here

  private static Object[][] requestContactsBuilderDataProviderAction()
  {
    String uriV1 = "groups/42/contacts?action=spamContacts";
    String uriV2 = "groups/42/contacts?action=spamContacts";
    return new Object[][] {
      { new RootBuilderWrapper<Integer, GroupContact>(new ContactsBuilders()), AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), uriV1 },
      { new RootBuilderWrapper<Integer, GroupContact>(new ContactsBuilders()), AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), uriV2 },
      { new RootBuilderWrapper<Integer, GroupContact>(new ContactsRequestBuilders()), AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), uriV1 },
      { new RootBuilderWrapper<Integer, GroupContact>(new ContactsRequestBuilders()), AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), uriV2 }
    };
  }
View Full Code Here

  @DataProvider
  private static Object[][] requestContactsBuilderDataProvider()
  {
    return new Object[][] {
      { new RootBuilderWrapper<Integer, GroupContact>(new ContactsBuilders()) },
      { new RootBuilderWrapper<Integer, GroupContact>(new ContactsRequestBuilders()) }
    };
  }
View Full Code Here

TOP

Related Classes of com.linkedin.restli.examples.groups.client.ContactsBuilders

Copyright © 2018 www.massapicom. 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.