[PR #6423] [MERGED] Add comprehensive tests for Import Parsers and UuidManager #37070

Closed
opened 2026-04-21 04:08:48 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/6423
Author: @SaintPatrck
Created: 1/28/2026
Status: Merged
Merged: 1/28/2026
Merged by: @SaintPatrck

Base: mainHead: test/critical/import-parsers


📝 Commits (9)

  • bd716a1 Add comprehensive tests for Import Parsers and UuidManager
  • cff9f7e Refactor export parser tests to assert complete result objects
  • fad2268 Move UuidManager to core module for cross-module usage
  • 267bb51 Clean up TwoFasExportParserTest error assertion
  • 8c14577 Clean up BitwardenExportParserTest error assertion
  • ea43bc7 Refactor import parser tests
  • a992367 Last of the assertion misses
  • 4fe586d Update aegis test
  • 16e5034 Update 2fas test

📊 Changes

14 files changed (+4598 additions, -20 deletions)

View changed files

📝 authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/manager/di/PlatformManagerModule.kt (+11 -1)
📝 authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/manager/imports/ImportManagerImpl.kt (+5 -3)
📝 authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/manager/imports/parsers/AegisExportParser.kt (+6 -4)
📝 authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/manager/imports/parsers/LastPassExportParser.kt (+5 -3)
📝 authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/manager/imports/parsers/TwoFasExportParser.kt (+6 -4)
📝 authenticator/src/test/kotlin/com/bitwarden/authenticator/data/platform/manager/imports/ImportManagerTest.kt (+4 -0)
authenticator/src/test/kotlin/com/bitwarden/authenticator/data/platform/manager/imports/parsers/AegisExportParserTest.kt (+1010 -0)
authenticator/src/test/kotlin/com/bitwarden/authenticator/data/platform/manager/imports/parsers/BitwardenExportParserTest.kt (+1212 -0)
authenticator/src/test/kotlin/com/bitwarden/authenticator/data/platform/manager/imports/parsers/LastPassExportParserTest.kt (+1028 -0)
authenticator/src/test/kotlin/com/bitwarden/authenticator/data/platform/manager/imports/parsers/TwoFasExportParserTest.kt (+1278 -0)
📝 authenticator/src/test/kotlin/com/bitwarden/authenticator/ui/platform/feature/debugmenu/manager/DebugLaunchManagerTest.kt (+6 -3)
📝 authenticator/src/test/kotlin/com/bitwarden/authenticator/ui/platform/feature/rootnav/RootNavScreenTest.kt (+2 -2)
core/src/main/kotlin/com/bitwarden/core/data/manager/UuidManager.kt (+13 -0)
core/src/main/kotlin/com/bitwarden/core/data/manager/UuidManagerImpl.kt (+12 -0)

📄 Description

🎟️ Tracking

Test coverage improvements for critical import functionality.

📔 Objective

This PR adds comprehensive unit tests for the import parser system and UuidManager. The test coverage includes:

  • AegisExportParser: Full test suite covering JSON parsing, vault structure, and TOTP algorithm variations
  • BitwardenExportParser: Complete validation of Bitwarden export format parsing
  • LastPassExportParser: Test coverage for LastPass CSV format import handling
  • TwoFasExportParser: Comprehensive tests for 2FAS JSON format processing
  • UuidManager: Test suite for UUID generation and management

These tests ensure the import system correctly handles various export formats, validates data integrity, and properly manages error cases. The parsers are critical components for data migration and must maintain strict correctness guarantees.

📸 Screenshots

N/A - Test-only changes

Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/6423 **Author:** [@SaintPatrck](https://github.com/SaintPatrck) **Created:** 1/28/2026 **Status:** ✅ Merged **Merged:** 1/28/2026 **Merged by:** [@SaintPatrck](https://github.com/SaintPatrck) **Base:** `main` ← **Head:** `test/critical/import-parsers` --- ### 📝 Commits (9) - [`bd716a1`](https://github.com/bitwarden/android/commit/bd716a179465bec73985569289bf262745081a8c) Add comprehensive tests for Import Parsers and UuidManager - [`cff9f7e`](https://github.com/bitwarden/android/commit/cff9f7e85a24a7e0a0f67ec63c7262db15d1927f) Refactor export parser tests to assert complete result objects - [`fad2268`](https://github.com/bitwarden/android/commit/fad226897a96ffe09f8194aa6f7b8eb764a6344b) Move UuidManager to core module for cross-module usage - [`267bb51`](https://github.com/bitwarden/android/commit/267bb5155f33799ab18d93d738074c7b07a86034) Clean up TwoFasExportParserTest error assertion - [`8c14577`](https://github.com/bitwarden/android/commit/8c14577b820d921a37676e71f70e771f2e719045) Clean up BitwardenExportParserTest error assertion - [`ea43bc7`](https://github.com/bitwarden/android/commit/ea43bc793840d19040da88492714d3c24c3b0e5b) Refactor import parser tests - [`a992367`](https://github.com/bitwarden/android/commit/a99236731140dd7eb4a610a50d23b3d2e6dae854) Last of the assertion misses - [`4fe586d`](https://github.com/bitwarden/android/commit/4fe586d4667859180e8e5cd27f3d90d4b2966c2b) Update aegis test - [`16e5034`](https://github.com/bitwarden/android/commit/16e5034846e6e374df021ea9fa4eaf462e7cab7f) Update 2fas test ### 📊 Changes **14 files changed** (+4598 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/manager/di/PlatformManagerModule.kt` (+11 -1) 📝 `authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/manager/imports/ImportManagerImpl.kt` (+5 -3) 📝 `authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/manager/imports/parsers/AegisExportParser.kt` (+6 -4) 📝 `authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/manager/imports/parsers/LastPassExportParser.kt` (+5 -3) 📝 `authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/manager/imports/parsers/TwoFasExportParser.kt` (+6 -4) 📝 `authenticator/src/test/kotlin/com/bitwarden/authenticator/data/platform/manager/imports/ImportManagerTest.kt` (+4 -0) ➕ `authenticator/src/test/kotlin/com/bitwarden/authenticator/data/platform/manager/imports/parsers/AegisExportParserTest.kt` (+1010 -0) ➕ `authenticator/src/test/kotlin/com/bitwarden/authenticator/data/platform/manager/imports/parsers/BitwardenExportParserTest.kt` (+1212 -0) ➕ `authenticator/src/test/kotlin/com/bitwarden/authenticator/data/platform/manager/imports/parsers/LastPassExportParserTest.kt` (+1028 -0) ➕ `authenticator/src/test/kotlin/com/bitwarden/authenticator/data/platform/manager/imports/parsers/TwoFasExportParserTest.kt` (+1278 -0) 📝 `authenticator/src/test/kotlin/com/bitwarden/authenticator/ui/platform/feature/debugmenu/manager/DebugLaunchManagerTest.kt` (+6 -3) 📝 `authenticator/src/test/kotlin/com/bitwarden/authenticator/ui/platform/feature/rootnav/RootNavScreenTest.kt` (+2 -2) ➕ `core/src/main/kotlin/com/bitwarden/core/data/manager/UuidManager.kt` (+13 -0) ➕ `core/src/main/kotlin/com/bitwarden/core/data/manager/UuidManagerImpl.kt` (+12 -0) </details> ### 📄 Description ## 🎟️ Tracking Test coverage improvements for critical import functionality. ## 📔 Objective This PR adds comprehensive unit tests for the import parser system and UuidManager. The test coverage includes: - **AegisExportParser**: Full test suite covering JSON parsing, vault structure, and TOTP algorithm variations - **BitwardenExportParser**: Complete validation of Bitwarden export format parsing - **LastPassExportParser**: Test coverage for LastPass CSV format import handling - **TwoFasExportParser**: Comprehensive tests for 2FAS JSON format processing - **UuidManager**: Test suite for UUID generation and management These tests ensure the import system correctly handles various export formats, validates data integrity, and properly manages error cases. The parsers are critical components for data migration and must maintain strict correctness guarantees. ## 📸 Screenshots N/A - Test-only changes ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-21 04:08:48 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#37070