Skip to content

Commit b43b37b

Browse files
committed
fix: update nested class replacement test to match PR #1726 design
Inner-class methods are intentionally skipped by Java discovery (PR #1726) since instrumentation is name-only and not class-aware. Update test to expect False from replacement.
1 parent 8cc86ec commit b43b37b

1 file changed

Lines changed: 2 additions & 16 deletions

File tree

tests/test_languages/test_java/test_replacement.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ class TestNestedClasses:
836836
"""Tests for nested class scenarios."""
837837

838838
def test_replace_method_in_nested_class(self, tmp_path: Path, java_support: JavaSupport):
839-
"""Test replacing a method in a nested class."""
839+
"""Nested class methods are skipped by discovery (PR #1726), so replacement returns False."""
840840
java_file = tmp_path / "Outer.java"
841841
original_code = """public class Outer {
842842
public int outerMethod() {
@@ -876,21 +876,7 @@ def test_replace_method_in_nested_class(self, tmp_path: Path, java_support: Java
876876
lang_support=java_support,
877877
)
878878

879-
assert result is True
880-
new_code = java_file.read_text(encoding="utf-8")
881-
expected = """public class Outer {
882-
public int outerMethod() {
883-
return 1;
884-
}
885-
886-
public static class Inner {
887-
public int innerMethod() {
888-
return 2 + 0;
889-
}
890-
}
891-
}
892-
"""
893-
assert new_code == expected
879+
assert result is False
894880

895881

896882
class TestPreservesStructure:

0 commit comments

Comments
 (0)