new Expectation(Expectation.Type.RESOURCE, "expanded-properties-00.json"), Arrays.asList("credentials_2", "credentials_4#user", "credentials_4#pass", "name_2", "url_2"), }, new Expectation(Expectation.Type.RESOURCE, "expanded-properties-01.json"), Arrays.asList("credentials_2", "credentials_4#user", "credentials_4#pass", "name_2", "url_2"), }, new Expectation(Expectation.Type.RESOURCE, "expanded-properties-02.json"), Arrays.asList("credentials_2", "credentials_4#user", "credentials_4#pass", "name_2", "url_2"), }, new Expectation(Expectation.Type.RESOURCE, "expanded-properties-03.json"), Arrays.asList("credentials_2", "credentials_4#user", "credentials_4#pass", "name_2", "url_2"), },
new String[] { "java-hello-world", "java-hello-world-db", "java-hello-world-backend" }, // mtaModules new String[] {}, // deployedApps new Expectation(Expectation.Type.RESOURCE, "/mta/javahelloworld/services.json"), new Expectation(Expectation.Type.RESOURCE, "/mta/javahelloworld/apps-v2.json"), }, new String[] { "java-hello-world", "java-hello-world-db", "java-hello-world-backend" }, // mtaModules new String[] {}, // deployedApps new Expectation(Expectation.Type.RESOURCE, "/mta/javahelloworld/xs2-services.json"), new Expectation(Expectation.Type.RESOURCE, "/mta/javahelloworld/xs2-apps-v2.json"), }, new String[] { "java-hello-world", "java-hello-world-db", "java-hello-world-backend" }, // mtaModules new String[] {}, // deployedApps new Expectation(Expectation.Type.RESOURCE, "/mta/javahelloworld/services-ns.json"), new Expectation(Expectation.Type.RESOURCE, "/mta/javahelloworld/apps-ns-v2.json"), }, new String[] { "java-hello-world", "java-hello-world-db", "java-hello-world-backend" }, // mtaModules new String[] {}, // deployedApps new Expectation(Expectation.Type.RESOURCE, "/mta/javahelloworld/services.json"), new Expectation(Expectation.Type.RESOURCE, "/mta/javahelloworld/apps-ns2-v2.json"), }, new String[] { "java-hello-world", "java-hello-world-db", "java-hello-world-backend" }, // mtaModules new String[] { "java-hello-world", "java-hello-world-db", "java-hello-world-backend" }, // deployedApps new Expectation(Expectation.Type.RESOURCE, "/mta/javahelloworld/services-patch1.json"), new Expectation(Expectation.Type.RESOURCE, "/mta/javahelloworld/apps-patch1.json"), },
new Expectation(Expectation.Type.RESOURCE, "configuration-entry-07.json")), }, new Expectation(Expectation.Type.RESOURCE, "configuration-entry-dao-test-output-11.json")), }, new Expectation(Expectation.Type.RESOURCE, "configuration-entry-dao-test-output-12.json")), }, new Expectation(null)), }, new Expectation(Expectation.Type.RESOURCE, "configuration-entry-dao-test-output-19.json")), }, new Expectation(Expectation.Type.RESOURCE, "configuration-entry-dao-test-output-20.json")), }, new Expectation(Expectation.Type.RESOURCE, "configuration-entry-dao-test-output-21.json")), }, new Expectation(Expectation.Type.RESOURCE, "configuration-entry-dao-test-output-22.json")), }, new Expectation(Expectation.Type.RESOURCE, "configuration-entry-dao-test-output-23.json")), }, new Expectation(Expectation.Type.RESOURCE, "configuration-entry-dao-test-output-24.json")), },
new Expectation(Expectation.Type.RESOURCE, "configuration-subscription-04.json")), }, new Expectation(Expectation.Type.EXCEPTION, "Configuration subscription for MTA \"com.sap.sample.mta.framework\", app \"framework\" and resource \"plugin\" already exists in space \"sap\"")), }, new Expectation(Expectation.Type.EXCEPTION, "Configuration subscription's \"resource_name\" column value should not be null")), }, new Expectation(Expectation.Type.EXCEPTION, "Configuration subscription's \"module\" column value should not be null")), }, new Expectation(Expectation.Type.EXCEPTION, "Configuration subscription's \"mta_id\" column value should not be null")), }, new Expectation(Expectation.Type.EXCEPTION, "Configuration subscription's \"filter\" column value should not be null")), }, new Expectation(Expectation.Type.EXCEPTION, "Configuration subscription's \"app_name\" column value should not be null")), }, new Expectation(Expectation.Type.EXCEPTION, "Configuration subscription's \"space_id\" column value should not be null")), }, new Expectation(Expectation.Type.RESOURCE, "configuration-subscription-00.json")), }, new Expectation(Expectation.Type.RESOURCE, "configuration-subscription-dao-test-output-00.json")), },
"mtad-01.yaml", new Expectation(Expectation.Type.RESOURCE, "mtad-01.yaml.json"), }, "mtad-02.yaml", new Expectation(Expectation.Type.EXCEPTION, "Value for parameter \"foo#port\" is not valid and cannot be corrected") }, "mtad-03.yaml", new Expectation(Expectation.Type.RESOURCE, "mtad-03.yaml.json"), }, "mtad-04.yaml", new Expectation(Expectation.Type.RESOURCE, "mtad-04.yaml.json"), }, "mtad-06.yaml", new Expectation(Expectation.Type.RESOURCE, "mtad-06.yaml.json"), }, "mtad-07.yaml", new Expectation(Expectation.Type.RESOURCE, "mtad-07.yaml.json"), },
"mtad-03.yaml", "configuration-entries-01.json", new Expectation(Expectation.Type.RESOURCE, "result-01.json"), }, "mtad-05.yaml", "configuration-entries-01.json", new Expectation(Expectation.Type.RESOURCE, "result-01.json"), }, "mtad-05.yaml", "configuration-entries-05.json", new Expectation(Expectation.Type.EXCEPTION, "Multiple configuration entries were found matching the filter specified in resource \"resource-2\"") }, "mtad-07.yaml", "configuration-entries-06.json", new Expectation(Expectation.Type.RESOURCE, "result-02.json"), }, "mtad-05.yaml", "configuration-entries-04.json", new Expectation(Expectation.Type.EXCEPTION, "No configuration entries were found matching the filter specified in resource \"resource-2\"") }, "mtad-07.yaml", "configuration-entries-07.json", new Expectation(Expectation.Type.RESOURCE, "result-03.json"), }, "mtad-06.yaml", "configuration-entries-01.json", new Expectation(Expectation.Type.EXCEPTION, "Could not find required property \"org\"") }, "mtad-08.yaml", "configuration-entries-06.json", new Expectation(Expectation.Type.RESOURCE, "result-04.json"), },
"deployed-mta-02.json", new Expectation[] { new Expectation("GREEN"), new Expectation("GREEN"), }, }, "deployed-mta-01.json", new Expectation[] { new Expectation("BLUE"), new Expectation("BLUE"), }, }, "deployed-mta-03.json", new Expectation[] { new Expectation("BLUE"), new Expectation("BLUE"), }, }, "deployed-mta-04.json", new Expectation[] { new Expectation(Expectation.Type.EXCEPTION, "There are both blue and green applications already deployed for MTA \"com.sap.sample.mta.consumer\""), new Expectation("GREEN"), }, }, "deployed-mta-05.json", new Expectation[] { new Expectation(null), new Expectation(null), }, }, "deployed-mta-06.json", new Expectation[] { new Expectation(Expectation.Type.EXCEPTION, "There are both blue and green applications already deployed for MTA \"com.sap.sample.mta.consumer\""), new Expectation("GREEN"), }, }, null, new Expectation[] { new Expectation(null), new Expectation(null), }, },
"space-scoped-service-broker.json", new Expectation(Expectation.Type.RESOURCE, "space-scoped-service-broker-creation-request.json"), }, "global-service-broker.json", new Expectation(Expectation.Type.RESOURCE, "global-service-broker-creation-request.json"), }, "service-broker-with-missing-name.json", new Expectation(Expectation.Type.EXCEPTION, "The service broker's name must not be null!") }, "service-broker-with-missing-username.json", new Expectation(Expectation.Type.EXCEPTION, "The service broker's username must not be null!") }, "service-broker-with-missing-password.json", new Expectation(Expectation.Type.EXCEPTION, "The service broker's password must not be null!") }, "service-broker-with-missing-url.json", new Expectation(Expectation.Type.EXCEPTION, "The service broker's URL must not be null!") },
new Expectation(Expectation.Type.RESOURCE, "expected-cloud-space-00.json"), }, new Expectation(Expectation.Type.EXCEPTION, "The response of finding a space by org and space names should not have more than one resource element"), }, new Expectation(null), }, new Expectation(Expectation.Type.EXCEPTION, "The response of finding a space by org and space names should contain a 'resources' element"), }, new Expectation(Expectation.Type.EXCEPTION, "The response of finding a space by org and space names should not have more than one resource element"), },
"object-00.json", new Expectation(Expectation.Type.RESOURCE, "env-value-00.txt"), }, "object-01.json", new Expectation(Expectation.Type.RESOURCE, "env-value-01.txt"), }, "object-02.json", new Expectation(Expectation.Type.RESOURCE, "env-value-02.txt"), }, "object-03.json", new Expectation(Expectation.Type.RESOURCE, "env-value-03.txt"), }, "object-04.json", new Expectation(Expectation.Type.RESOURCE, "env-value-04.txt"), }, "object-05.json", new Expectation(Expectation.Type.RESOURCE, "env-value-05.txt"), },
Arguments.of("apps-01.json", new Expectation(Expectation.Type.RESOURCE, "deployed-components-01.json")), Arguments.of("apps-02.json", new Expectation(Expectation.Type.RESOURCE, "deployed-components-02.json")), Arguments.of("apps-03.json", new Expectation(Expectation.Type.EXCEPTION, "Cannot parse MTA metadata for application \"mta-application-1\". This indicates that MTA reserved variables in the application's environment were modified manually. Either revert the changes or delete the application.")), Arguments.of("apps-04.json", new Expectation(Expectation.Type.EXCEPTION, "Cannot parse MTA metadata for application \"mta-application-1\". This indicates that MTA reserved variables in the application's environment were modified manually. Either revert the changes or delete the application.")), Arguments.of("apps-05.json", new Expectation(Expectation.Type.EXCEPTION, "Cannot parse MTA metadata for application \"mta-application-1\". This indicates that MTA reserved variables in the application's environment were modified manually. Either revert the changes or delete the application.")), Arguments.of("apps-06.json", new Expectation(Expectation.Type.EXCEPTION, "Cannot parse MTA metadata for application \"mta-application-1\". This indicates that MTA reserved variables in the application's environment were modified manually. Either revert the changes or delete the application.")), Arguments.of("apps-07.json", new Expectation(Expectation.Type.RESOURCE, "deployed-components-07.json")), Arguments.of("apps-08.json", new Expectation(Expectation.Type.RESOURCE, "deployed-components-08.json")), Arguments.of("apps-09.json", new Expectation(Expectation.Type.RESOURCE, "deployed-components-09.json")), Arguments.of("apps-10.json", new Expectation(Expectation.Type.RESOURCE, "deployed-components-10.json")), Arguments.of("apps-11.json", new Expectation(Expectation.Type.EXCEPTION, "Cannot parse MTA metadata for application \"mta-application\". This indicates that MTA reserved variables in the application's environment were modified manually. Either revert the changes or delete the application.")), Arguments.of("apps-12.json", new Expectation(Expectation.Type.EXCEPTION, "Cannot parse MTA metadata for application \"mta-application\". This indicates that MTA reserved variables in the application's environment were modified manually. Either revert the changes or delete the application."))
@Parameters public static Iterable<Object[]> getParameters() { return Arrays.asList(new Object[][] { // @formatter:off // (0) Test that provided dependencies from version 2 are public by default: { "mtad-07-v2.yaml", 2, "some-org", "some-space", new Expectation(Expectation.Type.RESOURCE, "expected-configuration-entries-01.json"), }, // (1) Test that provided dependencies from version 3 are not public by default: { "mtad-07-v2.yaml", 3, "some-org", "some-space", new Expectation(Expectation.Type.RESOURCE, "expected-configuration-entries-02.json"), }, // (2) Test that explicitly public provided dependencies are converted to configuration entries: { "mtad-08-v2.yaml", 3, "some-org", "some-space", new Expectation(Expectation.Type.RESOURCE, "expected-configuration-entries-03.json"), }, // (3) Test that public provided dependencies from all modules are converted to configuration entries: { "mtad-09-v2.yaml", 3, "some-org", "some-space", new Expectation(Expectation.Type.RESOURCE, "expected-configuration-entries-04.json"), }, // (4) Test that the provided dependencies' properties are added in the created configuration entries: { "mtad-10-v2.yaml", 3, "some-org", "some-space", new Expectation(Expectation.Type.RESOURCE, "expected-configuration-entries-05.json"), }, // @formatter:on }); }
@Parameters public static Collection<Object[]> getParameters() { return Arrays.asList(new Object[][] { // @formatter:off // (0) Sensitive information should be detected in element keys: { "unsecured-object-00.json", Arrays.asList("pwd", "pass"), Object.class, new Expectation(Expectation.Type.RESOURCE, "secured-object-00.json"), }, // (1) Sensitive information should be detected in element keys, but there's a typo in one of the keys: { "unsecured-object-01.json", Arrays.asList("pwd", "pass"), Object.class, new Expectation(Expectation.Type.RESOURCE, "secured-object-01.json"), }, // (2) Sensitive information should be detected in element values: { "unsecured-object-02.json", Arrays.asList("pwd", "pass"), Object.class, new Expectation(Expectation.Type.RESOURCE, "secured-object-02.json"), }, // (3) Sensitive information should be detected in element values: { "unsecured-object-03.json", Arrays.asList(), DeploymentDescriptor.class, new Expectation(Expectation.Type.RESOURCE, "secured-object-03.json"), }, // (4) Sensitive information should be detected in element values: { "unsecured-object-04.json", Arrays.asList(), DeploymentDescriptor.class, new Expectation(Expectation.Type.RESOURCE, "secured-object-04.json"), }, // @formatter:on }); }
@Parameters public static Iterable<Object[]> getParameters() { return Arrays.asList(new Object[][] { // @formatter:off // (0) The required dependency is managed, so a subscription should be created: { "subscriptions-mtad-00.yaml", Arrays.asList("plugins"), "SPACE_ID_1", new Expectation(Expectation.Type.RESOURCE, "subscriptions-00.json"), }, // (1) The required dependency is not managed, so a subscription should not be created: { "subscriptions-mtad-01.yaml", Arrays.asList("plugins"), "SPACE_ID_1", new Expectation("[]"), }, // (2) The required dependency is not managed, so a subscription should not be created: { "subscriptions-mtad-02.yaml", Arrays.asList("plugins"), "SPACE_ID_1", new Expectation("[]"), }, // (3) The required dependency is not active, so a subscription should not be created: { "subscriptions-mtad-03.yaml", Arrays.asList("plugins"), "SPACE_ID_1", new Expectation("[]"), } // @formatter:on }); }
@Parameters public static Iterable<Object[]> getParameters() { return Arrays.asList(new Object[][] { // @formatter:off // (0) The required dependency is managed, so a subscription should be created: { "subscriptions-mtad-00.yaml", Arrays.asList("plugins"), "SPACE_ID_1", new Expectation(Expectation.Type.RESOURCE, "subscriptions-00.json"), }, // (1) The required dependency is not managed, so a subscription should not be created: { "subscriptions-mtad-01.yaml", Arrays.asList("plugins"), "SPACE_ID_1", new Expectation("[]"), }, // (2) The required dependency is not managed, so a subscription should not be created: { "subscriptions-mtad-02.yaml", Arrays.asList("plugins"), "SPACE_ID_1", new Expectation("[]"), }, // @formatter:on }); }
@Parameters public static Iterable<Object[]> getParameters() { return Arrays.asList(new Object[][] { // @formatter:off // (0) { "TEST_TEST_TEST", false, new Expectation("test-test-test"), }, // (1) { "test-test-test", true , new Expectation("test-test-test"), }, // (2) { "test.test.test", true , new Expectation("test.test.test"), }, // (3) { "---", false, new Expectation(Expectation.Type.EXCEPTION, "Could not create a valid domain from \"---\"") }, // (4) { "@12", false, new Expectation("12"), }, // (5) { "@@@", false, new Expectation(Expectation.Type.EXCEPTION, "Could not create a valid domain from \"@@@\"") }, // @formatter:on }); }
@Parameters public static Iterable<Object[]> getParameters() { return Arrays.asList(new Object[][] { // @formatter:off // (00) Test missing resource type definition: { "mtad-missing-resource-type-definition.yaml", "config-01.mtaext", "/mta/cf-platform-v2.json", null, false, false, new String[] { "foo" }, // mtaArchiveModules new String[] { "foo" }, // mtaModules new String[] {}, // deployedApps new Expectation("[]"), new Expectation(Expectation.Type.RESOURCE, "apps-01.json"), }, // @formatter:on }); }
@Parameters public static Iterable<Object[]> getParameters() { return Arrays.asList(new Object[][] { // @formatter:off // (0) { "TEST_TEST_TEST", false, new Expectation("test-test-test"), }, // (1) { "test-test-test", true , new Expectation("test-test-test"), }, // (2) { "---", false, new Expectation(Expectation.Type.EXCEPTION, "Could not create a valid host from \"---\"") }, // (3) { "@12", false, new Expectation("12"), }, // (4) { "@@@", false, new Expectation(Expectation.Type.EXCEPTION, "Could not create a valid host from \"@@@\"") }, // @formatter:on }); }
@Parameters public static Collection<Object[]> getParameters() { return Arrays.asList(new Object[][] { // @formatter:off { "mtad-09.yaml", "/mta/cf-platform-v2.json", new Expectation(Expectation.Type.RESOURCE, "mtad-09.yaml.json"), }, { "mtad-10.yaml", "/mta/cf-platform-v2.json", new Expectation(Expectation.Type.RESOURCE, "mtad-10.yaml.json"), }, { "mtad-11.yaml", "/mta/cf-platform-v2.json", new Expectation(Expectation.Type.RESOURCE, "mtad-11.yaml.json"), }, // @formatter:on }); }
@Parameters public static Iterable<Object[]> getParameter() { return Arrays.asList(new Object[][] { // @formatter:off // (0) { "successful-operations.json", new Expectation(Expectation.Type.RESOURCE, "good-health.json"), }, // (1) { "failed-operations.json", new Expectation(Expectation.Type.RESOURCE, "poor-health.json"), }, // @formatter:on }); }