RM-4159 Ensure there's exactly one RMRestWrapper.

Use @PostConstruct to fix the hierarchy after initialisation.
This commit is contained in:
Tom Page
2017-03-13 08:14:48 +00:00
parent 4a02f3970b
commit fe45e852f5
2 changed files with 11 additions and 6 deletions

View File

@@ -67,6 +67,11 @@ public class RestAPIFactory
return this.rmRestWrapper;
}
public void setRmRestWrapper(RMRestWrapper rmRestWrapper)
{
this.rmRestWrapper = rmRestWrapper;
}
private RestIGCoreAPI getRestIGCoreAPI(UserModel userModel)
{
getRmRestWrapper().authenticateUser(userModel != null ? userModel : dataUser.getAdminUser());

View File

@@ -100,7 +100,7 @@ public class BaseRMRestTest extends RestTest
*/
protected void assertStatusCode(HttpStatus statusCode)
{
getRestAPIFactory().getRmRestWrapper().assertStatusCodeIs(statusCode);
restAPIFactory.getRmRestWrapper().assertStatusCodeIs(statusCode);
}
/**
@@ -145,7 +145,7 @@ public class BaseRMRestTest extends RestTest
*/
public void createRMSiteIfNotExists() throws Exception
{
RMSiteAPI rmSiteAPI = getRestAPIFactory().getRMSiteAPI();
RMSiteAPI rmSiteAPI = restAPIFactory.getRMSiteAPI();
// Check RM site doesn't exist
if (!rmSiteAPI.existsRMSite())