Ejemplo n.º 1
0
 @Test
 public void testWithActionLinks() {
   ActionLink actionLink = ActionLink.withAction(Action.READ);
   recordLink.addActionLink("read", actionLink);
   assertEquals(recordLink.getActionLink("read"), actionLink);
   assertEquals(recordLink.getActionLinks().get("read"), actionLink);
   assertNull(recordLink.getActionLink("notAnAction"));
 }
Ejemplo n.º 2
0
  @BeforeMethod
  public void setUp() {
    recordLink = RestDataRecordLink.withNameInData("aNameInData");
    RestDataAtomic linkedRecordType =
        RestDataAtomic.withNameInDataAndValue("linkedRecordType", "aLinkedRecordType");
    recordLink.addChild(linkedRecordType);

    RestDataAtomic linkedRecordId =
        RestDataAtomic.withNameInDataAndValue("linkedRecordId", "aLinkedRecordId");
    recordLink.addChild(linkedRecordId);
  }
Ejemplo n.º 3
0
 @Test
 public void testWithRepeatId() {
   recordLink.setRepeatId("x2");
   assertEquals(recordLink.getRepeatId(), "x2");
 }
Ejemplo n.º 4
0
 @Test
 public void testInit() {
   assertEquals(recordLink.getChildren().size(), 2);
   assertNotNull(recordLink.getFirstChildWithNameInData("linkedRecordType"));
   assertTrue(recordLink.containsChildWithNameInData("linkedRecordId"));
 }