Пример #1
0
  @Test
  public void test_getParentUnitsInclusiveOrphanChild() {
    final List<Unit> expects =
        new ArrayList<Unit>() {
          {
            add(three);
          }
        };

    allUnits.remove(two);
    List<Unit> returned = unitService.getParentUnitsInclusive(allUnits, "THREE");
    Assert.assertTrue(
        "Parent unit list " + returned + " did not match expected " + expects,
        CollectionUtils.subtract(expects, returned).isEmpty());
  }
Пример #2
0
  @Test()
  public void test_getParentUnitsInclusiveMiddle() {
    final List<Unit> expects =
        new ArrayList<Unit>() {
          {
            add(one);
            add(two);
          }
        };

    List<Unit> returned = unitService.getParentUnitsInclusive(allUnits, "TWO");
    Assert.assertTrue(
        "Parent unit list " + returned + " did not match expected " + expects,
        CollectionUtils.subtract(expects, returned).isEmpty());
  }