Course: Develop yourself from Javanista to Java Master - Part 1 Unit Testing

$349.00
$422.29 incl. vat

duration: 18 hours |

Language: English (US) |

access duration: 365 days |

Details

Do you want to develop yourself from Javanista to Java Master? Then this course is ideal for you! This course is designed for Java developers who want to improve their skills in Java enterprise frameworks and become better at developing enterprise applications.

This is the first part of the Javanista to Java Master learning path.

When you choose this course you will get:

  • Access to courses, and exams on Java.
  • Guidance from our Learning & Development team, together we set goals, make a schedule and monitor your progress.

This first part of this course focuses on Unit Testing. Here you will learn how to write and run JUnit tests and how to identify the right situation to construct and use mock objects.

Result

After completing this first part, you will have knowledge of:

  • Writing JUnit tests.
  • Running JUnit tests.
  • Identifying appropriate situations for mock objects.
  • Constructing and using mock objects.

Prerequisites

This course is suitable for Java developers who already have some experience writing Java code. It is important that you are familiar with basic concepts such as variables, data types, loops, conditions and functions.

Target audience

Software Developer, Web Developer

Content

Develop yourself from Javanista to Java Master - Part 1 Unit Testing

18 hours

Unit Testing: An Introduction to the JUnit Framework

JUnit, an open-source unit testing framework, can be used by Java developers who employ a test-driven development methodology. The platform allows you to write and run tests on sections of code repeatedly. Use this course as a quick theoretical and hands-on introduction to the JUnit framework. Begin by looking at the process of software testing in general, then unit-testing with JUnit in particular. Next, move on to writing a simple Java app for which you will write JUnit test cases to ensure that its functions behave in line with expectations. Moving along, learn how to use annotations to mark out methods as test cases and set up work to be carried out before test case executions and tasks to be performed after they have run. When you're done, you'll be able to get started writing unit tests for your code using the JUnit framework.

Unit Testing: Assertions & Assumptions in JUnit

Assertions, a collection of utility methods in in JUnit, help assert the pass or fail status of test cases. The focus of this course is on assertions that allow you to set the conditions for the success and failure of test cases and assumptions to control the flow of execution in a test case. Begin with simple assert methods to compare the actual values of fields or return values of methods with their expected values. Then, use assertions that ensure your app's performance by failing a test if it takes too long to run, followed by assert methods that check an exception is thrown when invalid data is passed to a method. Next, use assumptions that check for conditions before executing a code block - effectively serving as control structures. When you're done, you'll have a working knowledge of using assertions in JUnit.

Unit Testing: Advanced Annotations in JUnit

Using annotations in JUnit allows you to add a special form of syntactic meta-data to Java source code for better code readability and structure. The aim of this course is to give you hands-on experience with JUnit annotations which allow you to set when and how test-cases should be run. Kick things off with a basic annotation to set the name of a test case that appears in execution summaries. Move on to using annotations that simplify the setting of conditions in which test cases should run - based on the current operating system, JRE version, and even environment variables. Explore the definition of a custom annotation composed of a combination of pre-built annotations. Then, apply annotations that control the order of test case executions and enable parallel runs of tests. When you're done, you'll be able to use JUnit annotations for several useful tasks.

Unit Testing: Parameterized JUnit Tests

Parameterized tests in JUnit help developers save time by running the same tests repeatedly, using only different inputs, and getting different results. The focus of this course is on scaling test case executions using repeated and parameterized tests. Start by setting a particular test case to run multiple times using the RepeatedTest annotation. Next, move on to defining test cases that can accept parameters. Then, look into different ways in which the parameters can be fed into your test case - from hard-coded values defined in your test class to CSV files and method invocations. Finally, learn how to build a specialized class to pre-process your parameters before being fed into test cases. Upon completion, you'll know how to conduct repeated executions of JUnit test cases with or without parameters.

Unit Testing: Executing JUnit Tests

JUnit, the Java unit testing framework, can be used with an IDE but also with a build system, such as Maven. Furthermore, JUnit ConsoleLauncher, a stand-alone application, can be used to launch the platform from the command line. This course will dive deep into the use of Maven as well as the JUnit ConsoleLauncher to run all and specific test cases in your application. Begin by running all test cases you have written for your app using Maven. Then run specific tests and define groups of tests using JUnit tags. Next, run the tests from the command line. Finally, execute such tests using the JUnit ConsoleLauncher, which can be run from a shell without other tools such as Maven. Upon completing the course, you'll be able to execute JUnit test cases from the command line using Apache Maven and the JUnit ConsoleLauncher.

