public PlatformAPI getPlatformAPI() { if (this.platformAPI == null) { PlatformLoginAPI platformLoginAPI; try { platformLoginAPI = PlatformAPIAccessor.getPlatformLoginAPI(); final PlatformSession platformSession = platformLoginAPI.login(PLATFORM_ADMIN, PLATFORM_PASSWORD); this.platformAPI = PlatformAPIAccessor.getPlatformAPI(platformSession); } catch (final BonitaHomeNotSetException e) { throw new TestToolkitException("Bonita home isn't set", e); } catch (final ServerAPIException e) { throw new TestToolkitException("Failed to call server API", e); } catch (final UnknownAPITypeException e) { throw new TestToolkitException("Invalid session to create tenant", e); } catch (final PlatformLoginException e) { throw new TestToolkitException("Invalid session to create tenant", e); } catch (final InvalidSessionException e) { throw new TestToolkitException("Invalid session to create tenant", e); } } return this.platformAPI; }