use of com.paulhammant.buildradiator.model.CreatedRadiator 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("/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("P P", "Q q", "R-R")));
}
use of com.paulhammant.buildradiator.model.CreatedRadiator in project BuildRadiator by BuildRadiator.
the class HasNewRadiator method captureCreatedRadiator.
public static BaseMatcher<String> captureCreatedRadiator(CreatedRadiator createdRadiator) {
return new BaseMatcher<String>() {
@Override
public boolean matches(Object o) {
try {
CreatedRadiator cr = new ObjectMapper().readValue((String) o, CreatedRadiator.class);
createdRadiator.code = cr.code;
createdRadiator.secret = cr.secret;
} catch (IOException e) {
fail("IOE encountered " + e.getMessage());
}
return true;
}
@Override
public void describeTo(Description description) {
}
};
}
use of com.paulhammant.buildradiator.model.CreatedRadiator 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