public void addGridSet(GridSet gridSet) { log.debug("Adding " + gridSet.getName()); getConfigurations() .stream() .filter(c -> c.canSave(gridSet)) .findFirst() .orElseThrow( () -> new UnsupportedOperationException( "No Configuration is able to save gridset " + gridSet.getName())) .addGridSet(gridSet); }
@Override public void testCanSaveGoodInfo() throws Exception { // Should not be able to save anything as it is read only assertThat(config.canSave(getGoodInfo("test", 1)), equalTo(false)); }
@Override public void testCanSaveGoodInfo() throws Exception { // Should not be able to save anything as it is read only assertThat(config.canSave(getGoodInfo("test", 1)), equalTo(false)); }
@Test public void testCanSaveBadInfo() throws Exception { assertThat(config.canSave(getBadInfo("test", 1)), equalTo(false)); }
@Test public void testCanSaveGoodInfo() throws Exception { assertThat(config.canSave(getGoodInfo("test", 1)), equalTo(true)); }