Created
August 11, 2013 13:04
-
-
Save desireesantos/6204801 to your computer and use it in GitHub Desktop.
PdfFactoryTest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.trailblazers.freewheelers.model; | |
import com.itextpdf.text.Document; | |
import static org.mockito.Mockito.verify; | |
import com.itextpdf.text.pdf.PdfWriter; | |
import org.junit.Test; | |
import static org.mockito.Mockito.mock; | |
import static org.mockito.Mockito.when; | |
public class PdfFactoryTest { | |
@Test | |
public void shouldGetPdfInstance() throws Exception { | |
//Given | |
PdfFactory pdfFactory = mock(PdfFactory.class); | |
Document mockPdf = mock(Document.class); | |
ReserveOrder mockReserveOrder = mock(ReserveOrder.class); | |
PdfWriter mockPdfWriter = mock(PdfWriter.class); | |
when(pdfFactory.getPdfWriter()).thenReturn(mockPdfWriter); | |
//When | |
pdfFactory.create(mockPdf, mockReserveOrder); | |
//Then | |
verify(pdfFactory.getPdfWriter()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment