To my knowledge, Germany has only invaded China on one occasion: In 1897, in response to the Juye Incident (in which German missionaries were killed in China), German naval forces captured Jiaozhou Bay. The German government soon changed their mind and stopped trying to take new territory in China, but by that point Jiaozhou Bay was already fully in German hands, so it ended up being granted a lease by the Chinese government, planned to be active until 1997. The lease was canceled in 1914 with the outbreak of World War I.
It's not clear that Germany actually benefited in any way from this acquisition; it was mostly done as revenge against the killing of Germany missionaries. It did serve as a somewhat useful naval base in the Pacific.