Glucose testing

What determines if you have gestational diabetes? Overall, I eat really healthy but I’ve gained about 20 lbs and I’m 22 weeks. I’m worried because I crave soda and a lot of it. Would drinking a lot of soda cause it?