use of com.thoughtworks.go.plugin.access.configrepo.contract.CRTimer in project gocd by gocd.
the class CRTimerTest method shouldDeserializeFromAPILikeObject.
@Test
public void shouldDeserializeFromAPILikeObject() {
String json = "{\n" + " \"spec\": \"0 0 22 ? * MON-FRI\",\n" + " \"only_on_changes\": true\n" + " }";
CRTimer deserializedValue = gson.fromJson(json, CRTimer.class);
assertThat(deserializedValue.getTimerSpec(), is("0 0 22 ? * MON-FRI"));
assertThat(deserializedValue.isOnlyOnChanges(), is(true));
ErrorCollection errors = deserializedValue.getErrors();
assertTrue(errors.isEmpty());
}
Aggregations