Germany will play fellow World Cup finalists Cameroon ahead of the tournament in Brazil, the German football federation DFB said Friday.
The match will be played in Moenchengladbach on June 1. Cameroon is coached by German Volker Finke.
Germany, who is in a World Cup group with Ghana, as well as Portugal and the United States, wanted a pre-tournament test against an African side.
Coach Joachim Loew is looking for a further opponent for a friendly in Mainz on June 6, a day before the squad leaves for Brazil.
Germany already has friendlies against Chile in Stuttgart on March 5 and Poland in Hamburg on May 13.
Cameroon is in a group at the June 12—July 13 World Cup with hosts Brazil, Croatia and Mexico.