From b243ce4e5c9f8afecebdc2cd693df7ce359d2328 Mon Sep 17 00:00:00 2001 From: Alejandra Ferreiro Vidal Date: Tue, 13 Feb 2018 18:55:26 +0100 Subject: [PATCH] improve test coverage --- test/groovy/com/sap/piper/ConfigurationHelperTest.groovy | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/groovy/com/sap/piper/ConfigurationHelperTest.groovy b/test/groovy/com/sap/piper/ConfigurationHelperTest.groovy index ce86e4323..3dd34dab5 100644 --- a/test/groovy/com/sap/piper/ConfigurationHelperTest.groovy +++ b/test/groovy/com/sap/piper/ConfigurationHelperTest.groovy @@ -15,6 +15,7 @@ class ConfigurationHelperTest { void testGetProperty() { def configuration = new ConfigurationHelper(getConfiguration()) Assert.assertEquals('maven:3.2-jdk-8-onbuild', configuration.getConfigProperty('dockerImage')) + Assert.assertEquals('maven:3.2-jdk-8-onbuild', configuration.getConfigProperty('dockerImage', 'default')) Assert.assertEquals('default', configuration.getConfigProperty('something', 'default')) Assert.assertTrue(configuration.isPropertyDefined('dockerImage')) Assert.assertFalse(configuration.isPropertyDefined('something')) @@ -27,6 +28,12 @@ class ConfigurationHelperTest { Assert.assertFalse(configuration.isPropertyDefined('something')) } + @Test + void testIsPropertyDefinedWithInteger() { + def configuration = new ConfigurationHelper([dockerImage: 3]) + Assert.assertTrue(configuration.isPropertyDefined('dockerImage')) + } + @Test void testGetMandatoryProperty() { def configuration = new ConfigurationHelper(getConfiguration())