Title: Unit test firestore: Mocking DocumentReference and CollectionReference · Issue #3263 · googleapis/google-cloud-java · GitHub
Open Graph Title: Unit test firestore: Mocking DocumentReference and CollectionReference · Issue #3263 · googleapis/google-cloud-java
X Title: Unit test firestore: Mocking DocumentReference and CollectionReference · Issue #3263 · googleapis/google-cloud-java
Description: We are trying to test classes with dependencies on firestore and we found we cannot mock these classes because their constructors are internal. Is it possible if the following methods return interfaces instead of classes: val collectionR...
Open Graph Description: We are trying to test classes with dependencies on firestore and we found we cannot mock these classes because their constructors are internal. Is it possible if the following methods return interf...
X Description: We are trying to test classes with dependencies on firestore and we found we cannot mock these classes because their constructors are internal. Is it possible if the following methods return interf...
Opengraph URL: https://github.com/googleapis/google-cloud-java/issues/3263
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unit test firestore: Mocking DocumentReference and CollectionReference","articleBody":"We are trying to test classes with dependencies on firestore and we found we cannot mock these classes because their constructors are internal. Is it possible if the following methods return interfaces instead of classes: \r\n\r\nval collectionReference:CollectionReference = db.collection(collectionName)\r\nval document: DocumentReference = collectionReference.document(docId)","author":{"url":"https://github.com/einevea","@type":"Person","name":"einevea"},"datePublished":"2018-05-14T09:53:59.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/3263/google-cloud-java/issues/3263"}
| 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:0bb269f1-7f13-c30b-d6f7-d5a661a73a51 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D5D2:3BF792:145D1BD:1BAA128:6A4D7485 |
| html-safe-nonce | 8f07ace81cdccf7e0aefb87a5d7c001dbcf2e569dedcdd68d2534b4216386856 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENUQyOjNCRjc5MjoxNDVEMUJEOjFCQUExMjg6NkE0RDc0ODUiLCJ2aXNpdG9yX2lkIjoiMjg4NjQ1NDY1MTYyMzY2NjgyMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a111005b8d5ec3ffcb84bb15897aec6e2a75a59d88ed4ee712d16bbcd4f5b846 |
| hovercard-subject-tag | issue:322746872 |
| 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/googleapis/google-cloud-java/3263/issue_layout |
| twitter:image | https://opengraph.githubassets.com/109c6605fc018be0ddd6f389047b495b4c074f12add147471747df010a3c6395/googleapis/google-cloud-java/issues/3263 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/109c6605fc018be0ddd6f389047b495b4c074f12add147471747df010a3c6395/googleapis/google-cloud-java/issues/3263 |
| og:image:alt | We are trying to test classes with dependencies on firestore and we found we cannot mock these classes because their constructors are internal. Is it possible if the following methods return interf... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | einevea |
| hostname | github.com |
| expected-hostname | github.com |
| None | c78260c7b3f4ac4b0356c8208537f05406a3a2d46a9ec3f735b372dcc519c39e |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/google-cloud-java git https://github.com/googleapis/google-cloud-java.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 26181278 |
| octolytics-dimension-repository_nwo | googleapis/google-cloud-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 26181278 |
| octolytics-dimension-repository_network_root_nwo | googleapis/google-cloud-java |
| 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 | 399fff412f48461d435721c009efc17ea44be72f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width