Added junit and integration tests