As shown in the diagram, when a user has entered an address on a 5250 UI, the getLatLng subprocedure places the address and a GUID on the request FIFO data queue and immediately performs a receive on the keyed data queue for 5 seconds. The Java app reads the request from the FIFO queue and sends the address to Google which returns the latitude and longitude and county name. The county name is converted into the county code and the three values are put on the keyed data queue along with the RPG program's GUID key. The subprocedure waits for a response on the keyed data queue and returns the values to the caller.
There is a lot going on but with the modularity of service programs and Java classes, the code stays fairly simple. This application does the following as shown on in the diagram:
The purpose of the JUnit code is to replace the call of the subprocedure made from the RPG program with a call from the Java JUnit test. This test is an integration test of all the components working together and the main benefit it provide is performance verification.