Test create application on submit for public
@@ -251,6 +251,26 @@ public class ApplicationApiCloudTest extends ControllerContainerCloudTest {
assertTrue(tester.controller().applications().getApplication(TenantAndApplicationId.from(tenantName, application)).isPresent());
}
+ @Test
+ public void create_application_on_submit() {
+ var application = ApplicationName.from("unique");
+ var applicationPackage = new ApplicationPackageBuilder()
+ .trustDefaultCertificate()
+ .build();
+
+ assertTrue(tester.controller().applications().getApplication(TenantAndApplicationId.from(tenantName, application)).isEmpty());
+
+ var data = ApplicationApiTest.createApplicationSubmissionData(applicationPackage, 123);
+
+ tester.assertResponse(
+ request("/application/v4/tenant/scoober/application/unique/submit", POST)
+ .data(data)
+ .roles(Set.of(Role.developer(tenantName))),
+ "{\"message\":\"Application package version: 1.0.1-commit1, source revision of repository 'repository1', branch 'master' with commit 'commit1', by a@b, built against 6.1 at 1970-01-01T00:00:01Z\"}");
+
+ assertTrue(tester.controller().applications().getApplication(TenantAndApplicationId.from(tenantName, application)).isPresent());
+ }
+
private ApplicationPackageBuilder prodBuilder() {
return new ApplicationPackageBuilder()
.instances("default")
