Två afghanska män i Tyskland döms till fängelse i mellan fyra och fem år för att ha planerat ett terrordåd mot Sveriges riksdag.