Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show message for failed validation in expected fails #246

Merged
merged 2 commits into from
Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,17 @@ public class FailsAnnotationConverter implements AnnotationConverter<Fails> {
@Override
public Map<String, Object> toMap(Fails annotation) {
Map<String, Object> map = new HashMap<>();
if (!StringUtils.isBlank(annotation.description())) {
if (StringUtils.isNotBlank(annotation.description())) {
map.put("description", annotation.description());
}
if (!StringUtils.isBlank(annotation.ticketString())) {
if (StringUtils.isNotBlank(annotation.ticketString())) {
map.put("ticketString", annotation.ticketString());
} else if (annotation.ticketId() > 0) {
map.put("ticketString", Integer.toString(annotation.ticketId()));
}
if (StringUtils.isNotBlank(annotation.validator())) {
map.put("validator", annotation.validatorClass().getCanonicalName() + "." + annotation.validator());
}
return map;
}
}
5 changes: 3 additions & 2 deletions report-ng/app/src/components/method-details/method.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@
>
<span class="badge status-failed-expected sr1">@Fails</span>
<div>
<div if.bind="_methodDetails.failsAnnotation.description">${_methodDetails.failsAnnotation.description}</div>
<div if.bind="_methodDetails.failsAnnotation.ticketString">Ticket: <span innerhtml.bind="_methodDetails.failsAnnotation.ticketString|html"></span></div>
<div if.bind="_methodDetails.failsAnnotation.description&&7!= _methodDetails.methodContext.resultStatus">${_methodDetails.failsAnnotation.description}</div>
<div if.bind="_methodDetails.failsAnnotation.ticketString&&7!= _methodDetails.methodContext.resultStatus">Ticket: <span innerhtml.bind="_methodDetails.failsAnnotation.ticketString|html"></span></div>
<div if.bind="_methodDetails.failsAnnotation.validator&&7== _methodDetails.methodContext.resultStatus">Your conditions for Expected fails were not fulfilled: <br> ${_methodDetails.failsAnnotation.validator}</div>
</div>
</div>
<mdc-list-divider if.bind="_methodDetails.failsAnnotation"></mdc-list-divider>
Expand Down