From a6de3e68868910e281d12d3c6c9e35a7ecc3954b Mon Sep 17 00:00:00 2001 From: Miguel Reboiro-Jato Date: Tue, 19 Apr 2016 13:11:42 +0200 Subject: [PATCH] Adds a test to the modify method in PeopleResourceUnitTest class This test was unintentionally leaved out when creating the test case. --- .../uvigo/esei/daa/rest/PeopleResourceUnitTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/java/es/uvigo/esei/daa/rest/PeopleResourceUnitTest.java b/src/test/java/es/uvigo/esei/daa/rest/PeopleResourceUnitTest.java index 1e7d8af..5cb7565 100644 --- a/src/test/java/es/uvigo/esei/daa/rest/PeopleResourceUnitTest.java +++ b/src/test/java/es/uvigo/esei/daa/rest/PeopleResourceUnitTest.java @@ -193,6 +193,18 @@ public class PeopleResourceUnitTest { assertThat(response, hasBadRequestStatus()); } + @Test + public void testModifyNullPointerException() throws Exception { + daoMock.modify(anyObject()); + expectLastCall().andThrow(new NullPointerException()); + + replay(daoMock); + + final Response response = resource.modify(existentId(), newName(), newSurname()); + + assertThat(response, hasBadRequestStatus()); + } + @Test public void testAdd() throws Exception { expect(daoMock.add(newName(), newSurname())) -- 2.18.1