Merged API-STRIKES-BACK (5.2.0) to HEAD (5.2)

127330 amukha: RA-941: V1 REST API Tests: rationalise the test startup - eg. only create test data when needed ;-)
      - Added checks to defer test data creation until it is required.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@127601 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jamal Kaabi-Mofrad
2016-06-02 22:19:19 +00:00
parent 084016b45c
commit c60406cc54
7 changed files with 53 additions and 20 deletions

View File

@@ -48,8 +48,9 @@ public abstract class AbstractTestApi
@Before
public void setupTests() throws Exception
{
this.applicationContext = getTestFixture().getApplicationContext();
this.repoService = getTestFixture().getRepoService();
TestFixture testFixture = getTestFixture(false);
this.applicationContext = testFixture.getApplicationContext();
this.repoService = testFixture.getRepoService();
this.transactionHelper = (RetryingTransactionHelper)applicationContext.getBean("retryingTransactionHelper");
HttpClientProvider httpClientProvider = (HttpClientProvider)applicationContext.getBean("httpClientProvider");
@@ -197,4 +198,9 @@ public abstract class AbstractTestApi
}
protected abstract TestFixture getTestFixture() throws Exception;
/**
* @param createTestData The created instance can optionally create test data if required
*/
protected abstract TestFixture getTestFixture(boolean createTestData) throws Exception;
}