}
@SuppressWarnings("unchecked")
@Test
public void send() throws FileNotFoundException {
Forsendelse forsendelse = ForsendelsesArkivTest.createForsendelse( 1 );
File file = FilHenter.getFileAsFile(ForsendelsesArkivTest.testPdf);
forsendelse.setFile(file);
forsendelse.setId(file.getName());
expect( templateEngineMock.merge( isA( Map.class ), same( SubjectTemplate ) ) ).andReturn( SubjectTemplate );
expect( templateEngineMock.merge(isA(Map.class), same(BodyTemplate)) ).andReturn( BodyTemplate );
expect( pdfGeneratorMock.createPdf( isA( Map.class ), same( PdfTemplate ) ) ).andReturn(FilHenter.getFileAsInputStream("test.pdf"));
mailSenderMock.sendEmail(contains(fnr), same(ReplyTo), same(SubjectTemplate), same(BodyTemplate), isA(File[].class));
expectLastCall();