assertEquals(configuration, newConfiguration);
}
@Test
public void testSaveSapeConfigurationValidationFail() {
SapeConfiguration newConfiguration = new SapeConfiguration();
BindingResult bindingResult = mock(BindingResult.class);
when(bindingResult.hasErrors()).thenReturn(true);
ModelAndView mav = controller.saveSapeConfiguration(newConfiguration, bindingResult);
verify(configurationService, never()).updateSapeConfiguration(eq(newConfiguration), anyLong());
assertViewName(mav, VIEW_SAPE_CONFIGURATION);
assertModelAttributeAvailable(mav, PARAM_SAPE_CONFIGURATION);
SapeConfiguration configuration = assertAndReturnModelAttributeOfType(
mav, PARAM_SAPE_CONFIGURATION, SapeConfiguration.class);
assertEquals(configuration, newConfiguration);
}