@Test public void startupOccurred() { SystemStatusRepository systemStatusRepository = new MockSystemStatusRepository(Boolean.FALSE); DefaultSystemStatusAccessor systemStatusUtility = new DefaultSystemStatusAccessor(systemStatusRepository); systemStatusUtility.startupOccurred(); LocalDateTime estimatedDate = LocalDateTime.now(); SystemStatusEntity testSystemStatus = systemStatusRepository.findAll().get(0); LocalDateTime systemStatusLocalDateTime = testSystemStatus.getStartupTime() .toInstant() .atZone(ZoneId.systemDefault()) .toLocalDateTime(); assertFalse(testSystemStatus.isInitialConfigurationPerformed()); assertNotNull(testSystemStatus.getStartupTime()); assertEquals(estimatedDate.getHour(), systemStatusLocalDateTime.getHour()); assertEquals(estimatedDate.getMinute(), systemStatusLocalDateTime.getMinute()); }
@Override @Transactional public void startupOccurred() { SystemStatusEntity systemStatus = getSystemStatus(); SystemStatusEntity newSystemStatus = new SystemStatusEntity(systemStatus.isInitialConfigurationPerformed(), createCurrentDateTimestamp()); updateSystemStatus(newSystemStatus); }
DefaultSystemStatusAccessor implements SystemStatusAccessor { @Override @Transactional public void startupOccurred() { SystemStatusEntity systemStatus = getSystemStatus(); SystemStatusEntity newSystemStatus = new SystemStatusEntity(systemStatus.isInitialConfigurationPerformed(), createCurrentDateTimestamp()); updateSystemStatus(newSystemStatus); } }
DefaultSystemStatusAccessor implements SystemStatusAccessor { @Override @Transactional public void startupOccurred() { SystemStatusEntity systemStatus = getSystemStatus(); SystemStatusEntity newSystemStatus = new SystemStatusEntity(systemStatus.isInitialConfigurationPerformed(), createCurrentDateTimestamp()); updateSystemStatus(newSystemStatus); } @Autowired  DefaultSystemStatusAccessor(SystemStatusRepository systemStatusRepository); }
DefaultSystemStatusAccessor implements SystemStatusAccessor { @Override @Transactional public void startupOccurred() { SystemStatusEntity systemStatus = getSystemStatus(); SystemStatusEntity newSystemStatus = new SystemStatusEntity(systemStatus.isInitialConfigurationPerformed(), createCurrentDateTimestamp()); updateSystemStatus(newSystemStatus); } @Autowired  DefaultSystemStatusAccessor(SystemStatusRepository systemStatusRepository); @Override @Transactional boolean isSystemInitialized(); @Override @Transactional void setSystemInitialized(boolean systemInitialized); @Override @Transactional void startupOccurred(); @Override @Transactional OffsetDateTime getStartupTime(); }
DefaultSystemStatusAccessor implements SystemStatusAccessor { @Override @Transactional public void startupOccurred() { SystemStatusEntity systemStatus = getSystemStatus(); SystemStatusEntity newSystemStatus = new SystemStatusEntity(systemStatus.isInitialConfigurationPerformed(), createCurrentDateTimestamp()); updateSystemStatus(newSystemStatus); } @Autowired  DefaultSystemStatusAccessor(SystemStatusRepository systemStatusRepository); @Override @Transactional boolean isSystemInitialized(); @Override @Transactional void setSystemInitialized(boolean systemInitialized); @Override @Transactional void startupOccurred(); @Override @Transactional OffsetDateTime getStartupTime(); static final Long SYSTEM_STATUS_ID; }