Updated for integration test and added offline unit test.