Blog Archives
1 2 3 4 5

06: Mockito & PowerMock for mocking static methods

This extends Part 4: Mockito & PowerMock for partially mocking private methods to mock “static” methods.

How to use both Spring JUnit and PowerMock runners?

By using the “@PowerMockRunnerDelegate” from the “powermock-module-junit4” jar.

So, need to use compatible “Mockito” and “PowerMock”.

Read more ›



30+ Java Code Review Checklist Items

This Java code review checklist is not only useful during code reviews, but also to answer an important Java job interview question,

Q. How would you go about evaluating code quality of others’ work?

You also learn a lot from peer code reviews. What has been written well?

Read more ›



5 Java unit testing interview Questions and Answers

Q1 Why use mock objects in unit testing? A1 Unit testing is widely accepted as a “best practice” for software development. When you write an object, you must also provide an automated test class containing methods by calling its various public methods with various parameters and making sure that the...



8+ JMeter performance testing interview Q&As

Performance testing is an important process of any software development. You can bring this up yourself to many open-ended questions like — Tell me about yourself? What are some of your recent accomplishments that you are proud of? Setting up a performance/load test script is always the first step in...



Ensuring code quality in Java Q&As

Q1. How do you ensure code quality in your application? A1. Code quality means writing readable, maintainable and robust code, that conforms as much as possible to the style-guideline that is used, and that has as little as possible defects. … Read more ›...



Integration Unit testing Spring Transaction Management

This is an integration testing that tests Spring transaction through service, and DAO layers all the way up to the embedded database like HSQLDB or H2. After commit or rollback, the number of records in the table are verified. The service layer defines the transactional boundaries with the “@Transactional” annotation....



Jacoco for unit test coverage with SonarQube tutorial

This tutorial extends SonarQube with Maven Tutorial – Code Quality for Java developers to use Jacoco for tracking unit test coverage. Jacoco is the default code coverage tool that gets shipped with SonarQube. SonarQube can also be configured to use Cobertura as the code coverage tool.

Read more ›



1 2 3 4 5

Java Interview FAQs

800+ Java Interview Q&As

Top