Skip to content

Commit ea5ffc2

Browse files
committed
FINERACT-5706: Add unit tests for IpAddressUtils
Signed-off-by: Shlesha <shlesha04@gmail.com>
1 parent bbece9c commit ea5ffc2

File tree

2 files changed

+4
-147
lines changed

2 files changed

+4
-147
lines changed

fineract-core/src/test/java/org/apache/fineract/infrastructure/core/service/IpAddressUtilsTest.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
* Unless required by applicable law or agreed to in writing,
1313
* software distributed under the License is distributed on an
1414
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15-
* KIND, either express or implied. See the License for the
16-
* specific language governing permissions and limitations
17-
* under the License.
15+
* KIND, either express or implied.
1816
*/
1917
package org.apache.fineract.infrastructure.core.service;
2018

@@ -34,14 +32,14 @@ void clearContext() {
3432
RequestContextHolder.resetRequestAttributes();
3533
}
3634

37-
// Proper isolation helper
35+
// Helper method for setting request context
3836
private void withRequest(HttpServletRequest request, Runnable testLogic) {
3937
ServletRequestAttributes attributes = new ServletRequestAttributes(request);
4038
try {
4139
RequestContextHolder.setRequestAttributes(attributes);
4240
testLogic.run();
4341
} finally {
44-
RequestContextHolder.resetRequestAttributes(); // critical cleanup
42+
RequestContextHolder.resetRequestAttributes();
4543
}
4644
}
4745

@@ -86,4 +84,4 @@ void getClientIpConvertsNonStringAttributeUsingToString() {
8684
assertEquals("12345", result);
8785
});
8886
}
89-
}
87+
}

fineract-core/src/test/java/org/apache/fineract/infrastructure/core/service/MathUtilTest.java

Lines changed: 0 additions & 141 deletions
This file was deleted.

0 commit comments

Comments
 (0)