From 979a74e07f8c27abdb6ac9716fb8089a44428e35 Mon Sep 17 00:00:00 2001 From: Andrei Forascu Date: Fri, 18 May 2018 15:06:59 +0100 Subject: [PATCH] REPO-3294: 6.0: Module Compatibility Tests --- .../rest/discovery/DiscoveryTests.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/e2e-test/java/org/alfresco/rest/discovery/DiscoveryTests.java b/e2e-test/java/org/alfresco/rest/discovery/DiscoveryTests.java index 66b7329fc..4c0244e99 100644 --- a/e2e-test/java/org/alfresco/rest/discovery/DiscoveryTests.java +++ b/e2e-test/java/org/alfresco/rest/discovery/DiscoveryTests.java @@ -1,5 +1,11 @@ package org.alfresco.rest.discovery; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; + +import java.util.Collections; +import java.util.List; + import org.alfresco.rest.RestTest; import org.alfresco.rest.core.RestResponse; import org.alfresco.rest.model.RestDiscoveryModel; @@ -47,4 +53,30 @@ public class DiscoveryTests extends RestTest response.getRepository().getEdition().equals(edition); response.getRepository().getStatus().assertThat().field("isReadOnly").is(false); } + + @Test(groups = { TestGroup.REST_API, TestGroup.DISCOVERY, TestGroup.ALL_AMPS, TestGroup.SANITY }) + @TestRail(section = { TestGroup.REST_API, TestGroup.DISCOVERY }, executionType = ExecutionType.SANITY, + description = "Sanity tests for GET /discovery endpoint") + public void getRepositoryInstalledModules() throws Exception + { + // Get repository info using Discovery API + restClient.authenticateUser(userModel).withDiscoveryAPI().getRepositoryInfo(); + restClient.assertStatusCodeIs(HttpStatus.OK); + + // Check that all modules are present + List modules = restClient.onResponse().getResponse().jsonPath().getList("entry.repository.modules.id", String.class); + assertTrue(modules.contains("alfresco-aos-module")); + assertTrue(modules.contains("org.alfresco.integrations.google.docs")); + assertTrue(modules.contains("org_alfresco_integrations_S3Connector")); + assertTrue(modules.contains("org_alfresco_module_xamconnector")); + assertTrue(modules.contains("org.alfresco.module.KofaxAddon")); + assertTrue(modules.contains("alfresco-content-connector-for-salesforce-repo")); + assertTrue(modules.contains("alfresco-share-services")); + assertTrue(modules.contains("alfresco-saml-repo")); + assertTrue(modules.contains("org_alfresco_device_sync_repo")); + + // Check that all installed modules are in INSTALLED state + List modulesStates = restClient.onResponse().getResponse().jsonPath().getList("entry.repository.modules.installState", String.class); + assertEquals(Collections.frequency(modulesStates, "INSTALLED"), 9); + } }