ResolvedCollectionConfigSpec extends ProductConfigSpec { @Override public PartIteration filterPartIteration(PartMaster part) { if(partCollection != null) { BaselinedPartKey baselinedRootPartKey = new BaselinedPartKey(partCollection.getId(), part.getWorkspaceId(), part.getNumber()); BaselinedPart baselinedRootPart = partCollection.getBaselinedPart(baselinedRootPartKey); if (baselinedRootPart != null) { return baselinedRootPart.getTargetPart(); } } return null; } ResolvedCollectionConfigSpec(@NotNull ResolvedCollection resolvedCollection); @Override PartIteration filterPartIteration(PartMaster part); @Override PartLink filterPartLink(List<PartLink> path);  }
@Test public void filterPartIterationTest(){ PartMaster partMaster = getPartMasterWith("PART-001"); PartIteration result = r2CS.filterPartIteration(partMaster); assertNotNull(result); assertEquals(partMaster.getLastRevision().getLastIteration(), result); productBaseline.removeAllBaselinedParts(); result = r2CS.filterPartIteration(partMaster); assertNull(result); partMaster = getPartMasterWith("PART-006"); productBaseline.setType(ProductBaselineType.LATEST); assertEquals("PART-006", partMaster.getNumber()); configurationItem.setDesignItem(partMaster); productBaseline.addBaselinedPart(partMaster.getLastRevision().getLastIteration()); result = r2CS.filterPartIteration(partMaster); assertNotNull(result); assertEquals(partMaster.getLastRevision().getLastIteration(), result); }