GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — JDK17: UtBot tries to mock unexported packages and creates uncompilable tests · Issue #2070 · UnitTestBot/UTBotJava Open Labels comp-codegenIssue is related to code generatorIssue is related to code generatorctg-bugIssue is a bugIssue is a bug DescriptionDescription On sample code which works with network UtBot tries to create To Reproduce Steps to reproduce the behavior: import java.io.IOException; import java.net.InetSocketAddress; import java.net.Socket; ... public int connect(Socket socket) throws IOException { socket.connect(new InetSocketAddress("0.0.0.0", 22)); return 0; }
Expected behavior Generated test are compilable. Actual behavior Generated test is not compilable, because uses internal JDK class @Test(description = "connect: -> return 0") public void testConnect_ReturnZero() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, IOException { org.mockito.MockedStatic mockedStatic = null; try { mockedStatic = mockStatic(sun.net.util.IPAddressUtil.class); (mockedStatic.when(() -> sun.net.util.IPAddressUtil.digit(anyChar(), anyInt()))).thenReturn(0); byte[] byteArray = new byte[16]; (mockedStatic.when(() -> sun.net.util.IPAddressUtil.validateNumericFormatV4(any()))).thenReturn(byteArray); ... Visual proofs (screenshots, logs, images) Additional context It seems we have two options to resolve that problem:
Activity
MetadataMetadataAssigneesLabelscomp-codegenIssue is related to code generatorIssue is related to code generatorctg-bugIssue is a bugIssue is a bug TypeProjects
MilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |