2018-03-13 10:31:01 +02:00
|
|
|
import org.junit.Before
|
2018-03-08 10:07:25 +02:00
|
|
|
import org.junit.Ignore
|
2017-07-11 15:12:03 +02:00
|
|
|
import org.junit.Rule
|
|
|
|
import org.junit.Test
|
|
|
|
import org.junit.rules.ExpectedException
|
2018-01-16 10:33:13 +02:00
|
|
|
import org.junit.rules.RuleChain
|
2018-03-13 10:31:01 +02:00
|
|
|
import org.yaml.snakeyaml.parser.ParserException
|
2018-01-16 18:06:25 +02:00
|
|
|
|
2018-03-13 10:31:01 +02:00
|
|
|
import hudson.AbortException
|
2018-06-06 11:19:19 +02:00
|
|
|
import util.BasePiperTest
|
2018-09-04 11:32:54 +02:00
|
|
|
import util.JenkinsDockerExecuteRule
|
2018-01-16 10:33:13 +02:00
|
|
|
import util.JenkinsLoggingRule
|
2018-08-31 10:22:43 +02:00
|
|
|
import util.JenkinsReadYamlRule
|
2018-01-16 16:03:00 +02:00
|
|
|
import util.JenkinsShellCallRule
|
2018-02-28 14:12:03 +02:00
|
|
|
import util.JenkinsStepRule
|
2019-04-24 12:47:37 +02:00
|
|
|
import util.JenkinsWriteFileRule
|
2018-01-26 15:55:15 +02:00
|
|
|
import util.Rules
|
2018-01-16 10:33:13 +02:00
|
|
|
|
2019-12-04 14:24:23 +02:00
|
|
|
import static org.junit.Assert.assertThat
|
|
|
|
import static org.hamcrest.Matchers.containsString
|
|
|
|
import static org.hamcrest.Matchers.hasItem
|
|
|
|
|
2018-06-06 11:19:19 +02:00
|
|
|
public class MtaBuildTest extends BasePiperTest {
|
2018-02-21 13:48:14 +02:00
|
|
|
|
2018-01-16 10:33:13 +02:00
|
|
|
private ExpectedException thrown = new ExpectedException()
|
2019-01-22 10:22:15 +02:00
|
|
|
private JenkinsLoggingRule loggingRule = new JenkinsLoggingRule(this)
|
2019-01-22 10:19:28 +02:00
|
|
|
private JenkinsShellCallRule shellRule = new JenkinsShellCallRule(this)
|
2019-01-22 10:26:08 +02:00
|
|
|
private JenkinsDockerExecuteRule dockerExecuteRule = new JenkinsDockerExecuteRule(this)
|
2019-01-22 10:25:42 +02:00
|
|
|
private JenkinsStepRule stepRule = new JenkinsStepRule(this)
|
2019-01-22 10:27:01 +02:00
|
|
|
private JenkinsReadYamlRule readYamlRule = new JenkinsReadYamlRule(this).registerYaml('mta.yaml', defaultMtaYaml() )
|
2019-04-24 12:47:37 +02:00
|
|
|
private JenkinsWriteFileRule writeFileRule = new JenkinsWriteFileRule(this)
|
2017-07-11 15:12:03 +02:00
|
|
|
|
|
|
|
@Rule
|
2018-02-28 14:12:03 +02:00
|
|
|
public RuleChain ruleChain = Rules
|
|
|
|
.getCommonRules(this)
|
2019-01-22 10:27:01 +02:00
|
|
|
.around(readYamlRule)
|
2018-02-28 14:12:03 +02:00
|
|
|
.around(thrown)
|
2019-01-22 10:22:15 +02:00
|
|
|
.around(loggingRule)
|
2019-01-22 10:19:28 +02:00
|
|
|
.around(shellRule)
|
2019-01-22 10:26:08 +02:00
|
|
|
.around(dockerExecuteRule)
|
2019-01-22 10:25:42 +02:00
|
|
|
.around(stepRule)
|
2019-04-24 12:47:37 +02:00
|
|
|
.around(writeFileRule)
|
2018-01-26 14:35:49 +02:00
|
|
|
|
2017-07-11 15:12:03 +02:00
|
|
|
@Before
|
2018-01-16 10:33:13 +02:00
|
|
|
void init() {
|
2017-07-11 15:12:03 +02:00
|
|
|
|
2018-11-13 09:55:18 +02:00
|
|
|
helper.registerAllowedMethod('fileExists', [String], { s -> s == 'mta.yaml' })
|
2018-12-10 12:41:31 +02:00
|
|
|
|
2019-04-24 12:47:37 +02:00
|
|
|
helper.registerAllowedMethod('httpRequest', [String.class], { s -> new SettingsStub()})
|
|
|
|
|
2019-01-22 10:19:28 +02:00
|
|
|
shellRule.setReturnValue(JenkinsShellCallRule.Type.REGEX, '.*\\$MTA_JAR_LOCATION.*', '')
|
|
|
|
shellRule.setReturnValue(JenkinsShellCallRule.Type.REGEX, '.*\\$JAVA_HOME.*', '')
|
|
|
|
shellRule.setReturnValue(JenkinsShellCallRule.Type.REGEX, '.*which java.*', 0)
|
|
|
|
shellRule.setReturnValue(JenkinsShellCallRule.Type.REGEX, '.*java -version.*', '''openjdk version \"1.8.0_121\"
|
2018-12-10 12:41:31 +02:00
|
|
|
OpenJDK Runtime Environment (build 1.8.0_121-8u121-b13-1~bpo8+1-b13)
|
|
|
|
OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)''')
|
2019-01-22 10:19:28 +02:00
|
|
|
shellRule.setReturnValue(JenkinsShellCallRule.Type.REGEX, '.*mta\\.jar -v.*', '1.0.6')
|
2017-07-11 15:12:03 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2018-02-05 16:16:52 +02:00
|
|
|
@Test
|
2018-02-06 12:51:04 +02:00
|
|
|
void environmentPathTest() {
|
2018-02-05 16:16:52 +02:00
|
|
|
|
2019-01-22 10:25:42 +02:00
|
|
|
stepRule.step.mtaBuild(script: nullScript, buildTarget: 'NEO')
|
2018-02-05 16:16:52 +02:00
|
|
|
|
2019-06-13 13:51:57 +02:00
|
|
|
assert shellRule.shell.find { c -> c.contains('PATH=./node_modules/.bin:$PATH')}
|
2018-02-05 16:16:52 +02:00
|
|
|
}
|
|
|
|
|
2017-07-11 15:12:03 +02:00
|
|
|
@Test
|
2018-02-06 12:51:04 +02:00
|
|
|
void sedTest() {
|
2017-07-11 15:12:03 +02:00
|
|
|
|
2019-01-22 10:25:42 +02:00
|
|
|
stepRule.step.mtaBuild(script: nullScript, buildTarget: 'NEO')
|
2017-07-11 15:12:03 +02:00
|
|
|
|
2019-01-22 10:19:28 +02:00
|
|
|
assert shellRule.shell.find { c -> c =~ /sed -ie "s\/\\\$\{timestamp\}\/`date \+%Y%m%d%H%M%S`\/g" "mta.yaml"$/}
|
2017-07-11 15:12:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
2019-02-15 14:48:34 +02:00
|
|
|
void mtarFilePathFromCommonPipelineEnvironmentTest() {
|
2017-07-11 15:12:03 +02:00
|
|
|
|
2019-01-22 10:25:42 +02:00
|
|
|
stepRule.step.mtaBuild(script: nullScript,
|
2018-01-16 18:06:25 +02:00
|
|
|
buildTarget: 'NEO')
|
|
|
|
|
2018-06-06 11:19:19 +02:00
|
|
|
def mtarFilePath = nullScript.commonPipelineEnvironment.getMtarFilePath()
|
2017-07-11 15:12:03 +02:00
|
|
|
|
2018-08-31 09:15:44 +02:00
|
|
|
assert mtarFilePath == "com.mycompany.northwind.mtar"
|
2017-07-11 15:12:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
2018-02-05 16:30:21 +02:00
|
|
|
void mtaJarLocationAsParameterTest() {
|
2017-07-11 15:12:03 +02:00
|
|
|
|
2020-02-07 13:20:46 +02:00
|
|
|
stepRule.step.mtaBuild(script: nullScript, mtaBuildTool: 'classic', mtaJarLocation: '/mylocation/mta/mta.jar', buildTarget: 'NEO')
|
2017-07-11 15:12:03 +02:00
|
|
|
|
2019-01-22 10:19:28 +02:00
|
|
|
assert shellRule.shell.find { c -> c.contains('-jar /mylocation/mta/mta.jar --mtar')}
|
2017-07-11 15:12:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
2018-02-06 12:51:04 +02:00
|
|
|
void noMtaPresentTest() {
|
2018-11-13 09:55:18 +02:00
|
|
|
helper.registerAllowedMethod('fileExists', [String], { false })
|
|
|
|
thrown.expect(AbortException)
|
|
|
|
thrown.expectMessage('\'mta.yaml\' not found in project sources and \'applicationName\' not provided as parameter ' +
|
|
|
|
'- cannot generate \'mta.yaml\' file.')
|
2017-07-11 15:12:03 +02:00
|
|
|
|
2019-01-22 10:25:42 +02:00
|
|
|
stepRule.step.mtaBuild(script: nullScript, buildTarget: 'NEO')
|
2017-07-11 15:12:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
2018-02-06 12:51:04 +02:00
|
|
|
void badMtaTest() {
|
2018-02-05 18:15:46 +02:00
|
|
|
|
2017-07-11 15:12:03 +02:00
|
|
|
thrown.expect(ParserException)
|
|
|
|
thrown.expectMessage('while parsing a block mapping')
|
|
|
|
|
2019-01-22 10:27:01 +02:00
|
|
|
readYamlRule.registerYaml('mta.yaml', badMtaYaml())
|
2017-07-11 15:12:03 +02:00
|
|
|
|
2019-01-22 10:25:42 +02:00
|
|
|
stepRule.step.mtaBuild(script: nullScript, buildTarget: 'NEO')
|
2017-07-11 15:12:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
2018-02-06 12:51:04 +02:00
|
|
|
void noIdInMtaTest() {
|
2018-02-05 18:15:46 +02:00
|
|
|
|
2017-07-11 15:12:03 +02:00
|
|
|
thrown.expect(AbortException)
|
2018-08-31 09:15:44 +02:00
|
|
|
thrown.expectMessage("Property 'ID' not found in mta.yaml file.")
|
2017-07-11 15:12:03 +02:00
|
|
|
|
2019-01-22 10:27:01 +02:00
|
|
|
readYamlRule.registerYaml('mta.yaml', noIdMtaYaml() )
|
2017-07-11 15:12:03 +02:00
|
|
|
|
2019-01-22 10:25:42 +02:00
|
|
|
stepRule.step.mtaBuild(script: nullScript, buildTarget: 'NEO')
|
2017-07-11 15:12:03 +02:00
|
|
|
}
|
|
|
|
|
2018-02-05 16:28:16 +02:00
|
|
|
@Test
|
2018-02-08 14:18:04 +02:00
|
|
|
void mtaJarLocationFromCustomStepConfigurationTest() {
|
2018-02-05 16:28:16 +02:00
|
|
|
|
2018-06-06 11:19:19 +02:00
|
|
|
nullScript.commonPipelineEnvironment.configuration = [steps:[mtaBuild:[mtaJarLocation: '/config/mta/mta.jar']]]
|
2018-02-08 14:18:04 +02:00
|
|
|
|
2020-02-07 13:20:46 +02:00
|
|
|
stepRule.step.mtaBuild(script: nullScript, mtaBuildTool: 'classic',
|
2018-02-08 14:18:04 +02:00
|
|
|
buildTarget: 'NEO')
|
|
|
|
|
2019-03-25 15:16:18 +02:00
|
|
|
assert shellRule.shell.find(){ c -> c.contains('java -jar /config/mta/mta.jar --mtar')}
|
2018-02-08 14:18:04 +02:00
|
|
|
}
|
|
|
|
|
2018-04-17 16:53:04 +02:00
|
|
|
@Test
|
|
|
|
void mtaJarLocationFromDefaultStepConfigurationTest() {
|
|
|
|
|
2020-02-07 13:20:46 +02:00
|
|
|
stepRule.step.mtaBuild(script: nullScript, mtaBuildTool: 'classic',
|
2018-04-17 16:53:04 +02:00
|
|
|
buildTarget: 'NEO')
|
|
|
|
|
2019-03-25 15:16:18 +02:00
|
|
|
assert shellRule.shell.find(){ c -> c.contains('java -jar /opt/sap/mta/lib/mta.jar --mtar')}
|
2018-04-17 16:53:04 +02:00
|
|
|
}
|
|
|
|
|
2018-02-08 14:18:04 +02:00
|
|
|
@Test
|
|
|
|
void buildTargetFromParametersTest() {
|
2018-02-05 16:28:16 +02:00
|
|
|
|
2020-02-07 13:20:46 +02:00
|
|
|
stepRule.step.mtaBuild(script: nullScript, mtaBuildTool: 'classic', buildTarget: 'NEO')
|
2018-02-05 16:28:16 +02:00
|
|
|
|
2019-02-15 14:48:34 +02:00
|
|
|
assert shellRule.shell.find { c -> c.contains('java -jar /opt/sap/mta/lib/mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO build')}
|
2018-02-08 14:18:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void buildTargetFromCustomStepConfigurationTest() {
|
|
|
|
|
2018-06-06 11:19:19 +02:00
|
|
|
nullScript.commonPipelineEnvironment.configuration = [steps:[mtaBuild:[buildTarget: 'NEO']]]
|
2018-02-08 14:18:04 +02:00
|
|
|
|
2020-02-07 13:20:46 +02:00
|
|
|
stepRule.step.mtaBuild(script: nullScript, mtaBuildTool: 'classic')
|
2018-02-08 14:18:04 +02:00
|
|
|
|
2019-02-15 14:48:34 +02:00
|
|
|
assert shellRule.shell.find(){ c -> c.contains('java -jar /opt/sap/mta/lib/mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO build')}
|
2018-02-08 14:18:04 +02:00
|
|
|
}
|
|
|
|
|
2019-07-25 11:57:21 +02:00
|
|
|
@Test
|
|
|
|
void dockerFromCustomStepConfigurationTest() {
|
|
|
|
|
|
|
|
def expectedImage = 'image:test'
|
|
|
|
def expectedEnvVars = ['env1': 'value1', 'env2': 'value2']
|
|
|
|
def expectedOptions = '--opt1=val1 --opt2=val2 --opt3'
|
|
|
|
def expectedWorkspace = '-w /path/to/workspace'
|
|
|
|
|
|
|
|
nullScript.commonPipelineEnvironment.configuration = [steps:[mtaBuild:[
|
|
|
|
dockerImage: expectedImage,
|
|
|
|
dockerOptions: expectedOptions,
|
|
|
|
dockerEnvVars: expectedEnvVars,
|
|
|
|
dockerWorkspace: expectedWorkspace
|
|
|
|
]]]
|
|
|
|
|
|
|
|
stepRule.step.mtaBuild(script: nullScript)
|
|
|
|
|
|
|
|
assert expectedImage == dockerExecuteRule.dockerParams.dockerImage
|
|
|
|
assert expectedOptions == dockerExecuteRule.dockerParams.dockerOptions
|
|
|
|
assert expectedEnvVars.equals(dockerExecuteRule.dockerParams.dockerEnvVars)
|
|
|
|
assert expectedWorkspace == dockerExecuteRule.dockerParams.dockerWorkspace
|
|
|
|
}
|
|
|
|
|
2018-09-04 11:32:54 +02:00
|
|
|
@Test
|
|
|
|
void canConfigureDockerImage() {
|
|
|
|
|
2019-01-22 10:25:42 +02:00
|
|
|
stepRule.step.mtaBuild(script: nullScript, dockerImage: 'mta-docker-image:latest')
|
2018-09-04 11:32:54 +02:00
|
|
|
|
2019-01-22 10:26:08 +02:00
|
|
|
assert 'mta-docker-image:latest' == dockerExecuteRule.dockerParams.dockerImage
|
2018-09-04 11:32:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void canConfigureDockerOptions() {
|
|
|
|
|
2019-01-22 10:25:42 +02:00
|
|
|
stepRule.step.mtaBuild(script: nullScript, dockerOptions: 'something')
|
2018-09-04 11:32:54 +02:00
|
|
|
|
2019-01-22 10:26:08 +02:00
|
|
|
assert 'something' == dockerExecuteRule.dockerParams.dockerOptions
|
2018-09-04 11:32:54 +02:00
|
|
|
}
|
2018-02-08 14:18:04 +02:00
|
|
|
|
2019-04-17 10:44:55 +02:00
|
|
|
@Test
|
|
|
|
void canConfigureMavenUserSettings() {
|
|
|
|
|
|
|
|
stepRule.step.mtaBuild(script: nullScript, projectSettingsFile: 'settings.xml')
|
|
|
|
|
|
|
|
assert shellRule.shell.find(){ c -> c.contains('cp settings.xml $HOME/.m2/settings.xml')}
|
|
|
|
}
|
|
|
|
|
2019-04-24 12:47:37 +02:00
|
|
|
@Test
|
|
|
|
void canConfigureMavenUserSettingsFromRemoteSource() {
|
|
|
|
|
|
|
|
stepRule.step.mtaBuild(script: nullScript, projectSettingsFile: 'https://some.host/my-settings.xml')
|
|
|
|
|
|
|
|
assert shellRule.shell.find(){ c -> c.contains('cp project-settings.xml $HOME/.m2/settings.xml')}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void canConfigureMavenGlobalSettings() {
|
|
|
|
|
|
|
|
stepRule.step.mtaBuild(script: nullScript, globalSettingsFile: 'settings.xml')
|
|
|
|
|
|
|
|
assert shellRule.shell.find(){ c -> c.contains('cp settings.xml $M2_HOME/conf/settings.xml')}
|
|
|
|
}
|
|
|
|
|
2019-05-09 08:51:11 +02:00
|
|
|
@Test
|
|
|
|
void canConfigureNpmRegistry() {
|
|
|
|
|
|
|
|
stepRule.step.mtaBuild(script: nullScript, defaultNpmRegistry: 'myNpmRegistry.com')
|
|
|
|
|
|
|
|
assert shellRule.shell.find(){ c -> c.contains('npm config set registry myNpmRegistry.com')}
|
|
|
|
}
|
|
|
|
|
2019-04-24 12:47:37 +02:00
|
|
|
@Test
|
|
|
|
void canConfigureMavenGlobalSettingsFromRemoteSource() {
|
|
|
|
|
|
|
|
stepRule.step.mtaBuild(script: nullScript, globalSettingsFile: 'https://some.host/my-settings.xml')
|
|
|
|
|
|
|
|
assert shellRule.shell.find(){ c -> c.contains('cp global-settings.xml $M2_HOME/conf/settings.xml')}
|
|
|
|
}
|
|
|
|
|
2018-02-08 14:18:04 +02:00
|
|
|
@Test
|
|
|
|
void buildTargetFromDefaultStepConfigurationTest() {
|
|
|
|
|
2018-06-06 11:19:19 +02:00
|
|
|
nullScript.commonPipelineEnvironment.defaultConfiguration = [steps:[mtaBuild:[buildTarget: 'NEO']]]
|
2018-02-08 14:18:04 +02:00
|
|
|
|
2020-02-07 13:20:46 +02:00
|
|
|
stepRule.step.mtaBuild(script: nullScript, mtaBuildTool: 'classic',)
|
2018-02-08 14:18:04 +02:00
|
|
|
|
2019-02-15 14:48:34 +02:00
|
|
|
assert shellRule.shell.find { c -> c.contains('java -jar /opt/sap/mta/lib/mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO build')}
|
2018-02-05 16:28:16 +02:00
|
|
|
}
|
|
|
|
|
2018-04-17 17:35:10 +02:00
|
|
|
@Test
|
|
|
|
void extensionFromParametersTest() {
|
|
|
|
|
2020-02-07 13:20:46 +02:00
|
|
|
stepRule.step.mtaBuild(script: nullScript, buildTarget: 'NEO', mtaBuildTool: 'classic', extension: 'param_extension')
|
2018-04-17 17:35:10 +02:00
|
|
|
|
2019-02-15 14:48:34 +02:00
|
|
|
assert shellRule.shell.find { c -> c.contains('java -jar /opt/sap/mta/lib/mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO --extension=param_extension build')}
|
2018-04-17 17:35:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void extensionFromCustomStepConfigurationTest() {
|
|
|
|
|
2018-06-06 11:19:19 +02:00
|
|
|
nullScript.commonPipelineEnvironment.configuration = [steps:[mtaBuild:[buildTarget: 'NEO', extension: 'config_extension']]]
|
2018-04-17 17:35:10 +02:00
|
|
|
|
2020-02-07 13:20:46 +02:00
|
|
|
stepRule.step.mtaBuild(script: nullScript, mtaBuildTool: 'classic',)
|
2018-04-17 17:35:10 +02:00
|
|
|
|
2019-02-15 14:48:34 +02:00
|
|
|
assert shellRule.shell.find(){ c -> c.contains('java -jar /opt/sap/mta/lib/mta.jar --mtar com.mycompany.northwind.mtar --build-target=NEO --extension=config_extension build')}
|
2018-04-17 17:35:10 +02:00
|
|
|
}
|
|
|
|
|
2019-12-06 08:48:20 +02:00
|
|
|
@Test
|
|
|
|
void canConfigureMTARName() {
|
|
|
|
|
|
|
|
stepRule.step.mtaBuild(script: nullScript, mtarName: 'custom.name.mtar')
|
|
|
|
|
|
|
|
assert shellRule.shell.find(){ c -> c.contains('--mtar custom.name.mtar')}
|
|
|
|
}
|
|
|
|
|
2019-12-04 14:24:23 +02:00
|
|
|
@Test
|
|
|
|
void testCloudMbt() {
|
|
|
|
nullScript.commonPipelineEnvironment.configuration = [steps:[mtaBuild:[mtaBuildTool: 'cloudMbt']]]
|
|
|
|
|
|
|
|
stepRule.step.mtaBuild(script: nullScript)
|
|
|
|
|
|
|
|
assertThat(shellRule.shell, hasItem(containsString('mbt build')))
|
|
|
|
assertThat(shellRule.shell, hasItem(containsString('--platform cf')))
|
|
|
|
assertThat(shellRule.shell, hasItem(containsString('--target ./')))
|
|
|
|
assertThat(shellRule.shell, hasItem(containsString('--mtar com.mycompany.northwind.mtar')))
|
|
|
|
}
|
2018-04-17 17:35:10 +02:00
|
|
|
|
2018-02-13 11:11:08 +02:00
|
|
|
private static defaultMtaYaml() {
|
2017-07-11 15:12:03 +02:00
|
|
|
return '''
|
|
|
|
_schema-version: "2.0.0"
|
|
|
|
ID: "com.mycompany.northwind"
|
|
|
|
version: 1.0.0
|
2018-02-05 17:45:24 +02:00
|
|
|
|
2017-07-11 15:12:03 +02:00
|
|
|
parameters:
|
|
|
|
hcp-deployer-version: "1.0.0"
|
2018-02-05 17:45:24 +02:00
|
|
|
|
2017-07-11 15:12:03 +02:00
|
|
|
modules:
|
|
|
|
- name: "fiorinorthwind"
|
|
|
|
type: html5
|
|
|
|
path: .
|
|
|
|
parameters:
|
|
|
|
version: 1.0.0-${timestamp}
|
|
|
|
build-parameters:
|
|
|
|
builder: grunt
|
|
|
|
build-result: dist
|
|
|
|
'''
|
|
|
|
}
|
|
|
|
|
2018-02-05 18:16:53 +02:00
|
|
|
private badMtaYaml() {
|
2017-07-11 15:12:03 +02:00
|
|
|
return '''
|
|
|
|
_schema-version: "2.0.0
|
|
|
|
ID: "com.mycompany.northwind"
|
|
|
|
version: 1.0.0
|
2018-02-05 17:45:24 +02:00
|
|
|
|
2017-07-11 15:12:03 +02:00
|
|
|
parameters:
|
|
|
|
hcp-deployer-version: "1.0.0"
|
2018-02-05 17:45:24 +02:00
|
|
|
|
2017-07-11 15:12:03 +02:00
|
|
|
modules:
|
|
|
|
- name: "fiorinorthwind"
|
|
|
|
type: html5
|
|
|
|
path: .
|
|
|
|
parameters:
|
|
|
|
version: 1.0.0-${timestamp}
|
|
|
|
build-parameters:
|
|
|
|
builder: grunt
|
|
|
|
build-result: dist
|
|
|
|
'''
|
|
|
|
}
|
|
|
|
|
2018-02-05 18:16:53 +02:00
|
|
|
private noIdMtaYaml() {
|
2017-07-11 15:12:03 +02:00
|
|
|
return '''
|
|
|
|
_schema-version: "2.0.0"
|
|
|
|
version: 1.0.0
|
2018-02-05 17:45:24 +02:00
|
|
|
|
2017-07-11 15:12:03 +02:00
|
|
|
parameters:
|
|
|
|
hcp-deployer-version: "1.0.0"
|
2018-02-05 17:45:24 +02:00
|
|
|
|
2017-07-11 15:12:03 +02:00
|
|
|
modules:
|
|
|
|
- name: "fiorinorthwind"
|
|
|
|
type: html5
|
|
|
|
path: .
|
|
|
|
parameters:
|
|
|
|
version: 1.0.0-${timestamp}
|
|
|
|
build-parameters:
|
|
|
|
builder: grunt
|
|
|
|
build-result: dist
|
|
|
|
'''
|
|
|
|
}
|
2018-03-12 17:50:32 +02:00
|
|
|
|
2019-04-24 12:47:37 +02:00
|
|
|
class SettingsStub {
|
|
|
|
String getContent() {
|
|
|
|
return "<xml>sometext</xml>"
|
|
|
|
}
|
|
|
|
}
|
2017-07-11 15:12:03 +02:00
|
|
|
}
|