### Question:
WirecardNotificationsController { @RequestMapping(value = "/paymentnotifications", method = RequestMethod.POST) public void processNotification(@RequestBody String content, HttpServletResponse httpServletResponse) { LOG.info(START_MESSAGE); if (LOG.isDebugEnabled()) { LOG.debug(NOTIFICATION_MESSAGE, TRIM_NEW_LINE.matcher(content).replaceAll("")); } try { if (content != null) { Payment payment = wirecardHopPaymentOperationsFacade.parseMessage(content, true, true); PaymentOperationData data = new PaymentOperationData(); data.setPayment(payment); wirecardHopPaymentOperationsFacade.executePaymentOperation(WirecardPaymentTransactionConstants.NOTIFICATION, data, payment.getOrderNumber()); httpServletResponse.setStatus(HttpServletResponse.SC_OK); } } catch (WirecardPaymenException ex) { httpServletResponse.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); LOG.error("Payment operation failed.", ex); } }  @RequestMapping(value = "/paymentnotifications", method = RequestMethod.POST) void processNotification(@RequestBody String content, HttpServletResponse httpServletResponse);  }### Answer:
@Test public void testProcessNotification() { wirecardNotificationController.processNotification(source, httpServletResponse); Assert.assertNull("the source is null", source); Assert.assertEquals("the response isn't success", httpServletResponse.getStatus(), HttpServletResponse.SC_OK); }
@Test public void testExceptionProcessNotification() throws WirecardPaymenException { when(wirecardHopPaymentOperationsFacade.executePaymentOperation(WirecardPaymentTransactionConstants.NOTIFICATION, Mockito.anyObject(), Mockito.anyString())) .thenThrow(WirecardPaymenException.class); wirecardNotificationController.processNotification(source, httpServletResponse); Assert.assertEquals("the response isn't success", httpServletResponse.getStatus(), HttpServletResponse.SC_INTERNAL_SERVER_ERROR); }