### Question:
GlobalConfChecker { @Scheduled(fixedRate = JOB_REPEAT_INTERVAL_MS, initialDelay = INITIAL_DELAY_MS) @Transactional public void updateServerConf() { if (SLAVE.equals(SystemProperties.getServerNodeType())) { log.debug("This is a slave node - skip globalconf updates"); return; } if (restoreInProgress) { log.debug("Backup restore in progress - skipping globalconf update"); return; } try { log.debug("Check globalconf for updates"); checkGlobalConf(); } catch (Exception e) { log.error("Checking globalconf for updates failed", e); throw e; } } @Autowired  GlobalConfChecker(GlobalConfCheckerHelper globalConfCheckerHelper, GlobalConfFacade globalConfFacade,
            SignerProxyFacade signerProxyFacade); @Scheduled(fixedRate = JOB_REPEAT_INTERVAL_MS, initialDelay = INITIAL_DELAY_MS) @Transactional void updateServerConf(); static final int JOB_REPEAT_INTERVAL_MS; static final int INITIAL_DELAY_MS; }### Answer:
@Test public void updateLocalClientStatus() throws Exception { when(globalConfFacade.isSecurityServerClient(OWNER_MEMBER, SS_ID)).thenReturn(true); assertEquals(OWNER_MEMBER.toString(), serverConfService.getSecurityServerOwnerId().toString()); ClientType owner = clientService.getLocalClient(OWNER_MEMBER); assertEquals(ClientType.STATUS_REGISTERED, owner.getClientStatus()); ClientType subsystem = clientService.getLocalClient(SUBSYSTEM); assertEquals(ClientType.STATUS_REGISTERED, subsystem.getClientStatus()); globalConfChecker.updateServerConf(); assertEquals(OWNER_MEMBER.toString(), serverConfService.getSecurityServerOwnerId().toString()); assertEquals(ClientType.STATUS_REGISTERED, owner.getClientStatus()); assertEquals(ClientType.STATUS_GLOBALERR, subsystem.getClientStatus()); when(globalConfFacade.isSecurityServerClient(SUBSYSTEM, SS_ID)).thenReturn(true); globalConfChecker.updateServerConf(); assertEquals(ClientType.STATUS_REGISTERED, subsystem.getClientStatus()); }
@Test public void registerMemberAndChangeSecurityServerOwner() throws Exception { assertEquals(OWNER_MEMBER.toString(), serverConfService.getSecurityServerOwnerId().toString()); ClientType clientType = clientService.addLocalClient(NEW_OWNER_MEMBER.getMemberClass(), NEW_OWNER_MEMBER.getMemberCode(), NEW_OWNER_MEMBER.getSubsystemCode(), IsAuthentication.SSLAUTH, false); assertEquals(ClientType.STATUS_SAVED, clientType.getClientStatus()); clientService.registerClient(NEW_OWNER_MEMBER); assertEquals(ClientType.STATUS_REGINPROG, clientType.getClientStatus()); when(globalConfFacade.isSecurityServerClient(any(), any())).thenReturn(true); globalConfChecker.updateServerConf(); assertEquals(ClientType.STATUS_REGISTERED, clientType.getClientStatus()); assertEquals(OWNER_MEMBER.toString(), serverConfService.getSecurityServerOwnerId().toString()); when(globalConfFacade.getServerOwner(SS_ID)).thenReturn(null); when(globalConfFacade.getServerOwner(NEW_SS_ID)).thenReturn(NEW_OWNER_MEMBER); when(globalConfFacade.getServerId(any())).thenReturn(NEW_SS_ID); globalConfChecker.updateServerConf(); assertEquals(NEW_OWNER_MEMBER.toString(), serverConfService.getSecurityServerOwnerId().toString()); }