@Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "versions")
@SuppressWarnings({"unchecked", "rawtypes"})
public void testComplexKeyMultipleEntities(ProtocolVersion version)
{
// TestRecord is not keyed by a ComplexResourceKey, but for this test we pretend that it is.
TestRecord kk1 = buildTestRecord(1, "key key 1");
TestRecord kp1 = buildTestRecord(2, "key params 1");
TestRecord kk2 = buildTestRecord(3, "key key 2");
TestRecord kp2 = buildTestRecord(4, "key params 2");
ComplexResourceKey<TestRecord, TestRecord> key1 = new ComplexResourceKey<TestRecord, TestRecord>(kk1, kp1);
ComplexResourceKey<TestRecord, TestRecord> key2 = new ComplexResourceKey<TestRecord, TestRecord>(kk2, kp2);
ComplexResourceKey keys[] = {key1, key2};
KeyValueRecordFactory<ComplexResourceKey, TestRecord> factory =
new KeyValueRecordFactory<ComplexResourceKey, TestRecord>(ComplexResourceKey.class,
TestRecord.class,
TestRecord.class,
null,
TestRecord.class);
CollectionRequest<KeyValueRecord> collectionRequest = new CollectionRequest<KeyValueRecord>(KeyValueRecord.class);
Map<ComplexResourceKey<TestRecord, TestRecord>, TestRecord> inputs =
new HashMap<ComplexResourceKey<TestRecord, TestRecord>, TestRecord>();
for (ComplexResourceKey key: keys)
{
TestRecord testRecord = buildTestRecord(1L, "foo");
inputs.put(key, testRecord);
collectionRequest.getElements().add(factory.create(key, testRecord));
}
@SuppressWarnings({"unchecked", "rawtypes"})