"Most cases of peptic ulcers and gastritis are caused by H. pylori, not spicy food and stress and spicy food as many thought until the 1990s. These conditions are now widely treated with antibiotics effective against the bacteria.
Just remember, not ALL cases, only most. The gastrointestinologists test for it, and if it's not there, then your ulcer is caused by something else.
I remember the scorn heaped on the first researcher to say that ulcers were caused by bacteria. He overturned a lot of received wisdom.