Solutions

Best practices when working with Git branches

When doing work on feature branches, it’s important to incorporate production-ready commits from master branch as soon as possible.The below walkthtroughs explain the approach. Covered in this article: Git rebasing a feature branch Git rebasing a feature branch when theres’s a conflicting change Interactive rebase Deleting branches Visualizing commits Very useful scenario – grabbing master …

Best practices when working with Git branches Read More »

Git: useful commands

Comparing the current branch to the master – git diff command You can use git diff command with various flags to see either detailed difference between the branches or just a summary. For example, after modifying file2.txt and adding new file3.txt we commit this change on wip2 branch. Then we view the diff summary: ANOther …

Git: useful commands Read More »

Using Groovy in Java applications to capture branching logic and business rules validation

Groovy as a dynamic language Groovy can be used to a great benefit to capture branching logic and business rules validation that change frequently. Groovy scripts are interpreted within the JVM, they can provide ability to dynamically modify behavior of a program at runtime. Runtime logic adjustment is an important feature in many business apps. …

Using Groovy in Java applications to capture branching logic and business rules validation Read More »

Improve quality of your testing with Parameterized JUnit tests

Junit Parameterized tests allow a developer to run the same test multiple times with different parameter values.This is very useful feature that greatly improves quality of testing. In order to use parameterized tests you need to annotate test class with @RunWith(Parameterized.class).Then you create a public static method that returns a Collection of Objects – this …

Improve quality of your testing with Parameterized JUnit tests Read More »

Mockito Test Cases and Tests where exceptions are expected

To write quality code it’s necesary to test it, as everybody knows and hopefully practices. How do you avoid super complex, fragile Unit tests that span hundreds of lines of code? The answer is you don’t use the real boiler-plate objects, you use test double objects (mock objects). Let’s use Mockito to demonstrate how this …

Mockito Test Cases and Tests where exceptions are expected Read More »