Unit testing in object oriented development aims to determine whether the individual units are working as intended or
not, which is accomplished by executing tests, which contains calls to unit under test (class or method) and verifying the
output with expected one. Coverage criteria play a significant role to decide if the unit testing was well performed or not.
A successful unit test will have high amount of coverage. But often the execution of unit depends on environmental
dependencies like file system, user interaction, database, and networks. Some techniques are developed to address
these dependency issues like file system and database interactions. This paper addresses the networking interactions
based on mocking approach, where some of the java.net API classes like InetAddress, URL, URI and Socket, etc were
mocked. Then the work was evaluated against selected java programs, whose source code contains usage of java.net
API classes. The results show improvement in the code coverage when unit testing is performed with network mocking.