Skip to content

Commit

Permalink
Make displayName optional just in case not every engine provides one
Browse files Browse the repository at this point in the history
  • Loading branch information
MaisiKoleni committed Mar 24, 2022
1 parent c08f7bd commit 582371d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/main/java/de/tum/in/test/api/internal/TestContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public abstract class TestContext {

public abstract Optional<Object> testInstance();

public abstract String displayName();
public abstract Optional<String> displayName();

public abstract Optional<AnnotatedElement> annotatedElement();

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/de/tum/in/test/api/jqwik/JqwikContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public Optional<AnnotatedElement> annotatedElement() {
}

@Override
public String displayName() {
return lifecycleContext.label();
public Optional<String> displayName() {
return Optional.of(lifecycleContext.label());
}

public PropertyLifecycleContext getPropertyLifecycleContext() {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/de/tum/in/test/api/jupiter/JupiterContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public Optional<AnnotatedElement> annotatedElement() {
}

@Override
public String displayName() {
return extensionContext.getDisplayName();
public Optional<String> displayName() {
return Optional.of(extensionContext.getDisplayName());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ public Optional<Object> testInstance() {
}

@Override
public String displayName() {
return "Some test";
public Optional<String> displayName() {
return Optional.of("Some test");
}

@Override
Expand Down

0 comments on commit 582371d

Please sign in to comment.