Search in sources :

Example 11 with Radiator

use of com.paulhammant.buildradiator.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(""));
}
Also used : Step(com.paulhammant.buildradiator.model.Step) HasNewRadiator.captureCreatedRadiator(com.paulhammant.buildradiator.hamcrest.HasNewRadiator.captureCreatedRadiator) Radiator(com.paulhammant.buildradiator.model.Radiator) CreatedRadiator(com.paulhammant.buildradiator.model.CreatedRadiator) Test(org.junit.Test)

Example 12 with Radiator

use of com.paulhammant.buildradiator.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");
}
Also used : HasNewRadiator.captureCreatedRadiator(com.paulhammant.buildradiator.hamcrest.HasNewRadiator.captureCreatedRadiator) Radiator(com.paulhammant.buildradiator.model.Radiator) CreatedRadiator(com.paulhammant.buildradiator.model.CreatedRadiator) Test(org.junit.Test)

Example 13 with Radiator

use of com.paulhammant.buildradiator.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");
}
Also used : HasNewRadiator.captureCreatedRadiator(com.paulhammant.buildradiator.hamcrest.HasNewRadiator.captureCreatedRadiator) Radiator(com.paulhammant.buildradiator.model.Radiator) CreatedRadiator(com.paulhammant.buildradiator.model.CreatedRadiator) Test(org.junit.Test)

Example 14 with Radiator

use of com.paulhammant.buildradiator.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");
}
Also used : HasNewRadiator.captureCreatedRadiator(com.paulhammant.buildradiator.hamcrest.HasNewRadiator.captureCreatedRadiator) Radiator(com.paulhammant.buildradiator.model.Radiator) CreatedRadiator(com.paulhammant.buildradiator.model.CreatedRadiator) Test(org.junit.Test)

Example 15 with Radiator

use of com.paulhammant.buildradiator.model.Radiator in project BuildRadiator by BuildRadiator.

the class RadiatorIntegrationTest method radiatorCanBeUpdatedWithWithBuildStepCompletion.

@Test
public void radiatorCanBeUpdatedWithWithBuildStepCompletion() {
    Radiator rad = rad("aaa", "sseeccrreett", stepNames("A", "B"), build("1", "running", 0, step("A", 0, "running"), step("B")));
    app = new TestVersionOfBuildRadiatorApp(rad);
    startApp();
    given().params("build", "1", "step", "A", "secret", "sseeccrreett").when().post("/r/aaa/stepPassed").then().statusCode(200).body(equalTo("OK"));
    ArrayList<Step> steps = rad.builds.get(0).steps;
    assertThat(steps.get(0).name, equalTo("A"));
    assertThat(steps.get(0).status, equalTo("passed"));
}
Also used : Step(com.paulhammant.buildradiator.model.Step) HasNewRadiator.captureCreatedRadiator(com.paulhammant.buildradiator.hamcrest.HasNewRadiator.captureCreatedRadiator) Radiator(com.paulhammant.buildradiator.model.Radiator) CreatedRadiator(com.paulhammant.buildradiator.model.CreatedRadiator) Test(org.junit.Test)

Aggregations

Radiator (com.paulhammant.buildradiator.model.Radiator)27 Test (org.junit.Test)21 HasNewRadiator.captureCreatedRadiator (com.paulhammant.buildradiator.hamcrest.HasNewRadiator.captureCreatedRadiator)14 CreatedRadiator (com.paulhammant.buildradiator.model.CreatedRadiator)14 Step (com.paulhammant.buildradiator.model.Step)4 ByteString (com.google.protobuf.ByteString)2 Build (com.paulhammant.buildradiator.model.Build)2 RadiatorDoesntExist (com.paulhammant.buildradiator.model.RadiatorDoesntExist)2 UnknownStep (com.paulhammant.buildradiator.model.UnknownStep)1