|
| 1 | +# 🚀 Preflight 0.0.4 Released: MongoDB Support, Direct Orbital API Access, and More! |
| 2 | + |
| 3 | +We're excited to announce the release of **Preflight 0.0.4**, the biggest update yet to our Kotlin testing framework for Taxi and Orbital projects! This release brings significant new capabilities for integration testing, enhanced API access, and improved developer experience. |
| 4 | + |
| 5 | +## 🎯 What's New |
| 6 | + |
| 7 | +### 🗄️ MongoDB Container Support |
| 8 | +The most requested feature is finally here! Preflight now provides first-class support for testing against MongoDB databases using TestContainers. |
| 9 | + |
| 10 | +```kotlin |
| 11 | +// Configure MongoDB connector |
| 12 | +preflight { |
| 13 | + connectors = listOf( |
| 14 | + ConnectorSupport.Kafka, |
| 15 | + ConnectorSupport.MongoDB // New! |
| 16 | + ) |
| 17 | +} |
| 18 | + |
| 19 | +// Use in your tests |
| 20 | +class MongoIntegrationSpec : OrbitalSpec({ |
| 21 | + withContainers( |
| 22 | + mongoConnector("user-db") |
| 23 | + ) |
| 24 | + |
| 25 | + it("should query users from MongoDB") { |
| 26 | + val mongo = containerForConnection<MongoContainerSupport>("user-db") |
| 27 | + |
| 28 | + // Insert test data |
| 29 | + mongo.mongoClient() |
| 30 | + .getDatabase("user_management") |
| 31 | + .getCollection("users") |
| 32 | + .insertOne(Document("id", "user123").append("name", "John")) |
| 33 | + |
| 34 | + // Test your Taxi queries |
| 35 | + """find { User(UserId == "user123") }""".queryForObject() |
| 36 | + .shouldBe(mapOf("id" to "user123", "name" to "John")) |
| 37 | + } |
| 38 | +}) |
| 39 | +``` |
| 40 | + |
| 41 | +**Key Features:** |
| 42 | +- Pre-configured MongoDB 6.0.7 containers |
| 43 | +- Automatic database initialization with test credentials |
| 44 | +- Direct MongoDB client access for test data setup |
| 45 | +- Seamless integration with existing Kafka containers |
| 46 | + |
| 47 | +### 🔧 Direct Orbital API Access |
| 48 | +Need more control? Access the underlying Orbital instance directly for advanced testing scenarios: |
| 49 | + |
| 50 | +```kotlin |
| 51 | +it("should access Orbital API for advanced testing") { |
| 52 | + val orbital = orbital() |
| 53 | + |
| 54 | + // Inspect compiled schema |
| 55 | + val schema = orbital.schema |
| 56 | + val userType = schema.type("User") |
| 57 | + |
| 58 | + // Execute queries with custom parameters |
| 59 | + val result = orbital.query(""" |
| 60 | + given { userId : UserId = parameter("userId") } |
| 61 | + find { User(id == userId) } |
| 62 | + """, QueryContext.builder().withParameter("userId", "123").build()) |
| 63 | + |
| 64 | + // Access internal services |
| 65 | + val invoker = orbital.operationInvoker |
| 66 | +} |
| 67 | +``` |
| 68 | + |
| 69 | +**Use Cases:** |
| 70 | +- Schema metadata inspection and validation |
| 71 | +- Custom query execution with parameters |
| 72 | +- Advanced debugging and introspection |
| 73 | +- Testing Orbital's internal behavior |
| 74 | + |
| 75 | +### 📊 Mixed Source Format Support |
| 76 | +Preflight now automatically handles projects with multiple schema formats: |
| 77 | + |
| 78 | +```kotlin |
| 79 | +// Your project structure |
| 80 | +├── src |
| 81 | +│ ├── taxi-schemas/ |
| 82 | +│ │ └── user.taxi |
| 83 | +│ ├── avro-schemas/ // New! |
| 84 | +│ │ └── events.avsc |
| 85 | +│ └── openapi-specs/ // New! |
| 86 | +│ └── api.yaml |
| 87 | +``` |
| 88 | + |
| 89 | +**Automatic Transpilation:** |
| 90 | +- **Avro schemas** (`.avsc`) → Taxi types |
| 91 | +- **OpenAPI specs** (`.yaml`, `.json`) → Taxi services |
| 92 | +- **Taxi schemas** (`.taxi`) → Native support |
| 93 | +- All formats unified in a single compiled schema for testing |
| 94 | + |
| 95 | +### ⚙️ Enhanced Configuration |
| 96 | +More control over your testing environment: |
| 97 | + |
| 98 | +```kotlin |
| 99 | +preflight { |
| 100 | + // Customize Orbital version |
| 101 | + orbitalVersion = "0.37.0" // or "0.37.0-M1" for milestones |
| 102 | + |
| 103 | + // Use multiple connectors |
| 104 | + connectors = listOf( |
| 105 | + ConnectorSupport.Kafka, |
| 106 | + ConnectorSupport.MongoDB |
| 107 | + ) |
| 108 | +} |
| 109 | +``` |
| 110 | + |
| 111 | +### 🎯 Named Query Arguments |
| 112 | +Pass arguments to your named queries in tests: |
| 113 | + |
| 114 | +```kotlin |
| 115 | +it("should execute named queries with arguments") { |
| 116 | + runNamedQueryForObject("getUserWithDetails", mapOf( |
| 117 | + "userId" to "user123", |
| 118 | + "includePreferences" to true |
| 119 | + )) { |
| 120 | + // Configure stubs as needed |
| 121 | + } |
| 122 | +} |
| 123 | +``` |
| 124 | + |
| 125 | +## 🔄 Breaking Changes |
| 126 | + |
| 127 | +### Java 21 Requirement |
| 128 | +**Action Required:** Preflight 0.0.4 requires Java 21 (previously Java 17). |
| 129 | + |
| 130 | +```bash |
| 131 | +# Update your JAVA_HOME |
| 132 | +export JAVA_HOME=/path/to/java-21 |
| 133 | + |
| 134 | +# Verify version |
| 135 | +java -version |
| 136 | +# Should show: java version "21.x.x" |
| 137 | +``` |
| 138 | + |
| 139 | +Update your Gradle builds to use Java 21: |
| 140 | +```kotlin |
| 141 | +kotlin { |
| 142 | + jvmToolchain(21) |
| 143 | +} |
| 144 | +``` |
| 145 | + |
| 146 | +## 📚 Improved Documentation |
| 147 | + |
| 148 | +We've significantly expanded our documentation with: |
| 149 | +- Complete MongoDB integration testing guide |
| 150 | +- Direct Orbital API access examples |
| 151 | +- Mixed source format documentation |
| 152 | +- Enhanced getting started guide |
| 153 | +- Comprehensive changelog (new!) |
| 154 | + |
| 155 | +## 🚀 Getting Started |
| 156 | + |
| 157 | +### New Projects |
| 158 | +```kotlin |
| 159 | +// build.gradle.kts |
| 160 | +plugins { |
| 161 | + kotlin("jvm") version "1.9.23" |
| 162 | + id("com.orbitalhq.preflight") version "0.0.4" |
| 163 | +} |
| 164 | + |
| 165 | +preflight { |
| 166 | + orbitalVersion = "0.36.0-M9" // or your preferred version |
| 167 | + connectors = listOf( |
| 168 | + ConnectorSupport.Kafka, |
| 169 | + ConnectorSupport.MongoDB |
| 170 | + ) |
| 171 | +} |
| 172 | +``` |
| 173 | + |
| 174 | +### Existing Projects |
| 175 | +Update your plugin version: |
| 176 | +```kotlin |
| 177 | +id("com.orbitalhq.preflight") version "0.0.4" // was "0.0.3" |
| 178 | +``` |
| 179 | + |
| 180 | +## 🎉 What's Next? |
| 181 | + |
| 182 | +Looking ahead to future releases, we're exploring: |
| 183 | +- PostgreSQL container support |
| 184 | +- REST API mocking with WireMock |
| 185 | +- Enhanced streaming test utilities |
| 186 | +- Performance improvements and optimizations |
| 187 | +- Integration with Nebula for real data source testing |
| 188 | + |
| 189 | +## 📖 Resources |
| 190 | + |
| 191 | +- **Documentation:** [Latest docs with all new features](https://preflight.orbitalhq.com) |
| 192 | +- **Changelog:** [Complete version history](https://preflight.orbitalhq.com/changelog) |
| 193 | +- **Examples:** Check out our [example projects](https://github.com/orbitalapi/preflight/tree/main/example-projects) |
| 194 | +- **Issues:** [Report bugs or request features](https://github.com/orbitalapi/preflight/issues) |
| 195 | + |
| 196 | +## 🙏 Thank You |
| 197 | + |
| 198 | +A huge thanks to our community for the feedback, bug reports, and feature requests that made this release possible. Special shoutout to everyone who contributed to testing the MongoDB integration! |
| 199 | + |
| 200 | +--- |
| 201 | + |
| 202 | +**Happy Testing!** 🧪 |
| 203 | + |
| 204 | +*The Orbital Team* |
| 205 | + |
| 206 | +--- |
| 207 | + |
| 208 | +### Version Compatibility |
| 209 | +- **Preflight:** 0.0.4 |
| 210 | +- **Orbital:** 0.36.0-M9 (default, configurable) |
| 211 | +- **Java:** 21+ (required) |
| 212 | +- **Kotlin:** 1.9.23 |
| 213 | +- **Gradle:** 7.0+ (recommended: 8.0+) |
0 commit comments