* BAEL-1712 Fix tests in libraries project -Renamed 45 test files to standard naming conventions. -Updated maven dependencies in libraries/pom.xml -Fixed assertion errors in some tests. -Included libraries project back into parent pom.xml * BAEL-1712 Fix tests in libraries project -Downgraded apache maven pmd plugin from 3.9.0 to 3.8 because pmd 6.0.1 present in pmd plugin 3.9.0 was unable to resolve classes having static final inner classes and was resulting into build failure. * BAEL-1712 Fix libraries -Fixed JodaTimeUnitTest
23 lines
681 B
Java
23 lines
681 B
Java
package com.baeldung.eclipsecollections;
|
|
|
|
import org.eclipse.collections.api.list.MutableList;
|
|
import org.eclipse.collections.impl.list.mutable.FastList;
|
|
|
|
import org.assertj.core.api.Assertions;
|
|
import org.junit.Test;
|
|
|
|
public class CollectPatternUnitTest {
|
|
|
|
@Test
|
|
public void whenCollect_thenCorrect() {
|
|
Student student1 = new Student("John", "Hopkins");
|
|
Student student2 = new Student("George", "Adams");
|
|
|
|
MutableList<Student> students = FastList.newListWith(student1, student2);
|
|
|
|
MutableList<String> lastNames = students.collect(Student::getLastName);
|
|
|
|
Assertions.assertThat(lastNames).containsExactly("Hopkins", "Adams");
|
|
}
|
|
}
|