Package com.linkedin.restli.examples.custom.types

Examples of com.linkedin.restli.examples.custom.types.CustomLong


  // test correct request is built for customLong
  @Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "request1BuilderDataProviderCustomLongFinder")
  public void testFinderCustomLong(RootBuilderWrapper<Long, Greeting> builders, ProtocolVersion version, String expectedUri)
    throws IOException, RestException
  {
    Request<CollectionResponse<Greeting>> request = builders.findBy("CustomLong").setQueryParam("l", new CustomLong(20L)).build();

    checkRequestBuilder(request, ResourceMethod.FINDER, CollectionResponseDecoder.class, expectedUri, null, version);
  }
View Full Code Here


  @Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "request1BuilderDataProviderCustomLongArrayFinder")
  public void testFinderCustomLongArray(RootBuilderWrapper<Long, Greeting> builders, ProtocolVersion version, String expectedUri)
    throws IOException, RestException
  {
    List<CustomLong> ls = new ArrayList<CustomLong>(2);
    ls.add(new CustomLong(2L));
    ls.add(new CustomLong(4L));
    Request<CollectionResponse<Greeting>> request = builders.findBy("CustomLongArray").setQueryParam("ls", ls).build();

    checkRequestBuilder(request, ResourceMethod.FINDER, CollectionResponseDecoder.class, expectedUri, null, version);
  }
View Full Code Here

  }

  @Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "request2BuilderDataProviderEntity")
  public void testCollectionGetKey(RootBuilderWrapper<CustomLong, Greeting> builders, ProtocolVersion version, String expectedUri) throws IOException, RestException
  {
    Request<Greeting> request = builders.get().id(new CustomLong(5L)).build();

    checkRequestBuilder(request, ResourceMethod.GET, EntityResponseDecoder.class, expectedUri, null, version);
  }
View Full Code Here

  }

  @Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "request2BatchDataProvider")
  public void testCollectionBatchGetKey(ProtocolVersion version, String expectedUri) throws IOException, RestException
  {
    Request<BatchResponse<Greeting>> request = new CustomTypes2Builders().batchGet().ids(new CustomLong(1L), new CustomLong(2L), new CustomLong(3L)).build();

    checkRequestBuilder(request, ResourceMethod.BATCH_GET, BatchResponseDecoder.class, expectedUri, null, version);
  }
View Full Code Here

  @Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "request2BatchDataProvider")
  public void testCollectionBatchGetEntityKey(ProtocolVersion version, String expectedUri) throws IOException, RestException
  {
    Request<BatchKVResponse<CustomLong, EntityResponse<Greeting>>> request =
      new CustomTypes2RequestBuilders().batchGet().ids(new CustomLong(1L), new CustomLong(2L), new CustomLong(3L)).build();

    checkRequestBuilder(request, ResourceMethod.BATCH_GET, BatchEntityResponseDecoder.class, expectedUri, null, version);
  }
View Full Code Here

  @Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "request4BuilderDataProviderEntity")
  public void testCollectionChildGetKey(RootBuilderWrapper<CustomLong, Greeting> builders, ProtocolVersion version, String expectedUri)
    throws IOException, RestException
  {
    Request<Greeting> request = builders.get().setPathKey("customTypes2Id", new CustomLong(1L)).id(new CustomLong(7L)).build();

    checkRequestBuilder(request, ResourceMethod.GET, EntityResponseDecoder.class, expectedUri, null, version);
  }
View Full Code Here

    // normally coercer registration is handled in RestliAnnotationReader,
    // but that isn't run here because this is just a unit test.  So, we need to
    // force registration of the DateCoercer because it isn't contained in Date itself.
    new DateCoercer();

    CustomTypes3Builders.Key key = new CustomTypes3Builders.Key().setLongId(new CustomLong(5L)).setDateId(new Date(13L));
    Request<Greeting> request = builders.get().id(key).build();

    checkRequestBuilder(request, ResourceMethod.GET, EntityResponseDecoder.class, expectedUri, null, version);
  }
View Full Code Here

  }

  @Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestBuilderDataProvider")
  public void testCustomLong(RootBuilderWrapper<Long, Greeting> builders) throws RemoteInvocationException
  {
    Request<CollectionResponse<Greeting>> request = builders.findBy("CustomLong").setQueryParam("l", new CustomLong(5L)).build();
    List<Greeting> elements = REST_CLIENT.sendRequest(request).getResponse().getEntity().getElements();
    Assert.assertEquals(elements.size(), 0);
  }
View Full Code Here

  @Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestBuilderDataProvider")
  public void testCustomLongArray(RootBuilderWrapper<Long, Greeting> builders) throws RemoteInvocationException
  {
    List<CustomLong> ls = new ArrayList<CustomLong>(2);
    ls.add(new CustomLong(1L));
    ls.add(new CustomLong(2L));

    Request<CollectionResponse<Greeting>> request = builders.findBy("CustomLongArray").setQueryParam("ls", ls).build();
    List<Greeting> elements = REST_CLIENT.sendRequest(request).getResponse().getEntity().getElements();
    Assert.assertEquals(elements.size(), 0);
  }
View Full Code Here

  }

  @Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestBuilderDataProvider")
  public void testCustomLongArrayOBO(RootBuilderWrapper<Long, Greeting> builders) throws RemoteInvocationException
  {
    Request<CollectionResponse<Greeting>> request = builders.findBy("CustomLongArray").addQueryParam("Ls", new CustomLong(1L)).addQueryParam("Ls", new CustomLong(2L)).build();
    List<Greeting> elements = REST_CLIENT.sendRequest(request).getResponse().getEntity().getElements();
    Assert.assertEquals(elements.size(), 0);
  }
View Full Code Here

TOP

Related Classes of com.linkedin.restli.examples.custom.types.CustomLong

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.