Created
June 17, 2015 14:16
-
-
Save panayotkulchev/db7d8da768fafc9f9e3a to your computer and use it in GitHub Desktop.
First test of clouway-hr
This file contains hidden or 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
public class RestfulWebServiceTest { | |
@Rule | |
public JUnitRuleMockery context = new JUnitRuleMockery(); | |
@Mock | |
Request request; | |
@Mock | |
VacationRepository vacationRepository; | |
@Test | |
public void approveVacation() { | |
final String vacationId = "123"; | |
final String status = "approved"; | |
RestfulWebService service = new RestfulWebService(vacationRepository); | |
context.checking(new Expectations() {{ | |
oneOf(vacationRepository).updateStatus(vacationId, status); | |
}}); | |
Reply<Object> reply = service.approveVacation(request, vacationId, status); | |
assertThat(reply, is(Reply.saying().ok())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment