### Question:
PermissionsBuilderAccessor { static void reloadPropertiesIfInDebug(SecurityProperties securityProperties, PlatformManagementUtils platformManagementUtils) throws LoginFailedException { if (securityProperties.isAPIAuthorizationsCheckInDebugMode()) { try { platformManagementUtils.initializePlatformConfiguration(); } catch (BonitaException | IOException e) { throw new LoginFailedException("Properties are in debug mode, unable to reload configuration", e); } } }  static PermissionsBuilder createPermissionBuilder(final APISession session);  }### Answer:
@Test public void should_reloadPropertiesIfInDebug_reload_properties_when_in_debug() throws Exception { doReturn(true).when(securityProperties).isAPIAuthorizationsCheckInDebugMode(); PermissionsBuilderAccessor.reloadPropertiesIfInDebug(securityProperties, platformManagementUtils); verify(platformManagementUtils).initializePlatformConfiguration(); }
@Test public void should_reloadPropertiesIfInDebug_do_not_reload_properties_when_not_in_debug() throws Exception { doReturn(false).when(securityProperties).isAPIAuthorizationsCheckInDebugMode(); PermissionsBuilderAccessor.reloadPropertiesIfInDebug(securityProperties, platformManagementUtils); verify(platformManagementUtils, never()).initializePlatformConfiguration(); }
@Test public void should_reloadPropertiesIfInDebug_handles_exception() throws Exception { doReturn(true).when(securityProperties).isAPIAuthorizationsCheckInDebugMode(); doThrow(IOException.class).when(platformManagementUtils).initializePlatformConfiguration(); expectedException.expect(LoginFailedException.class); expectedException.expectMessage("debug mode"); PermissionsBuilderAccessor.reloadPropertiesIfInDebug(securityProperties, platformManagementUtils); }