@Test
public void testGetNextIntent() {

    final Intent intent = new Intent("test.intent.ACTION");
    intent.putExtra("scriptUri", "android-resource://test-script");
    intent.putExtra("actionId", "test_action_id");
    intent.putExtra("theme", "test_theme");
    intent.putExtra("ignoreExtra", "poof"); // extra is ignored because it's not known
    final Intent data = new Intent();
    data.putExtra("extraData", "shazam");
    final Intent nextIntent =
            WizardManagerHelper.getNextIntent(intent, Activity.RESULT_OK, data);
    assertEquals("Next intent action should be NEXT", "com.android.wizard.NEXT",
            nextIntent.getAction());
    assertEquals("Script URI should be the same as original intent",
            "android-resource://test-script", nextIntent.getStringExtra("scriptUri"));
    assertEquals("Action ID should be the same as original intent", "test_action_id",
            nextIntent.getStringExtra("actionId"));
    assertEquals("Theme extra should be the same as original intent", "test_theme",
            nextIntent.getStringExtra("theme"));
    assertFalse("ignoreExtra should not be in nextIntent", nextIntent.hasExtra("ignoreExtra"));
    assertEquals("Result code extra should be RESULT_OK", Activity.RESULT_OK,
            nextIntent.getIntExtra("com.android.setupwizard.ResultCode", 0));
    assertEquals("Extra data should surface as extra in nextIntent", "shazam",
            nextIntent.getStringExtra("extraData"));
}