Skip to content

Commit

Permalink
Fixed an issue where the @Managed driver assigned to an actor was ove…
Browse files Browse the repository at this point in the history
…rrided by the default driver.
  • Loading branch information
wakaleo committed Dec 19, 2017
1 parent 4751c9d commit 6da7305
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ public class OnlineCast extends Cast {

@Override
public Actor actorNamed(String actorName, Ability... abilities) {

Actor newActor = super.actorNamed(actorName, abilities);
return newActor.can(BrowseTheWeb.with(theDefaulteBrowserFor(actorName)));
if (newActor.abilityTo(BrowseTheWeb.class) == null) {
newActor.can(BrowseTheWeb.with(theDefaulteBrowserFor(actorName)));
}
return newActor;
}

public BrowsingActorBuilder actorUsingBrowser(String driver) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public Actor shineSpotlightOn(String actorName) {
.filter(actor -> actor.getName().equalsIgnoreCase(actorName))
.findFirst();

actorInTheSpotlight = knownActor.orElse(cast.actorNamed(actorName));;
actorInTheSpotlight = knownActor.orElseGet(() -> cast.actorNamed(actorName));
return theActorInTheSpotlight();
}

Expand Down

0 comments on commit 6da7305

Please sign in to comment.