Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning Modular Java Programming
  • Table Of Contents Toc
Learning Modular Java Programming

Learning Modular Java Programming

By : Jog
3 (4)
close
close
Learning Modular Java Programming

Learning Modular Java Programming

3 (4)
By: Jog

Overview of this book

Modular programming means dividing an application into small parts and then developing it. It is an approach taken by developers to build applications and helps them add efficiency in their development process, thus making it more effective. The book starts with the fundamentals of Modular Programming. Then we move on to the actual implementation, where we teach developers how to divide an application into different modules or layers (such as presentation, execution, security, lifecycle, services, and so on) for better management. Once readers are well-versed in these modules and their development, the book shows how to create bindings in order to join these different modules and form a complete application. Next, the readers will learn how to manage these modules through dependency injection. Later, we move on to testing; readers will learn how to test the different modules of an application. The book ends by teaching readers how to maintain different versions of their application and how to modify it. By the end of the book, readers will have a good understanding of modular programming and will be able to use it to build applications with Java.
Table of Contents (10 chapters)
close
close

Mock testing


The testing which is carried out with the help of mock objects is called mock testing. There are a number of ways which provide the means for mock testing. Let's discover them one by one.

Spring testing framework

Spring provides an API to conduct testing using the mock technique in JUnit. Using this API, we can create mock objects of Request, Response, Filter, and HttpSession, which is otherwise available from the container. All those methods which are dependent on request or user's request and response can now be tested easily without a container. Using this API, tests can be created even before the development of the controller has been completed with mocking or stubbing.

Let's use it in our controller testing which we developed in Ch_05_jdbcTemplate_Transaction_Declarative as per the following cases:

Case1 – Inserting contact with correct values as per validation rules

Let's now write mock testing for the AddController with the help of the following steps to find out how mock...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learning Modular Java Programming
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon