diff --git a/lang/java/compiler/src/main/java/org/apache/avro/compiler/specific/SpecificCompiler.java b/lang/java/compiler/src/main/java/org/apache/avro/compiler/specific/SpecificCompiler.java index d1b594f79f5..295949313d1 100644 --- a/lang/java/compiler/src/main/java/org/apache/avro/compiler/specific/SpecificCompiler.java +++ b/lang/java/compiler/src/main/java/org/apache/avro/compiler/specific/SpecificCompiler.java @@ -406,7 +406,8 @@ OutputFile compileInterface(Protocol protocol) { return outputFile; } - private String makePath(String name, String space) { + //package private for testing purposes + String makePath(String name, String space) { if (space == null || space.isEmpty()) { return name + suffix; } else { diff --git a/lang/java/ipc/src/test/java/org/apache/avro/compiler/specific/TestSpecificCompiler.java b/lang/java/ipc/src/test/java/org/apache/avro/compiler/specific/TestSpecificCompiler.java index 7710be8ac21..28aa9981a34 100644 --- a/lang/java/ipc/src/test/java/org/apache/avro/compiler/specific/TestSpecificCompiler.java +++ b/lang/java/ipc/src/test/java/org/apache/avro/compiler/specific/TestSpecificCompiler.java @@ -79,8 +79,9 @@ public void testEsc() { @Test public void testMakePath() { - assertEquals("foo/bar/Baz.java".replace("/", File.separator), SpecificCompiler.makePath("Baz", "foo.bar")); - assertEquals("baz.java", SpecificCompiler.makePath("baz", "")); + SpecificCompiler compiler = new SpecificCompiler(); + assertEquals("foo/bar/Baz.java".replace("/", File.separator), compiler.makePath("Baz", "foo.bar")); + assertEquals("baz.java", compiler.makePath("baz", "")); } @Test