Articles

I am an « automation fundamentalist ». What I mean by that, is that I will go through large amounts of pain to avoid having to manually type code if I am able to have my computer do it automatically for me. The reasons are fairly self evident, because all bugs originates from a human being having written code at some point in time. Hence, if I can completely avoid manually writing code, the argument is that I can create 100% perfect software systems, that won’t even in theory be allowed to contain bugs of any kind. This idea extends to writing Unit Tests too.

Therefor, I created the ability to automatically generate Unit Tests in Magic. To understand how, watch the following video, where I demonstrate how I invoke an HTTP REST endpoint, for then to persist the invocation, allowing me to « replay » it later. The idea of course, is that being able to replay an HTTP invocation, can help me sanity check my system further down the road, as I modify it for whatever reasons I have to modify it.

Source de l’article sur DZONE

As a Java Developer, we need to cover a lot of scenarios to ensure the quality of our software and catch bugs as soon as possible when introducing a new code. For 99% of all my use cases AssertJ, Junit, Mockito, and Wiremock are sufficient enough do cover the test cases. But for the other use cases, like unit testing info, debug or warn log messages, these frameworks don’t help you out. There is also no other framework that can provide an easy to use method to capture log messages.

The answer which the community provided works well, but it is a lot of boilerplate code to just assert your log events. Even I faced the same trouble and so I wanted to make it easier for myself and share it with you! So the LogCaptor library came into life.

Source de l’article sur DZONE

Test beakers

Find out how to use MUnit with Mule for automated unit testing.

Why Unit Testing?

This is the first question most beginners ask when they struggle to relate unit test cases with real scenarios, like what value-added unit testing is doing. This was my first thought after reading JUnit documents fifteen years back. I am sure most new developers would have similar feelings after reading unit test documents alone, but I realized that unit testing is a powerful tool to release defect-free code to production. The unit testing helps to do regression testing and gives confidence for new developers to make changes to the old codebase.

MUnit For Mule Flows

MUnit is an extension of JUnit. Developers are allowed to write XML-based test cases or Java code-based test cases for Mule flows. This document covers MUnit basics, practical options for different scenarios, and automating the business validations.

Source de l’article sur DZONE

We all know that unit test cases are one of the most important parts of an application. No? Then, I must tell you that unit testing is one of the earliest tests to be performed on the unit of code, and the earlier the defects are detected, the easier it is to fix. It reduces the difficulties of discovering errors contained in more complex pieces of the application.

So where does mocking come into the picture? Why do we need it? And how do we understand what we should mock while writing unit test cases? Answers to these questions are right below in this blog.

Source de l’article sur DZONE

Si votre Vue.js a des dépendances, vous aurez besoin pour gérer les dépendances d’une certaine manière lorsque vous test unitaire du composant.

Une approche consiste à installer les dépendances dans l’environnement de test, mais cela peut compliquer vos tests.

Source de l’article sur DZONE