use of com.paulhammant.buildradiator.radiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorIntegrationTest method radiatorCanBeUpdatedWithRestrictedIpAddresses.
@Test
public void radiatorCanBeUpdatedWithRestrictedIpAddresses() {
Radiator rad = rad("aaa", "sseeccrreett", stepNames("A"));
app = new TestVersionOfBuildRadiatorApp(rad);
startApp();
given().params("ips", "111.111.111.111", "secret", "sseeccrreett").when().post(CONTRIVED_PATH_FOR_TESTING + "/aaa/updateIps").then().statusCode(200).body(equalTo("OK"));
postStepStartedAndConfirmTestResponse("aaa", "sseeccrreett", "1", "A", 200, "ip address 127.0.0.1 not authorized");
}
use of com.paulhammant.buildradiator.radiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorIntegrationTest method buildCannotBeStartedTwice.
@Test
public void buildCannotBeStartedTwice() {
Radiator rad = rad("aaa", "sseeccrreett", stepNames("A"), build("222", "running", 0, step("A", 0, "running")));
app = new TestVersionOfBuildRadiatorApp(rad);
startApp();
postStepStartedAndConfirmTestResponse("aaa", "sseeccrreett", "222", "A", 200, "wrong build state");
}
use of com.paulhammant.buildradiator.radiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorIntegrationTest method radiatorCannotBeUpdatedWithWithBuildStartForBogusStep.
@Test
public void radiatorCannotBeUpdatedWithWithBuildStartForBogusStep() {
Radiator rad = rad("aaa", "sseeccrreett", stepNames("A"));
app = new TestVersionOfBuildRadiatorApp(rad);
startApp();
postStepStartedAndConfirmTestResponse("aaa", "sseeccrreett", "1", "DoesntExist", 200, "unknown step");
Step step = rad.builds.get(0).steps.get(0);
assertThat(step.status, equalTo(""));
}
use of com.paulhammant.buildradiator.radiator.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.radiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorIntegrationTest method radiatorCanBeCreatedAndTransformUnderscoresInStepNames.
@Test
public void radiatorCanBeCreatedAndTransformUnderscoresInStepNames() {
app = new TestVersionOfBuildRadiatorApp(null);
startApp();
CreatedRadiator createdRadiator = new CreatedRadiator();
given().params("stepNames", join(",", "P_P", "Q q", "R-R")).when().post(CONTRIVED_PATH_FOR_TESTING + "/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("P P", "Q q", "R-R")));
}
Aggregations