### Question:
EbmsMessageHistoryService extends WebServicesAdaptor { private String checkMessageStatus(String input)throws SOAPRequestException{ if(input !=null && !(input.equalsIgnoreCase(MessageClassifier.INTERNAL_STATUS_RECEIVED) || input.equalsIgnoreCase(MessageClassifier.INTERNAL_STATUS_PENDING) || input.equalsIgnoreCase(MessageClassifier.INTERNAL_STATUS_PROCESSING) || input.equalsIgnoreCase(MessageClassifier.INTERNAL_STATUS_PROCESSED) || input.equalsIgnoreCase(MessageClassifier.INTERNAL_STATUS_PROCESSED_ERROR) || input.equalsIgnoreCase(MessageClassifier.INTERNAL_STATUS_DELIVERED) || input.equalsIgnoreCase(MessageClassifier.INTERNAL_STATUS_DELIVERY_FAILURE))){ String errMsg = "No such message status, you have entered ["+input+"]"; throw new SOAPRequestException(errMsg); }else{ return (input==null?input:input.toUpperCase()); } }  void serviceRequested(WebServicesRequest request, WebServicesResponse response); static int MAX_NUMBER; static String NAMESPACE; }### Answer:
@Test public void checkMessageStatus()throws Exception{ Method m = Class.forName("hk.hku.cecid.ebms.spa.service.EbmsMessageHistoryService"). getDeclaredMethod("checkMessageStatus", new Class[] {String.class}); m.setAccessible(true); Assert.assertEquals(null, m.invoke(historyService, new Object[] {null})); Assert.assertEquals(MessageClassifier.INTERNAL_STATUS_DELIVERED, m.invoke(historyService, new Object[] {"DL"})); Assert.assertEquals(MessageClassifier.INTERNAL_STATUS_DELIVERY_FAILURE, m.invoke(historyService, new Object[] {"DF"})); Assert.assertEquals(MessageClassifier.INTERNAL_STATUS_PENDING, m.invoke(historyService, new Object[] {"PD"})); Assert.assertEquals(MessageClassifier.INTERNAL_STATUS_RECEIVED, m.invoke(historyService, new Object[] {"RC"})); Assert.assertEquals(MessageClassifier.INTERNAL_STATUS_PROCESSING, m.invoke(historyService, new Object[] {"PR"})); Assert.assertEquals(MessageClassifier.INTERNAL_STATUS_PROCESSED, m.invoke(historyService, new Object[] {"PS"})); Assert.assertEquals(MessageClassifier.INTERNAL_STATUS_PROCESSED_ERROR, m.invoke(historyService, new Object[] {"PE"})); }