Package com.linkedin.restli.examples.greetings.api

Examples of com.linkedin.restli.examples.greetings.api.Greeting.data()


      greeting.setTone(mapToneForIncomingRequest(tone));
    }
    greeting.setId(createdId);
    Request<Greeting> getRequest = builders.get().id(createdId).build();
    Greeting getReturnedGreeting = REST_CLIENT.sendRequest(getRequest).getResponse().getEntity();
    ValidateDataAgainstSchema.validate(getReturnedGreeting.data(), getReturnedGreeting.schema(),
                                       new ValidationOptions());
    assertEquals(getReturnedGreeting, greeting);
    deleteAndVerifyTestData(builders, createdId);
    verifyFilters(tone, responseFilter);
  }
View Full Code Here


        Assert.assertEquals(fetchedGreeting, expectedGreeting);
      }
      else
      {
        DataMap fetchedDataMap = fetchedGreeting.data();
        DataMap expectedDataMap = expectedGreeting.data();
        for (String field: fetchedDataMap.keySet())
        {
          if (!fieldsToIgnore.contains(field))
          {
            Assert.assertEquals(fetchedDataMap.get(field), expectedDataMap.get(field));
View Full Code Here

    catch (ArrayIndexOutOfBoundsException e)
    {
      Greeting details = new Greeting().setMessage("Hello, Sorry for the mess");

      throw new RestLiServiceException(HttpStatus.S_500_INTERNAL_SERVER_ERROR, "error processing request", e)
              .setServiceErrorCode(42).setErrorDetails(details.data());
    }
    return null;
  }

  /**
 
View Full Code Here

  }

  private byte[] createNewGreetingBytes(Long id)
  {
    Greeting newGreeting = new Greeting().setMessage("New Greeting!").setId(id);
    return DataMapUtils.mapToBytes(newGreeting.data());
  }

  private void sendRequestAndVerifyParseqTracevisResponse(RestRequest request)
      throws InterruptedException, ExecutionException
  {
View Full Code Here

    for(String key : dataMap.keySet())
    {
      DataMap inputDM = dataMap.getDataMap(key);
      Greeting expectedGreeting = inputMap.get(Long.parseLong(key));
      Assert.assertTrue(uriIds.contains(key));
      Assert.assertTrue(inputDM.equals(expectedGreeting.data()));
    }
  }

  // TODO modify this method to accept a CollectionRequest as it's first parameter once our server code has been
  //      updated to work with the new representation of BatchUpdateRequests and BatchPartialUpdateRequests. As of now
View Full Code Here

    {
      DataMap inputDM = dataMap.getDataMap(key);
      Long longKey = Long.parseLong(key);
      Greeting expectedGreeting = inputMap.get(longKey);
      Assert.assertTrue(uriIds.contains(longKey));
      Assert.assertTrue(inputDM.equals(expectedGreeting.data()));
    }
  }

  @Test(dataProvider = "requestBuilderDataProvider")
  public static void testSendSGRequests(RootBuilderWrapper<Long, Greeting> builders)
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.