Skip to main content

Posts

Contract Testing

Why and what is contract testing? The distributed nature of microservices, combined with the sheer number that live within an application, make it much harder for developers to perform the integration tests that were a straightforward, routine part of monolithic app development. Contract testing is a technique for testing an integration point by checking each application in  isolation  to ensure the messages it sends or receives conform to a shared understanding that is documented in a "contract". Consumer-driven contract testing is a type of contract testing that ensures that a provider is compatible with the expectations that the consumer has of it. This involves checking that the provider accepts the expected requests, and that it returns the expected responses. Consumer contract testing provides the following benefits: Contract tests provide a mechanism to explicitly verify that a provider microservice meets a consumer’s contract/needs. These HTTP requests and responses
Recent posts

Example of Azure Event Trigger Function implemented in Java

There are so few examples of Azure Functions implemented in Java and even official documentation is a little confusing, so I decided to write my own post explaining some of the points. So here is my function class: public class EventHubTriggerFunction { /** * This function will be invoked when an event is received from Event Hub. */ @FunctionName ( "EventHubTrigger-Java" ) public void run ( @EventHubTrigger (name = "message" , eventHubName = "my-event-hubs" , connection = "EventHubConnectionString" , consumerGroup = "$Default" ) String message, final ExecutionContext context ) { context.getLogger().info( "Java Event Hub trigger function executed." ); context.getLogger().info( "Message:" + message); } } The noteworthy thing in this snippet are the annotation attributes. name : Any name that can be given to the

How I converted a table in an email to a graph on a website? Hint: Azure Functions and Logic App

This mini-project started as a necessity.  I get an email like this everyday, which gives daily numbers for different metrics. The problem with such an email is that it is difficult to keep track of or gauge the rate of growth of these metrics. If you want to know how what the previous day's numbers were you need to go to the previous day's email.  The better option any day is to have a graph that shows the values of the metrics every day. Something like this: With this goal I set out to make this system but with as less coding and expenses as possible.  First obvious step in the process was to get hold of the email and extract its text. The easiest way to do this is to use Azure Logic App.  Here is what my logic app looks like: When any new email arrives in my Outlook 365 account, with a subject that contains "System usage Stats as on", it passes the body of the email to an Azure function named 'EmailTextCleanerFunction' (code below), whose job is to clean an

See and compare Microsoft's new Default Font candidates

If like me you wanted to see Microsoft's five new default font candidates, one of which is supposed to replace Calibri , but don't have access to Microsoft 365 (which is the only place these fonts are currently available), you have come to the right place. Browse through the following screenshots and you will have a decent idea of what each font will look and feel like in real-life conditions. How do these fonts look in Powerpoint slides? Now that you have seen everything, what do you think? It's ok if you are unable to decide at once. Take your time and once you are done and have selected a winner, head over to this Twitter post and tell Microsoft which one you like. And tell me also in the comments.