After testing for the role last weekend, Ansel Elgort has been tapped to star alongside his “Divergent” co-star Shailene Woodley in Fox’s adaptation of “The Fault in Our Stars.”

Josh Boone is on board to direct the adaptation based on John Green’s book. EW.com broke the news.

Scott Neustadter and Michael Weber adapted the script with Temple Hill Entertainment’s Wyck Godfrey and Marty Bowen producing.

Story follows two young cancer patients who fall for each other during treatment.

Elgort beat out Brenton Thwaites, Nat Wolff, Nick Robinson and Noah Silver for the role of Augustus “Gus” Waters, the former basketball player who lost his leg to cancer and meets Woodley’s character in a cancer support group.

Elgort is is repped by CAA and Brookside Artist Management and besides “Divergent,” can also be seen in MGM’s “Carrie” remake.