In this module we introduce the basic concepts behind networking. We use Java's networking libraries to design simple programs that interact with web pages as well as write simple client-server programs.
We conclude this module with an introduction to Mocking and Mockito. We show how to use mocking of objects in your tests in order to simulate the behavior of dependent code, and assist with unit tests.
- Given a URL, identify each component.
- Explain the difference between a server socket and a normal socket.
- Write a program that reads the contents of a public web page by using the Java HttpURLConnection class.
- Write a server-client program that uses Java sockets to exchange data.
- Given a Java application, use Maven to introduce a new library dependency.
- Given a Java class with dependencies, mock all dependency calls in a JUnit test by using the Mockito library.