use of com.paulhammant.buildradiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorWebDriverTest method confirmDataRefreshes.
@Test
public void confirmDataRefreshes() throws InterruptedException {
Radiator rad = rad("xxx", "sseeccrreett", stepNames("A"), build("1", "running", 0, step("A", 0, "running")));
app = new TestVersionOfBuildRadiatorApp(rad) {
@Override
protected void serveRadiatorPage() {
// speed up refresh interval - hack radiator.html as it is send to the browser
super.serveIndexPageButWithReplacement("30000", "300");
}
};
startAppAndOpenWebDriverOnRadiatorPage("xxx");
FWD.trs().get(1).getText().shouldContain("(running)");
rad.stepPassed("1", "A");
FWD.trs().get(1).getText().within(secs(4)).shouldContain("(passed)");
}
use of com.paulhammant.buildradiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorIntegrationTest method knownCodeHasListOfBuildsAvailableAsJson.
@Test
public void knownCodeHasListOfBuildsAvailableAsJson() throws InterruptedException {
Radiator rad = rad("RAD_CODE", "a_secret", stepNames("A", "B", "C"), build("1", "running", 0, step("A", 0, "running"), step("B"), step("C"))).withIpAccessRestrictedToThese("127.0.0.1");
app = new TestVersionOfBuildRadiatorApp(rad);
startApp();
get("/r/RAD_CODE").then().assertThat().body(ignoringLastUpdatedFieldTheRadiatorIsTheSameAs(rad.withoutSecret())).statusCode(200).contentType("application/json;charset=UTF-8");
}
use of com.paulhammant.buildradiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorIntegrationTest method radiatorCannotBeUpdatedWithWithBuildStartIfTheSecretIsTooLong.
@Test
public void radiatorCannotBeUpdatedWithWithBuildStartIfTheSecretIsTooLong() {
Radiator rad = rad("aaa", "sseeccrreett", stepNames("A"));
app = new TestVersionOfBuildRadiatorApp(rad);
startApp();
postStepStartedAndConfirmTestResponse("aaa", "secret--way--too--long", "1", "A", 200, "secret parameter too long");
assertThat(rad.builds.size(), equalTo(0));
}
use of com.paulhammant.buildradiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorIntegrationTest method radiatorCanBeUpdatedWithWithBuildStart.
@Test
public void radiatorCanBeUpdatedWithWithBuildStart() {
Radiator rad = rad("aaa", "sseeccrreett", stepNames("A"));
app = new TestVersionOfBuildRadiatorApp(rad);
startApp();
postStepStartedAndConfirmTestResponse("aaa", "sseeccrreett", "1", "A", 200, "OK");
assertThat(rad.builds.get(0).steps.get(0).status, equalTo("running"));
}
use of com.paulhammant.buildradiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorIntegrationTest method radiatorCanBeCreatedWithStepNamesThatAreNotTooLong.
@Test
public void radiatorCanBeCreatedWithStepNamesThatAreNotTooLong() {
app = new TestVersionOfBuildRadiatorApp(null);
startApp();
CreatedRadiator createdRadiator = new CreatedRadiator();
given().params("stepNames", join(",", "short1", "short 2", "short 333")).when().post("/r/create").then().statusCode(200).body(captureCreatedRadiator(createdRadiator));
Radiator rad = app.getResultsStore().actualRadiators.values().iterator().next();
assertThat(rad.code, equalTo(createdRadiator.code));
assertThat(rad.secret, equalTo(createdRadiator.secret));
assertThat(rad.stepNames, equalTo(stepNames("short1", "short 2", "short 333")));
}
Aggregations