github.com/ouraigua/jenkins-library@v0.0.0-20231028010029-fbeaf2f3aa9b/test/groovy/com/sap/piper/CfManifestUtilsTest.groovy (about) 1 package com.sap.piper 2 3 import org.junit.Test 4 5 import static org.junit.Assert.* 6 7 class CfManifestUtilsTest { 8 9 @Test 10 void testManifestTransform() { 11 Map testFixture = [applications: [[buildpacks: ['sap_java_buildpack']]]] 12 Map expected = [applications: [[buildpack: 'sap_java_buildpack']]] 13 def actual = CfManifestUtils.transform(testFixture) 14 assertEquals(expected, actual) 15 } 16 17 @Test(expected = RuntimeException) 18 void testManifestTransformMultipleBuildpacks() { 19 Map testFixture = [applications: [[buildpacks: ['sap_java_buildpack', 'another_buildpack']]]] 20 CfManifestUtils.transform(testFixture) 21 } 22 23 @Test 24 void testManifestTransformShouldNotChange() { 25 Map testFixture = [applications: [[buildpack: 'sap_java_buildpack']]] 26 Map expected = [applications: [[buildpack: 'sap_java_buildpack']]] 27 def actual = CfManifestUtils.transform(testFixture) 28 assertEquals(expected, actual) 29 } 30 }