use of com.paulhammant.buildradiator.radiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorIntegrationTest method radiatorCanBeCreatedWithRestrictedIpAddressesAndStillAllowAccess.
@Test
public void radiatorCanBeCreatedWithRestrictedIpAddressesAndStillAllowAccess() {
Radiator rad = rad("aaa", "sseeccrreett", stepNames("A")).withIpAccessRestrictedToThese("127.0.0.1");
app = new TestVersionOfBuildRadiatorApp(rad);
startApp();
postStepStartedAndConfirmTestResponse("aaa", "sseeccrreett", "1", "A", 200, "OK");
}
use of com.paulhammant.buildradiator.radiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorIntegrationTest method knownCodeHasListOfBuildsAvailableAsJson.
@Test
public void knownCodeHasListOfBuildsAvailableAsJson() {
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(CONTRIVED_PATH_FOR_TESTING + "/RAD_CODE").then().assertThat().body(ignoringLastUpdatedFieldTheRadiatorIsTheSameAs(rad.withoutSecret())).statusCode(200).contentType("application/json;charset=UTF-8");
}
use of com.paulhammant.buildradiator.radiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorIntegrationTest method radiatorCannotBeUpdatedWithWithBuildStartIfTheSecretIsWrong.
@Test
public void radiatorCannotBeUpdatedWithWithBuildStartIfTheSecretIsWrong() {
Radiator rad = rad("aaa", "sseeccrreett", stepNames("A"));
app = new TestVersionOfBuildRadiatorApp(rad);
startApp();
postStepStartedAndConfirmTestResponse("aaa", "wrong-secret", "1", "A", 200, "secret doesnt match");
assertThat(rad.builds.size(), equalTo(0));
}
use of com.paulhammant.buildradiator.radiator.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(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("short1", "short 2", "short 333")));
}
use of com.paulhammant.buildradiator.radiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorIntegrationTest method radiatorCanBeCreatedWithRestrictedIpAddressesAndBlockAccess.
@Test
public void radiatorCanBeCreatedWithRestrictedIpAddressesAndBlockAccess() {
Radiator rad = rad("aaa", "sseeccrreett", stepNames("A")).withIpAccessRestrictedToThese("111.111.111.111", "222.222.222.222");
app = new TestVersionOfBuildRadiatorApp(rad);
startApp();
postStepStartedAndConfirmTestResponse("aaa", "sseeccrreett", "1", "A", 200, "ip address 127.0.0.1 not authorized");
}
Aggregations