DATACMNS-1020 - Improvements to revision API.
RevisionRepository now returns Optional for methods that could previously return null. Revision exposes additional methods to lookup required revision numbers and dates. Revisions now implements Streamable and exposes a ….none() factory method to create an empty instance. AnnotationBasedRevisionMetadata now uses Lazy to lookup the fields with revision annotations. AnnotationDetectionFieldCallback now also uses Optional in places it previously returned null. StreamUtils now exposes factory methods for Collector instances producing unmodifiable List and Set instances. Related ticket: DATACMNS-867.
This commit is contained in:
@@ -36,14 +36,13 @@ public class AnnotationDetectionFieldCallbackUnitTests {
|
||||
}
|
||||
|
||||
@Test // DATACMNS-616
|
||||
@SuppressWarnings("rawtypes")
|
||||
public void looksUpValueFromPrivateField() {
|
||||
|
||||
AnnotationDetectionFieldCallback callback = new AnnotationDetectionFieldCallback(Autowired.class);
|
||||
ReflectionUtils.doWithFields(Sample.class, callback);
|
||||
|
||||
assertThat(callback.getType()).isEqualTo(String.class);
|
||||
assertThat(callback.<String> getValue(new Sample("foo"))).isEqualTo("foo");
|
||||
assertThat(callback.getType()).hasValue(String.class);
|
||||
assertThat(callback.getValue(new Sample("foo"))).hasValue("foo");
|
||||
}
|
||||
|
||||
@Test // DATACMNS-616
|
||||
@@ -52,8 +51,8 @@ public class AnnotationDetectionFieldCallbackUnitTests {
|
||||
AnnotationDetectionFieldCallback callback = new AnnotationDetectionFieldCallback(Autowired.class);
|
||||
ReflectionUtils.doWithFields(Empty.class, callback);
|
||||
|
||||
assertThat(callback.getType()).isNull();
|
||||
assertThat(callback.<Object> getValue(new Empty())).isNull();
|
||||
assertThat(callback.getType()).isNotPresent();
|
||||
assertThat(callback.getValue(new Empty())).isNotPresent();
|
||||
}
|
||||
|
||||
@Value
|
||||
|
||||
Reference in New Issue
Block a user