Merged 5.2.N (5.2.1) to HEAD (5.2)

129172 mmuller: Merged RETURN-OF-THE-API (5.2.0) to 5.2.N (5.2.1)
      128561 jvonka: V1 REST API: Api Test cleanup and rationalisation (re: helper methods / runAs user / admin) - round 1b
      - follow-on to fix test fallout
      REPO-113


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@129346 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alexandru Epure
2016-08-09 14:13:20 +00:00
parent e44796d1ec
commit 6084cc72b5
3 changed files with 36 additions and 16 deletions

View File

@@ -118,7 +118,7 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
protected String user1;
protected String user2;
private List<String> users = new ArrayList<>();
protected List<String> users = new ArrayList<>();
protected MutableAuthenticationService authenticationService;
protected PersonService personService;
@@ -133,8 +133,8 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
personService = applicationContext.getBean("personService", PersonService.class);
// note: createUser currently relies on repoService
user1 = createUser("user1-" + RUNID);
user2 = createUser("user2-" + RUNID);
user1 = createUser("user1-" + RUNID, "user1Password");
user2 = createUser("user2-" + RUNID, "user2Password");
// to enable admin access via test calls - eg. after clean/purge
getOrCreateUser("admin", "admin");
@@ -154,7 +154,10 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
@After
public void tearDown() throws Exception
{
deleteSite(networkOne.getId(), userOneN1.getId(), userOneN1Site.getSiteId(), 204);
if ((networkOne != null) && (userOneN1 != null) && (userOneN1Site != null))
{
deleteSite(networkOne.getId(), userOneN1.getId(), userOneN1Site.getSiteId(), 204);
}
AuthenticationUtil.setAdminUserAsFullyAuthenticatedUser();
for (final String user : users)