Test complicated deployment spec with nested parallel and serial blocks
@@ -231,7 +231,7 @@ public class ApplicationPackageBuilder {
return searchDefinition.getBytes(UTF_8);
}
- private byte[] buildMeta() {
+ private static byte[] buildMeta() {
return "{\"compileVersion\":\"6.1\",\"buildTime\":1000}".getBytes(UTF_8);
}
@@ -271,4 +271,19 @@ public class ApplicationPackageBuilder {
return new SimpleDateFormat("yyyy-MM-dd").format(Date.from(instant));
}
+ public static ApplicationPackage fromDeploymentXml(String deploymentXml) {
+ ByteArrayOutputStream zip = new ByteArrayOutputStream();
+ try (ZipOutputStream out = new ZipOutputStream(zip)) {
+ out.putNextEntry(new ZipEntry("deployment.xml"));
+ out.write(deploymentXml.getBytes(UTF_8));
+ out.closeEntry();
+ out.putNextEntry(new ZipEntry("build-meta.json"));
+ out.write(buildMeta());
+ out.closeEntry();
+ } catch (IOException e) {
+ throw new UncheckedIOException(e);
+ }
+ return new ApplicationPackage(zip.toByteArray());
+ }
+
}
