LotBasedEffectivityConfigSpec extends EffectivityConfigSpec { @Override protected boolean isEffective(Effectivity eff){ if(eff instanceof LotBasedEffectivity){ LotBasedEffectivity lotEff=(LotBasedEffectivity) eff; return isEffective(lotEff); }else return false; } LotBasedEffectivityConfigSpec(String lotId, ConfigurationItem configurationItem);  LotBasedEffectivityConfigSpec(String lotId, ProductConfiguration configuration); String getLotId(); void setLotId(String lotId);  }
@Test public void isEffectiveTest(){ Whitebox.setInternalState(LBECS,"configurationItem",tmp_CI); when(LBE.getConfigurationItem()).thenReturn(configurationItem); boolean result = LBECS.isEffective(LBE); Assert.assertFalse(result); Whitebox.setInternalState(LBECS,"configurationItem",configurationItem); when(LBE.getStartLotId()).thenReturn("15"); result = LBECS.isEffective(LBE); Assert.assertFalse(result); Whitebox.setInternalState(LBECS,"configurationItem",configurationItem); when(LBE.getStartLotId()).thenReturn("1"); when(LBE.getEndLotId()).thenReturn("4"); result = LBECS.isEffective(LBE); Assert.assertFalse(result); Whitebox.setInternalState(LBECS,"configurationItem",configurationItem); when(LBE.getStartLotId()).thenReturn("1"); when(LBE.getEndLotId()).thenReturn("10"); result = LBECS.isEffective(LBE); Assert.assertTrue(result); result = LBECS.isEffective(new DateBasedEffectivity()); Assert.assertFalse(result); }