KettleUtils { public String getKettleProperty( String propertyName ) throws KettleException { return getKettleProperty( propertyName, "" ); } private  KettleUtils(); static KettleUtils getInstance(); String getKettleProperty( String propertyName ); String getKettleProperty( String propertyName, String defaultValue );  }
@Test public void testGettingExistingProperty() throws KettleException { assertEquals( kettleUtils.getKettleProperty( "VALID_PROPERTY" ), VALID_PROPERTY ); }
@Test public void testGettingMissingProperty() throws KettleException { assertEquals( kettleUtils.getKettleProperty( "INVALID_PROPERTY" ),null ); }
@Test public void testGettingExistingPropertyWithDefault() throws KettleException { assertEquals( kettleUtils.getKettleProperty( "VALID_PROPERTY", "someDefaultValue" ), VALID_PROPERTY ); }
@Test public void testGettingMissingPropertyWithDefault() throws KettleException { assertEquals( kettleUtils.getKettleProperty( "INVALID_PROPERTY", "someDefaultValue" ), "someDefaultValue" ); }
@Test public void testGettingExistingPropertyWithNullDefault() throws KettleException { assertEquals( kettleUtils.getKettleProperty( "VALID_PROPERTY", null ), VALID_PROPERTY ); }
@Test public void testGettingExistingPropertyWithEmptyDefault() throws KettleException { assertEquals( kettleUtils.getKettleProperty( "VALID_PROPERTY", "" ), VALID_PROPERTY ); }
@Test public void testGettingMissingPropertyWithNullDefault() throws KettleException { assertEquals( kettleUtils.getKettleProperty( "INVALID_PROPERTY", null ), null ); }
@Test public void testGettingMissingPropertyWithEmptyDefault() throws KettleException { assertEquals( kettleUtils.getKettleProperty( "INVALID_PROPERTY", "" ), null ); }
@Test( expected = KettleException.class ) public void testGettingWithException() throws KettleException { KettleUtils ku = mock( KettleUtils.class ); when( ku.getKettleProperty( "VALID_PROPERTY" ) ).thenThrow( new KettleException() ); ku.getKettleProperty( "VALID_PROPERTY" ); }