"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "spring-core/src/test/java/org/springframework/core/CollectionFactoryTests.java" between
spring-framework-5.3.23.tar.gz and spring-framework-5.3.24.tar.gz

About: Spring Framework is an application framework for the Java platform and .NET Framework. Community edition.

CollectionFactoryTests.java  (spring-framework-5.3.23):CollectionFactoryTests.java  (spring-framework-5.3.24)
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* https://www.apache.org/licenses/LICENSE-2.0 * https://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
skipping to change at line 37 skipping to change at line 37
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.NavigableMap; import java.util.NavigableMap;
import java.util.NavigableSet; import java.util.NavigableSet;
import java.util.Set; import java.util.Set;
import java.util.SortedMap; import java.util.SortedMap;
import java.util.SortedSet; import java.util.SortedSet;
import java.util.TreeMap; import java.util.TreeMap;
import java.util.TreeSet; import java.util.TreeSet;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap; import org.springframework.util.MultiValueMap;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException ; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException ;
import static org.springframework.core.CollectionFactory.createApproximateCollec tion; import static org.springframework.core.CollectionFactory.createApproximateCollec tion;
import static org.springframework.core.CollectionFactory.createApproximateMap; import static org.springframework.core.CollectionFactory.createApproximateMap;
skipping to change at line 159 skipping to change at line 158
// returned by createMap() are of type java.util.List. Thus 1 can not be // returned by createMap() are of type java.util.List. Thus 1 can not be
// cast to a List. // cast to a List.
assertThatExceptionOfType(ClassCastException.class).isThrownBy(() -> assertThatExceptionOfType(ClassCastException.class).isThrownBy(() ->
map.put("foo", 1)); map.put("foo", 1));
} }
@Test @Test
void createApproximateCollectionFromEmptyHashSet() { void createApproximateCollectionFromEmptyHashSet() {
Collection<String> set = createApproximateCollection(new HashSet< String>(), 2); Collection<String> set = createApproximateCollection(new HashSet< String>(), 2);
Assertions.assertThat(set).isEmpty(); assertThat(set).isEmpty();
} }
@Test @Test
void createApproximateCollectionFromNonEmptyHashSet() { void createApproximateCollectionFromNonEmptyHashSet() {
HashSet<String> hashSet = new HashSet<>(); HashSet<String> hashSet = new HashSet<>();
hashSet.add("foo"); hashSet.add("foo");
Collection<String> set = createApproximateCollection(hashSet, 2); Collection<String> set = createApproximateCollection(hashSet, 2);
assertThat(set).isEmpty(); assertThat(set).isEmpty();
} }
 End of changes. 3 change blocks. 
3 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)