Unit Testing with Mocks: Getting Started with Mockito

Mockito is a Java framework for building mocks during unit testing. When performing unit tests on an object, you often have other, complex objects that the object under test depends upon. Rather than using those complex objects, you can use Mockito to create mocks of those objects and stub their methods to simulate expected behavior. Use this course to get to grips with mocking and its relationship with unit testing. Set up a Maven project and add the required Mockito and JUnit dependencies. Create mocks of built-in classes, such as the ArrayList, and built-in interfaces, such as the Comparator. Then, work with stub methods using Mockito's when().thenReturn() syntax. When you're done, you'll be able to identify situations where using mocks is a good idea, construct mocks, stub methods in them using Mockito, and use mock objects in unit tests.

Unit Testing with Mocks: Creating Mocks & Verifying Behavior

Mocks built in Mockito do more than just simulate the behavior of complex objects that your object under test depends upon. Mockito makes it easy for you to verify specific aspects of how the object under test and the mock interact. In this course, learn how to build mocks using annotations and use them to perform dependency injection into the object. Then, learn how to work with constructor, setter property, and field injection. Moving along, verify the behavior of the object under test and its interaction with the mock using Mockito constructs, such as verify(), verifyNoInteractions(), and various argument matchers. When you're done, you'll be able to use annotations to construct mocks in a clean and simple manner and test very specific aspects of the interactions between the stubs in your mocks and the object under test.

Unit Testing with Mocks: Mocking Exceptions & Using Spies

Unlike a mock, which has no real state, and in which all behavior must be stubbed, a spy is built atop a real object of the class being mocked and has almost full functionality. Only specific methods of the spy are stubbed, which is useful if it is too complex or cumbersome to mock. Use this course to learn how to identify when spies are a better choice than mocks, how to construct spies and stub specific methods, and how to raise exceptions in stubbed methods of your mocks. Then, use different methods to check how the object under test copes with those exceptions. Moving on, learn how to stub void methods and when to make use of the doNothing().when() syntax. When you're done, you'll be able to correctly use spies, mock exceptions and test their handling, mock void methods, and use argument captors.

Final Exam: Unit Testing

Final Exam: Unit Testing will test your knowledge and application of the topics presented throughout the Unit Testing track of the Skillsoft Aspire Javanista to Java Master Journey.

Course options

We offer several optional training products to enhance your learning experience. If you are planning to use our training course in preperation for an official exam then whe highly recommend using these optional training products to ensure an optimal learning experience. Sometimes there is only a practice exam or/and practice lab available.

Optional practice exam (trial exam)

To supplement this training course you may add a special practice exam. This practice exam comprises a number of trial exams which are very similar to the real exam, both in terms of form and content. This is the ultimate way to test whether you are ready for the exam. 

Optional practice lab

To supplement this training course you may add a special practice lab. You perform the tasks on real hardware and/or software applicable to your Lab. The labs are fully hosted in our cloud. The only thing you need to use our practice labs is a web browser. In the LiveLab environment you will find exercises which you can start immediatelyThe lab enviromentconsist of complete networks containing for example, clients, servers,etc. This is the ultimate way to gain extensive hands-on experience. 

WHY_ICTTRAININGEN

Via ons opleidingsconcept bespaar je tot 80% op trainingen

Start met leren wanneer je wilt. Je bepaalt zelf het gewenste tempo

Spar met medecursisten en profileer je als autoriteit in je vakgebied.

Ontvang na succesvolle afronding van je cursus het officiële certificaat van deelname van Icttrainingen.nl

Krijg inzicht in uitgebreide voortgangsinformatie van jezelf of je medewerkers

Kennis opdoen met interactieve e-learning en uitgebreide praktijkopdrachten door gecertificeerde docenten

Orderproces

Once we have processed your order and payment, we will give you access to your courses. If you still have any questions about our ordering process, please refer to the button below.

read more about the order process

What is included?

Certificate of participation Yes
Monitor Progress Yes
Award Winning E-learning Yes
Mobile ready Yes
Sharing knowledge Unlimited access to our IT professionals community
Study advice Our consultants are here for you to advice about your study career and options
Study materials Certified teachers with in depth knowledge about the subject.
Service World's best service

Platform

Na bestelling van je training krijg je toegang tot ons innovatieve leerplatform. Hier vind je al je gekochte (of gevolgde) trainingen, kan je eventueel cursisten aanmaken en krijg je toegang tot uitgebreide voortgangsinformatie.

Life Long Learning

Follow multiple courses? Read more about our Life Long Learning concept

read more

Contact us

Need training advise? Contact us!


contact