@Before public void setUp() { project = new FreeStyleProjectMock("project"); final String propertyKey = "propertyKey"; property = new SCMProjectProperty(project); property.setKey(propertyKey); }
/** Verify {@link SCMProjectProperty#returnOriginalValue()} method. */ @Test public void testReturnOriginalValue() { // If property is marked as overridden or original value is not null and not equals to default // value, // than original should be used. property.setOverridden(true); assertTrue(property.returnOriginalValue()); property.setOriginalValue(new FakeSCM(), false); assertTrue(property.returnOriginalValue()); // If property is not marked as overridden and original value is null or equals to default value // - use cascading. property.setOriginalValue(property.getDefaultValue(), false); assertFalse(property.returnOriginalValue()); property.setOriginalValue(null, false); assertFalse(property.returnOriginalValue()); }
/** Verify {@link SCMProjectProperty#getDefaultValue()} method. */ @Test public void testGetDefaultValue() { assertEquals(new NullSCM(), property.getDefaultValue()); }