Package com.linkedin.restli.common.test

Examples of com.linkedin.restli.common.test.MyComplexKey


                                                                          MyComplexKey.class,
                                                                          MyComplexKey.class,
                                                                          null,
                                                                          RecordTemplateWithPrimitiveKey.class);

    MyComplexKey key = new MyComplexKey().setA("key").setB(1L);
    MyComplexKey params = new MyComplexKey().setA("params").setB(2L);
    ComplexResourceKey<MyComplexKey, MyComplexKey> complexKey =
        new ComplexResourceKey<MyComplexKey, MyComplexKey>(key, params);

    RecordTemplateWithPrimitiveKey mockRecord = new RecordTemplateWithPrimitiveKey().setId(1L).setBody("foo");
View Full Code Here


    Assert.assertEquals(args.length, 1);
    Assert.assertTrue(args[0] instanceof BatchUpdateRequest);
    Map<?, ?> data = ((BatchUpdateRequest)args[0]).getData();
    Assert.assertEquals(data.size(), 2);
    MyComplexKey entity1 = (MyComplexKey) data.get(keys[0]);
    MyComplexKey entity2 = (MyComplexKey) data.get(keys[1]);
    Assert.assertEquals(entity1.getA(), "abc");
    Assert.assertEquals((long) entity1.getB(), 123L);
    Assert.assertEquals(entity2.getA(), "XY");
    Assert.assertEquals((long) entity2.getB(), 456L);

    EasyMock.verify(request, model, descriptor, context, routingResult);
  }
View Full Code Here

  }

  @Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "complexKey")
  public void testComplexKeyToString(ProtocolVersion version, String full, String notFull)
  {
    MyComplexKey myComplexKey1 = new MyComplexKey();
    myComplexKey1.setA("stringVal");
    myComplexKey1.setB(3);
    MyComplexKey myComplexKey2 = new MyComplexKey();
    myComplexKey2.setA("anotherStringVal");
    myComplexKey2.setB(4);
    ComplexResourceKey<MyComplexKey, MyComplexKey> complexKey =
      new ComplexResourceKey<MyComplexKey, MyComplexKey>(myComplexKey1, myComplexKey2);
    String complexKeyString = URIParamUtils.keyToString(complexKey, NO_ESCAPING, null, true, version);
    Assert.assertEquals(complexKeyString, full);
View Full Code Here

TOP

Related Classes of com.linkedin.restli.common.test.MyComplexKey

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.