Fixed test for JSON - test function and registered write method separately