Skip to content

Commit ef82719

Browse files
committed
Fix memory comparison in ProcessInfoTests
Closes gh-43926
1 parent 1e35a0b commit ef82719

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/info/ProcessInfoTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -43,13 +43,13 @@ void processInfoIsAvailable() {
4343
void memoryInfoIsAvailable() {
4444
ProcessInfo processInfo = new ProcessInfo();
4545
MemoryUsageInfo heapUsageInfo = processInfo.getMemory().getHeap();
46-
MemoryUsageInfo nonHeapUsageInfo = processInfo.getMemory().getNonHeap();
4746
assertThat(heapUsageInfo.getInit()).isPositive().isLessThanOrEqualTo(heapUsageInfo.getMax());
4847
assertThat(heapUsageInfo.getUsed()).isPositive().isLessThanOrEqualTo(heapUsageInfo.getCommitted());
4948
assertThat(heapUsageInfo.getCommitted()).isPositive().isLessThanOrEqualTo(heapUsageInfo.getMax());
5049
assertThat(heapUsageInfo.getMax()).isPositive();
50+
MemoryUsageInfo nonHeapUsageInfo = processInfo.getMemory().getNonHeap();
5151
assertThat(nonHeapUsageInfo.getInit()).isPositive();
52-
assertThat(nonHeapUsageInfo.getUsed()).isPositive().isLessThanOrEqualTo(heapUsageInfo.getCommitted());
52+
assertThat(nonHeapUsageInfo.getUsed()).isPositive().isLessThanOrEqualTo(nonHeapUsageInfo.getCommitted());
5353
assertThat(nonHeapUsageInfo.getCommitted()).isPositive();
5454
assertThat(nonHeapUsageInfo.getMax()).isEqualTo(-1);
5555
}

0 commit comments

Comments
 (0)