verifyAll();
}
@Test
public void testExecute() throws DispatchException {
JizzStation mockStation = new JizzStation();
expect(mockJizzStationDao.getPrimaryStation()).andReturn(mockStation);
expect(mockJizzStationDao.createOrUpdateStation(mockStation))
.andReturn(mockStation);
replayAll();
SetSettingsAction action = new SetSettingsAction();
ServerSettings mockSettings = new ServerSettings();
mockSettings.setStationName("Awesome Station");
mockSettings.setStationUrl("http://awesome/");
mockSettings.setBroadcastSchedule("30 0 * * * Mon");
action.setSettings(mockSettings);
setSettingsHandler.execute(action, null);
assertEquals(mockSettings.getStationName(), mockStation.getName());
assertEquals(mockSettings.getStationUrl(), mockStation.getUrl());
assertEquals(mockSettings.getBroadcastSchedule(),
mockStation.getBroadcastSchedule());
verifyAll();
}