Commit 2ebc20b8 authored by Daniel Bluhm's avatar Daniel Bluhm

Remove mockito, formatting fixes

Signed-off-by: Daniel Bluhm's avatarDaniel Bluhm <bluhmdj@ornl.gov>
parent 81760f96
......@@ -47,11 +47,6 @@
<!-- Apache Velocity Template Engine -->
<dependencies>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.4.6</version>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-engine-core</artifactId>
......
......@@ -94,10 +94,13 @@ public class AnnotatedElement {
*/
public Map<String, Object> getAnnotationValueMap(Class<?> annotationClass) {
return this.getAnnotationMirror(annotationClass)
.map(mirror -> elementUtils.getElementValuesWithDefaults(mirror))
.map(map -> map.entrySet().stream().collect(Collectors.toMap(
entry -> entry.getKey().getSimpleName().toString(), entry -> entry.getValue().getValue())))
.orElse(Collections.emptyMap());
.map(mirror -> elementUtils.getElementValuesWithDefaults(mirror))
.map(map -> map.entrySet().stream()
.collect(Collectors.toMap(
entry -> entry.getKey().getSimpleName().toString(),
entry -> entry.getValue().getValue()
))
).orElse(Collections.emptyMap());
}
/**
......@@ -129,7 +132,10 @@ public class AnnotatedElement {
this.mirrors = this.element.getAnnotationMirrors();
}
return this.mirrors.stream()
.filter(m -> m.getAnnotationType().toString().equals(annotationClass.getCanonicalName())).findAny()
.map(m -> Optional.of((AnnotationMirror) m)).orElse(Optional.empty());
.filter(m -> m.getAnnotationType()
.toString().equals(annotationClass.getCanonicalName())
).findAny()
.map(m -> Optional.of((AnnotationMirror) m))
.orElse(Optional.empty());
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment