@Bean @ConditionalOnMissingBean(SystemInfo.class) public SystemInfo systemInfo() { return SystemInfo.systemInfo(hostname(), port); }
public static SystemInfo systemInfo(final String hostname, final int port) { return new SystemInfo(hostname, port); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ApplicationStatus that = (ApplicationStatus) o; if (application != null ? !application.equals(that.application) : that.application != null) return false; if (system != null ? !system.equals(that.system) : that.system != null) return false; if (vcs != null ? !vcs.equals(that.vcs) : that.vcs != null) return false; if (team != null ? !team.equals(that.team) : that.team != null) return false; if (status != that.status) return false; if (statusDetails != null ? !statusDetails.equals(that.statusDetails) : that.statusDetails != null) return false; if (serviceSpecs != null ? !serviceSpecs.equals(that.serviceSpecs) : that.serviceSpecs != null) return false; return true; }
private JobInfo createJobInfo(final String jobType) { return newJobInfo(uuidProvider.getUuid(), jobType, clock, systemInfo.getHostname()); }
@Override public int hashCode() { int result = application != null ? application.hashCode() : 0; result = 31 * result + (system != null ? system.hashCode() : 0); result = 31 * result + (vcs != null ? vcs.hashCode() : 0); result = 31 * result + (team != null ? team.hashCode() : 0); result = 31 * result + (status != null ? status.hashCode() : 0); result = 31 * result + (statusDetails != null ? statusDetails.hashCode() : 0); result = 31 * result + (serviceSpecs != null ? serviceSpecs.hashCode() : 0); return result; }
@Bean @ConditionalOnMissingBean(SystemInfo.class) public SystemInfo systemInfo() { return SystemInfo.systemInfo(hostname(), port); }
public static SystemInfo systemInfo(final String hostname, final int port) { return new SystemInfo(hostname, port); }
@BeforeEach @SuppressWarnings("unchecked") public void setUp() throws Exception { initMocks(this); this.systemInfo = systemInfo(HOSTNAME, 8080); this.clock = fixed(now(), systemDefault()); doAnswer(new RunImmediately()) .when(executorService) .execute(any(Runnable.class)); when(executorService.scheduleAtFixedRate(any(Runnable.class), anyLong(), anyLong(), any(TimeUnit.class))) .thenReturn(mock(ScheduledFuture.class)); when(jobRunnable.getJobDefinition()) .thenReturn(manuallyTriggerableJobDefinition("someType", "bla", "bla", 0, Optional.empty())); when(uuidProviderMock.getUuid()) .thenReturn(JOB_ID); jobService = new JobService( jobRepository, jobMetaService, singletonList(jobRunnable), executorService, applicationEventPublisher, clock, systemInfo, uuidProviderMock); jobService.postConstruct(); }