DATACMNS-1206 - Polishing.
Convert type array to string to construct the exception message. Slight Javadoc tweaks. Reduce method visibility. Simplify hasDefaultGetter check. Remove superfluous throws declaration. Strip trailing whitespaces. Ignore property descriptors without getter (e.g. indexed properties). Original pull request: #263.
This commit is contained in:
@@ -23,6 +23,7 @@ import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link DefaultProjectionInformation}.
|
||||
@@ -40,6 +41,14 @@ public class DefaultProjectionInformationUnitTests {
|
||||
assertThat(toNames(information.getInputProperties())).contains("firstname", "lastname");
|
||||
}
|
||||
|
||||
@Test // DATACMNS-1206
|
||||
public void omitsInputPropertiesAcceptingArguments() {
|
||||
|
||||
ProjectionInformation information = new DefaultProjectionInformation(ProjectionAcceptingArguments.class);
|
||||
|
||||
assertThat(toNames(information.getInputProperties())).containsOnly("lastname");
|
||||
}
|
||||
|
||||
@Test // DATACMNS-89
|
||||
public void discoversAllInputProperties() {
|
||||
|
||||
@@ -66,7 +75,7 @@ public class DefaultProjectionInformationUnitTests {
|
||||
}
|
||||
|
||||
@Test // DATACMNS-967
|
||||
public void doesNotConsiderDefaultMethodInputProperties() throws Exception {
|
||||
public void doesNotConsiderDefaultMethodInputProperties() {
|
||||
|
||||
ProjectionInformation information = new DefaultProjectionInformation(WithDefaultMethod.class);
|
||||
|
||||
@@ -89,6 +98,14 @@ public class DefaultProjectionInformationUnitTests {
|
||||
String getLastname();
|
||||
}
|
||||
|
||||
interface ProjectionAcceptingArguments {
|
||||
|
||||
@Value("foo")
|
||||
String getFirstname(int i);
|
||||
|
||||
String getLastname();
|
||||
}
|
||||
|
||||
interface ExtendedProjection extends CustomerProjection {
|
||||
|
||||
int getAge();
|
||||
|
||||
Reference in New Issue
Block a user