use of com.yandex.money.api.model.showcase.ShowcaseContext in project yandex-money-sdk-java by yandex-money.
the class ShowcaseProcessTest method testRepeat.
/**
* Tests that recovery from erroneous input works as expected.
*/
// @Test see INC-21192
public void testRepeat() throws Exception {
Showcase showcase = loadFromResource();
final ShowcaseContext.Step currentStep = new ShowcaseContext.Step(showcase, BILLS_SECOND_STEP_URL);
final ShowcaseContext showcaseContext = new ShowcaseContext(new Stack<ShowcaseContext.Step>(), DateTime.now(), currentStep, Collections.<String, String>emptyMap(), ShowcaseContext.State.UNKNOWN);
final ShowcaseProcess showcaseProcess = new ShowcaseProcess(getClient(), showcaseContext);
Text inn = (Text) showcase.form.items.get(0);
inn.setValue("erroneous input");
showcaseProcess.proceed();
assertEquals(showcaseContext.getHistorySize(), 0);
// repeat proceed with allowed inn
showcase = showcaseContext.getCurrentStep().showcase;
inn = (Text) showcase.form.items.get(0);
inn.setValue(SAMPLE_INN);
showcaseProcess.proceed();
assertEquals(showcaseContext.getHistorySize(), 1);
}
Aggregations