Title: Compare returning expected and actual Stream · Issue #1046 · UnitTestBot/UTBotJava · GitHub
Open Graph Title: Compare returning expected and actual Stream · Issue #1046 · UnitTestBot/UTBotJava
X Title: Compare returning expected and actual Stream · Issue #1046 · UnitTestBot/UTBotJava
Description: Description Tests on methods returning Stream contain actual and expected results, but do not have any assertions to compare them. To Reproduce Run the 'UTBotJava' project in IntelliJ Idea 2022.1.4 Install one of the latest from main bra...
Open Graph Description: Description Tests on methods returning Stream contain actual and expected results, but do not have any assertions to compare them. To Reproduce Run the 'UTBotJava' project in IntelliJ Idea 2022.1.4...
X Description: Description Tests on methods returning Stream contain actual and expected results, but do not have any assertions to compare them. To Reproduce Run the 'UTBotJava' project in IntelliJ Idea ...
Opengraph URL: https://github.com/UnitTestBot/UTBotJava/issues/1046
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Compare returning expected and actual Stream","articleBody":"**Description**\r\n\r\nTests on methods returning Stream contain actual and expected results, but do not have any assertions to compare them.\r\n\r\n**To Reproduce**\r\n\r\n1. Run the 'UTBotJava' project in IntelliJ Idea 2022.1.4\r\n2. Install one of the latest from main branch\r\n3. Open test generation dialog for utbot-sample/src/main/java/org/utbot/examples/stream/BaseStreamExample.java\r\n4. Select returningStreamExample method\r\n5. click Generate Tests\r\n6. check generated tests\r\n\r\n**Expected behavior**\r\n\r\nNeed to compare expected and actual results for Streams in tests.\r\n\r\n**Actual behavior**\r\n\r\nThere are actual and expected Objects generated containing Streams. But they are not compared.\r\n\r\n**Visual proofs (screenshots, logs, images)**\r\n\r\n~~~java\r\npackage org.utbot.examples.stream;\r\n\r\nimport org.junit.jupiter.api.Test;\r\nimport org.junit.jupiter.api.DisplayName;\r\n\r\nimport java.util.ArrayList;\r\nimport java.util.List;\r\n\r\nimport static org.utbot.runtime.utils.UtUtils.createInstance;\r\n\r\npublic class BaseStreamExampleTest {\r\n ///region Test suites for executable org.utbot.examples.stream.BaseStreamExample.returningStreamExample\r\n\r\n ///region SYMBOLIC EXECUTION ENGINE: SUCCESSFUL EXECUTIONS for method returningStreamExample(java.util.List)\r\n\r\n /**\r\n * @utbot.classUnderTest {@link BaseStreamExample}\r\n * @utbot.methodUnderTest {@link BaseStreamExample#returningStreamExample(List)}\r\n * @utbot.executesCondition {@code (list.isEmpty()): True}\r\n * @utbot.invokes {@code {@link List#stream()}}\r\n * @utbot.returnsFrom {@code return list.stream();}\r\n */\r\n @Test\r\n @DisplayName(\"returningStreamExample: list.isEmpty() : True -\u003e return list.stream()\")\r\n public void testReturningStreamExample_ListIsEmpty() throws Exception {\r\n BaseStreamExample baseStreamExample = new BaseStreamExample();\r\n ArrayList list = new ArrayList();\r\n\r\n Object actual = baseStreamExample.returningStreamExample(list);\r\n\r\n Object expected = createInstance(\"java.util.stream.ReferencePipeline$Head\");\r\n }\r\n\r\n /**\r\n * @utbot.classUnderTest {@link BaseStreamExample}\r\n * @utbot.methodUnderTest {@link BaseStreamExample#returningStreamExample(List)}\r\n * @utbot.executesCondition {@code (list.isEmpty()): False}\r\n * @utbot.invokes {@code {@link List#stream()}}\r\n * @utbot.returnsFrom {@code return list.stream();}\r\n */\r\n @Test\r\n @DisplayName(\"returningStreamExample: list.isEmpty() : False -\u003e return list.stream()\")\r\n public void testReturningStreamExample_NotListIsEmpty() throws Exception {\r\n BaseStreamExample baseStreamExample = new BaseStreamExample();\r\n ArrayList list = new ArrayList();\r\n list.add(null);\r\n list.add(null);\r\n list.add(null);\r\n list.add(null);\r\n list.add(null);\r\n list.add(null);\r\n list.add(null);\r\n list.add(null);\r\n list.add(null);\r\n list.add(null);\r\n\r\n Object actual = baseStreamExample.returningStreamExample(list);\r\n\r\n Object expected = createInstance(\"java.util.stream.ReferencePipeline$Head\");\r\n }\r\n ///endregion\r\n\r\n ///endregion\r\n}\r\n~~~\r\n\r\n**Environment**\r\n\r\nWindows 10 Pro\r\nGradle\r\nJDK 11\r\n\r\n**Additional context**\r\n\r\nProbably related to #1034\r\n\r\nSame for DoubleStreamExample.returningStreamExample","author":{"url":"https://github.com/alisevych","@type":"Person","name":"alisevych"},"datePublished":"2022-09-30T15:02:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/1046/UTBotJava/issues/1046"}
| 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:3ecb73e5-5578-dded-4bf5-0edb358fdc91 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AD2C:94B0F:4E38DA:6781CE:698D3D9A |
| html-safe-nonce | 2e50aeb66854c47df1088ebbe9936b029ec667a1ebfdb143cd028e9cfc03c275 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRDJDOjk0QjBGOjRFMzhEQTo2NzgxQ0U6Njk4RDNEOUEiLCJ2aXNpdG9yX2lkIjoiMTQxMTc5OTEyNjg0MDc4NjMzMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9832085f5c3135997416aa5932d626ae086a3af91e0262eb5dcc12e92e3aa190 |
| hovercard-subject-tag | issue:1392576667 |
| 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/1046/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3039ccf17091ec05ff23a7938887d853700c769ae8076a77cf4937363e762a0f/UnitTestBot/UTBotJava/issues/1046 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3039ccf17091ec05ff23a7938887d853700c769ae8076a77cf4937363e762a0f/UnitTestBot/UTBotJava/issues/1046 |
| og:image:alt | Description Tests on methods returning Stream contain actual and expected results, but do not have any assertions to compare them. To Reproduce Run the 'UTBotJava' project in IntelliJ Idea 2022.1.4... |
| 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 | bc912d4349851e5f32c76bbb213754e40947d7a6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width