Do you have ne of these guys?
One is electric or electronic cut off and the other is the preset thermostat. They both are spring loaded to the tank proper, they both utilize the bi-metallic process. One piece of metal contracts or expands at a different temperature, hence the switching on/off process is accomplished.
These guys are normally in a closed state to allow the heater to come on and heat until the temperature is reached. When one or the other gets to temperature the bi-metallic strip opens and shuts the system down.
You can remove them and check them with a VOM. They will show continuity until you make them open. Submerge them in boiling water, you should hear it snap open. Might even be able to open them with heavy duty hair dryer or heat gun. At any rate they need to open.
You can leave them in place and disconnect one at a time and see if the heater shuts down.
These things aren't rocket science so don't let the local RV guy get rich on you. Amazon has them, eBay has them as well.
2013 Voltage 3800, 2012 Chevy 3500 HD
2010 Yamaha V Star 950
2009 Yamaha Raider
Volunteering with Habitat for Humanity Caravanners