Most of the STM32 series has a UART bootloader which can be activated by strapping of the boot mode pins. If you can load code via the UART, and have it communicate with a program on a development machine, that would be a strong indication that the UART works...
If the module it normally talks to is logic level, you'll need a logic level serial (or serial-USB) adapter to connect it to a PC.
In theory you could use JTAG boundary scan (if the documentation of the chip says it is supported) to set or read the state of the UART pins and compare them against an external stimulus or reading. But it's probably simpler to load a test program (possibly into RAM) via the JTAG or SWD (or the UART bootloader mentioned above) to exercise the UART.