Last active
May 27, 2016 16:45
-
-
Save diegoicosta/0ec2fca2cf3d1cd17c81a818bec1aac0 to your computer and use it in GitHub Desktop.
Monkito - Verfificando parâmentros que passaram por um mock
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
@InjectMocks | |
private MoipAccountTransferExecutor executor; | |
@Mock | |
private SchedulingService schedulingService; | |
/** | |
* schedulingService é o mock que irá receber List<Scheduling>. | |
* Saber quantos elementos tem nesta lista é importante para saber se | |
* a transfer entre constas moip irá gerar a quantidade correta de entries | |
**/ | |
@Test | |
public void scheduleOnlyDebitWhenReceiverExistsButMethodEmail() throws Exception { | |
TransferParams params = buildTransferParams(TransferMethod.EMAIL); | |
executor.scheduleIt(params, new MoipAccountTransfer()); | |
ArgumentCaptor<List<Scheduling>> argument = ArgumentCaptor | |
.forClass((Class<List<Scheduling>>) (Class) List.class); | |
verify(schedulingService).process(argument.capture()); | |
Assert.assertEquals(1, argument.getValue().size()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment