Jan 22, 2024

Optimizing Developmental Workflows: A Journey Towards Efficient Third-Party Integration

__Introduction__Nuclei's products function as marketplaces and mobile banking application services within the bank's ecosystem that makes use of integration of several APIs, In such complex environment of products and services, external dependencies on entities like banks and merchants play a pivotal role. These interactions facilitated through HTTP APIs, are crucial for functionalities such as bill payments, booking platforms, investment services, and numerous other functionalities. In this blog, we discuss the challenges in building a system with third party integrations and a transformative solution using wiremock to overcome them.__Challenges__While building marketplaces, our development team relies heavily on staging environments provided by third-party entities. While this facilitated the development process, it introduced complexities. The third-party APIs experienced downtime, and certain features or APIs only returned limited responses in the staging environment, limiting the ability to test various scenarios. This situation required a strong solution to simplify development along with enabling thorough testing to ensure an effective workflow.__The Naive Approach__Faced with these challenges, the initial instinct was often to hardcode expected responses from third-party APIs into the application. However, this approach brought about several pain points:1. __Code Changes and Deployment Overhead:__ Updating responses required backend code changes and deployments, introducing unnecessary effort and time.2. __Maintenance Challenges:__ Managing the actual code alongside the hardcoded responses became cumbersome and introduced difficulties in code maintenance.3. __Frontend Bottlenecks:__ Frontend teams were often blocked until backend development was completed. Even if frontend teams resorted to hardcoding, rebuilding for mobile apps became a time-consuming process.4. __Test Credential Dependency:__ Some APIs relied on test credentials, and obtaining additional credentials through communication with third parties was a time-consuming process. Moreover, certain test data could only be used once, posing additional challenges.While Mockito is a proven unit testing framework, it only helps in writing the unit tests and adding code to pass those unit tests, e2e dev flow can’t be satisfactorily tested. The network brings its own set of surprises.__When we got to know about Wiremock__In the quest for a streamlined solution, we discovered Wiremock, a versatile open-source tool that seamlessly integrates into our development process. Wiremock addresses the challenges faced by us with its unique features:1. __Proxy Functionality:__ Acting as a reliable proxy, Wiremock enables consumer applications to send requests through it, ensuring working API for the ones that are working at the third party’s end, and need not mock these working APIs.2. __Mocking Capabilities:__ Leveraging Wiremock's powerful mocking capabilities, we defined rules to simulate a variety of scenarios/responses, allowing for comprehensive testing without relying on the limitations of third-party staging environments.__Our Staging System____Before__![Imafe 1- Before](//images.ctfassets.net/urdv1oztwvyo/8yyKrajQNJLEaSxTAUQsb/3e99abb5aebba21d2cc68a245430ce67/image3.png)__After__![after](//images.ctfassets.net/urdv1oztwvyo/BVnc12xMQf2mxoGa2vdDo/e1785b9b1fe3e1f1c4248343497b3390/image4.png)__Glance at dashboard__![image 3](//images.ctfassets.net/urdv1oztwvyo/6qy7D7BhJ8DHXfqBgtuFJC/232c47b5cf6af4cc062337bdf3e6f620/image_5.png)![image 4](//images.ctfassets.net/urdv1oztwvyo/6Bn47GubeTuwTXp2J27N6D/1dc04c306593c3aa7401a0cb6580ee0a/image_6.png)__Impact of Wiremock on our development process__The adoption of Wiremock yielded transformative results:1. __Development Continuity:__ our development teams experience a seamless workflow, unhampered by the unavailability of third-party services.2. __Enhanced Testing:__ Wiremock empowered us to test applications under diverse scenarios, even those not supported by third-party staging environments, leading to more robust and reliable software.3. __Rapid Frontend Development:__ Wiremock facilitated frontend development by mimicking APIs during backend development, ensuring frontend teams were unblocked. When actual APIs were ready, Wiremock's mock rules seamlessly transitioned to actual integrations, expediting overall delivery.4. __Effortless Rule Updates:__ Wiremock's GUI dashboard simplified the process of updating rules without the need for deployment, adding an extra layer of efficiency to our development process.Illustrating an instance where Wiremock made a difference - while developing a few new features, authentication on mobile devices was failing because a dependent third party api was down in staging environment.All the developers were blocked because navigating to most of the functionalities device authentication was required. Wiremock helped bypass the authentication unblocking the development process for the whole team.__Conclusion: A Paradigm Shift in Development Process__Wiremock emerged as a strategic tool, addressing the complexities associated with third-party integrations. By providing a reliable proxy and mock server, Wiremock empowered developers, and accelerated dev testing. For organizations navigating the challenges of third-party dependencies, Wiremock proves to be an invaluable addition to the toolkit, unlocking development potential and supercharging testing efforts. Embrace Wiremock, and witness your projects soar to new heights.

RELATED ARTICLES

No items found.
Written by
Full Name
Published on
22 January 2021

Get a free consultation on Segmentation strategy and
Ecosystem practices

Drop us a line.
Thank you! We'll be in touch soon.
Oops! Something went wrong while submitting the form.
Schedule a demo
Let’s Connect
We’ve received your request. We’ll be in touch soon.
Oops! Something went wrong while submitting the form.
Thank you! You can download the PDF now.
Download PDF
Oops! Something went wrong while submitting the form.