Package com.linkedin.restli.common

Examples of com.linkedin.restli.common.OptionsResponse


  @Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestBuilderWithResourceNameDataProvider")
  public void testOptions(RootBuilderWrapper<Long, Greeting> builders, String resourceName)
      throws RemoteInvocationException, URISyntaxException, IOException
  {
    Request<OptionsResponse> optionsRequest = builders.options().build();
    OptionsResponse optionsResponse = REST_CLIENT.sendRequest(optionsRequest).getResponse().getEntity();
    Map<String, ResourceSchema> resources = optionsResponse.getResourceSchemas();
    Assert.assertEquals(resources.size(), 1);
    ResourceSchema resourceSchema = resources.get("com.linkedin.restli.examples.greetings.client." + resourceName);
    // sanity check the resource schema
    Assert.assertEquals(resourceSchema.getName(), resourceName);
    Assert.assertTrue(resourceSchema.hasCollection());
View Full Code Here


  @Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "optionsData")
  public void testModelsForOptionsRequest(OptionsRequestBuilder request, NamedDataSchema[] schemas)
      throws RemoteInvocationException, URISyntaxException, IOException
  {
    Request<OptionsResponse> optionsRequest = request.build();
    OptionsResponse optionsResponse = REST_CLIENT.sendRequest(optionsRequest).getResponse().getEntity();
    Map<String, DataSchema> rawDataSchemas = optionsResponse.getDataSchemas();

    for(NamedDataSchema dataSchema: schemas)
    {
      DataSchema optionsDataSchema = rawDataSchemas.get(dataSchema.getFullName());
      Assert.assertEquals(optionsDataSchema, dataSchema);
View Full Code Here

    {
      String schemaText = CODEC.mapToString((DataMap)entry.getValue());
      dataSchemaMap.put(entry.getKey(), DataTemplateUtil.parseSchema(schemaText));
    }

    return new OptionsResponse(resourceMap, dataSchemaMap);
  }
View Full Code Here

TOP

Related Classes of com.linkedin.restli.common.OptionsResponse

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.