Skip to main content

πŸ› οΈ Building and Testing Your First Application: Bank Holiday API

In this section, we will walk through the full lifecycle of creating, updating, and testing a Variant-based application β€” a simple Bank Holiday API. This will demonstrate some of the capabilities with Variant especially around the scripting of Http calls.

Since Variant applications are developed entirely in the cloud and updated in real time, we will structure the process into three stages:

Step 1: Create and Deploy a Templated, OpenApi ready Application​

We will instantiate a pre-built application template, deploy it directly to the cloud, and perform an initial smoke test i.e., run its included tests, to verify baseline functionality.

Step 2: Extend the Application with Business Logic​

We will modify the deployed application to implement functionality that retrieves and returns upcoming bank holiday dates via an API endpoint.

During this step:

  • You will actively develop and update the application using Variant's Y# scripting language

  • You can continuously test the endpoint using Postman as you make changes β€” no redeployments required.

  • Real-time updates ensure that any edits to YAML pipelines or logic are immediately reflected in the live environment.

⚑ Tip: Keep your Postman window open throughout development for instant feedback while coding!

Step 3: Unit and Endpoint Testing​

We will validate the completed application using Variant’s Built-In Testing Framework. We will be creating and executing scripted unit and integration tests using Y#.

Step 4: Bonus - Running using Swagger UI​

When created you can also view your service using its self generating OpenApi endpoint and Swagger UI.

info

When developing future applications, you can adopt a more Test-Driven Development (TDD) approach by writing your tests and OpenApi specifications before starting to implement your code ;-).