Title: HashMap with Enum as key - test generation fails · Issue #436 · UnitTestBot/UTBotJava · GitHub
Open Graph Title: HashMap with Enum as key - test generation fails · Issue #436 · UnitTestBot/UTBotJava
X Title: HashMap with Enum as key - test generation fails · Issue #436 · UnitTestBot/UTBotJava
Description: Description Test generation fails for a method with HashMap using Enum as key. To Reproduce Steps to reproduce the behavior: IntelliJ IDEA with UTBotJava plugin installed A project with JDK 8/11 is opened Add the following class: public ...
Open Graph Description: Description Test generation fails for a method with HashMap using Enum as key. To Reproduce Steps to reproduce the behavior: IntelliJ IDEA with UTBotJava plugin installed A project with JDK 8/11 is...
X Description: Description Test generation fails for a method with HashMap using Enum as key. To Reproduce Steps to reproduce the behavior: IntelliJ IDEA with UTBotJava plugin installed A project with JDK 8/11 is...
Opengraph URL: https://github.com/UnitTestBot/UTBotJava/issues/436
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"HashMap with Enum as key - test generation fails","articleBody":"**Description**\r\n\r\nTest generation fails for a method with HashMap using Enum as key.\r\n\r\n**To Reproduce**\r\n\r\nSteps to reproduce the behavior:\r\n\r\n1. IntelliJ IDEA with UTBotJava plugin installed\r\n2. A project with JDK 8/11 is opened\r\n3. Add the following class:\r\n\r\n```\r\npublic class MapWithEnum {\r\n\r\n public void createMapWithEnum() {\r\n Map\u003cWorkDays, Integer\u003e map = new HashMap\u003c\u003e();\r\n map.put(WorkDays.Monday, 112);\r\n map.put(WorkDays.Tuesday, 354);\r\n map.put(WorkDays.Friday, 567);\r\n map.remove(WorkDays.Tuesday);\r\n }\r\n\r\n public enum WorkDays {\r\n Monday,\r\n Tuesday,\r\n Wednesday,\r\n Thursday,\r\n Friday\r\n }\r\n}\r\n```\r\n\r\n4. Run Generating tests with UTBot... for this class\r\n\r\n**Expected behavior**\r\n\r\nTests are supposed to be generated.\r\n\r\n**Actual behavior**\r\n\r\n\"Failed to generate unit tests for class MapWithEnum\" error popup is shown in IDEA.\r\nIt is shown immediately after test generation is started.\r\nMap.remove() method is crucial for the issue - without it generation passes.\r\n\r\n**Visual proofs (screenshots, logs, images)**\r\n\r\n\r\n\r\n**Environment**\r\n\r\nWindows 10 Pro\r\nIntelliJ IDEA 2022.1.3\r\nchecked on JDK 8 and 11, Gradle, Maven projects - same error\r\n\r\n**Additional context**\r\n\r\nAdding some input parameters to the method helps - fuzzer is generating tests.\r\n\r\nMap.remove() method is crucial for the issue - without it generation passes.\r\n\r\nMap with Enum as values - test generation passes.","author":{"url":"https://github.com/alisevych","@type":"Person","name":"alisevych"},"datePublished":"2022-07-06T10:17:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/436/UTBotJava/issues/436"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c19c232b-a13b-7454-d5bd-4ff9fa56b859 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9A7C:739F8:D197B4:119FC7D:698D9145 |
| html-safe-nonce | e60633891f4185f2705bffe7388adfc7436c591ec92298d5b07c131b89d8aaec |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QTdDOjczOUY4OkQxOTdCNDoxMTlGQzdEOjY5OEQ5MTQ1IiwidmlzaXRvcl9pZCI6IjczMTY4Njc1NzY2OTYyNDY1OTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3c80a5ce9f3dec85dfe803948399db4261de6c1d846412e7cbf358d2f683cca0 |
| hovercard-subject-tag | issue:1295608963 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/UnitTestBot/UTBotJava/436/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5e70d77ea2f41afb774c1b05d6048f94a5a27215e749d6e073edd034b7c180f8/UnitTestBot/UTBotJava/issues/436 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5e70d77ea2f41afb774c1b05d6048f94a5a27215e749d6e073edd034b7c180f8/UnitTestBot/UTBotJava/issues/436 |
| og:image:alt | Description Test generation fails for a method with HashMap using Enum as key. To Reproduce Steps to reproduce the behavior: IntelliJ IDEA with UTBotJava plugin installed A project with JDK 8/11 is... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | alisevych |
| hostname | github.com |
| expected-hostname | github.com |
| None | c0818105fa276287e9369cfdefa0a0fa7953719791ceff9b94d69623c0a4fe8a |
| turbo-cache-control | no-preview |
| go-import | github.com/UnitTestBot/UTBotJava git https://github.com/UnitTestBot/UTBotJava.git |
| octolytics-dimension-user_id | 87413538 |
| octolytics-dimension-user_login | UnitTestBot |
| octolytics-dimension-repository_id | 480810501 |
| octolytics-dimension-repository_nwo | UnitTestBot/UTBotJava |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 480810501 |
| octolytics-dimension-repository_network_root_nwo | UnitTestBot/UTBotJava |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bd964b0594af16531b06ac03e14711206a3079aa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width