@Test void getForTheFirstTime() { SystemInformationData systemInformationData = (SystemInformationData) this.cut.getSystemSensorData(); Object firstExecution = this.cut.get(); assertThat((SystemInformationData) firstExecution, is(systemInformationData)); }
this.systemInformationData.setTimeStamp(timestamp); this.systemInformationData.setTotalPhysMemory(this.getOsBean().getTotalPhysicalMemorySize()); this.systemInformationData.setTotalSwapSpace(this.getOsBean().getTotalSwapSpaceSize()); this.systemInformationData.setAvailableProcessors(this.getOsBean().getAvailableProcessors()); this.systemInformationData.setArchitecture(this.getOsBean().getArch()); this.systemInformationData.setOsName(this.getOsBean().getName()); this.systemInformationData.setOsVersion(this.getOsBean().getVersion()); this.systemInformationData.setJitCompilerName(this.getRuntimeBean().getJitCompilerName()); this.systemInformationData.setClassPath(this.getRuntimeBean().getClassPath()); this.systemInformationData.setBootClassPath(this.getRuntimeBean().getBootClassPath()); this.systemInformationData.setLibraryPath(this.getRuntimeBean().getLibraryPath()); this.systemInformationData.setVmVendor(this.getRuntimeBean().getVmVendor()); this.systemInformationData.setVmVersion(this.getRuntimeBean().getVmVersion()); this.systemInformationData.setVmName(this.getRuntimeBean().getVmName()); this.systemInformationData.setVmSpecName(this.getRuntimeBean().getSpecName()); this.systemInformationData.setInitHeapMemorySize(this.getMemoryBean().getHeapMemoryUsage().getInit()); this.systemInformationData.setMaxHeapMemorySize(this.getMemoryBean().getHeapMemoryUsage().getMax()); this.systemInformationData.setInitNonHeapMemorySize(this.getMemoryBean().getNonHeapMemoryUsage().getInit()); this.systemInformationData.setMaxNonHeapMemorySize(this.getMemoryBean().getNonHeapMemoryUsage().getMax());
@Test void gatherForTheFirstTime() { SystemInformationData collector = (SystemInformationData) this.cut.getSystemSensorData(); collector.setSensorTypeIdent(21L); this.cut.gather(); SystemInformationData systemInformationData = (SystemInformationData) this.cut.getSystemSensorData();
@Test void gatherForTheSecondTime() { SystemInformationData collector = (SystemInformationData) this.cut.getSystemSensorData(); collector.setSensorTypeIdent(21L); this.cut.gather(); collector = (SystemInformationData) this.cut.getSystemSensorData(); when(this.memoryBean.getNonHeapMemoryUsage()).thenReturn(nonHeapMemoryUsageB); this.cut.gather(); SystemInformationData systemInformationData = (SystemInformationData) this.cut.getSystemSensorData();