@@ -0,0 +1,1418 @@
+package net.pdp7.v2f.samples.petclinic;%0A%0Aimport static org.jooq.impl.DSL.field;%0A%0Aimport java.util.List;%0Aimport java.util.UUID;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0Aimport org.openqa.selenium.By;%0Aimport org.openqa.selenium.WebDriver;%0Aimport org.openqa.selenium.WebElement;%0A%0A%0Apublic class StateStoreTests extends AbstractIntegrationTest %7B%0A%0A%09@Test%0A%09public void test() %7B%0A%09%09String name = %22species%22 + UUID.randomUUID();%0A%09%09WebDriver driver = getDriver();%0A%09%09createSpecies(driver, name);%0A%09%09Assert.assertEquals(1, dslContext%0A%09%09%09%09.select()%0A%09%09%09%09.from(%22species%22)%0A%09%09%09%09.where(field(%22name%22).eq(name))%0A%09%09%09%09.execute());%0A%09%09// we use the fact that the trigger that assigns ids to species won't%0A%09%09// work if we add two species with the same name; it should redirect us%0A%09%09// to the same page preserving form state%0A%09%09createSpecies(driver, name);%0A%09%09Assert.assertEquals(1, dslContext%0A%09%09%09%09.select()%0A%09%09%09%09.from(%22species%22)%0A%09%09%09%09.where(field(%22name%22).eq(name))%0A%09%09%09%09.execute());%0A%09%09Assert.assertEquals(name, driver.findElement(By.tagName(%22textarea%22)).getText());%0A%09%7D%0A%0A%09protected void createSpecies(WebDriver driver, String name) %7B%0A%09%09driver.get(getRoute(%22/species/new/%22));%0A%09%09List%3CWebElement%3E labels = driver.findElements(By.tagName(%22label%22));%0A%09%09WebElement nameInput = labels.get(0).findElement(By.tagName(%22textarea%22));%0A%09%09nameInput.clear();%0A%09%09nameInput.sendKeys(name);%0A%09%09driver.findElement(By.cssSelector(%22input%5Btype=submit%5D%22)).click();%0A%09%7D%0A%0A%7D%0A

Add test for form state preservation on form failure (#11)