1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00

Merge pull request #82 from alejandraferreirovidal/addTests

improve tests coverage
This commit is contained in:
Alejandra Ferreiro Vidal 2018-02-16 17:26:55 +01:00 committed by GitHub
commit 0510e087b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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())