### Question:
PeriodicTableAccessWS implements PeriodicTableAccess { @Override @WebMethod(action = "http: @WebResult(name = "element", targetNamespace = "") @RequestWrapper(localName = "getElementByAtomicNumber", targetNamespace = "http: @ResponseWrapper(localName = "getElementByAtomicNumberResponse", targetNamespace = "http: public Element getElementByAtomicNumber( @WebParam(name = "atomicNumber", targetNamespace = "") int atomicNumber) throws ElementNotFound_Exception { logger.info("Entering: getElementByAtomicNumber()" + periodicTableService); try { com.example.periodictable.Element element = periodicTableService.getElementByAtomicNumber(atomicNumber); return mapper.map(element, Element.class); } catch (ElementNotFoundException e) { ElementNotFound faultInfo = new ElementNotFound(); faultInfo.setMessage(String.valueOf(atomicNumber)); faultInfo.setValue(atomicNumber); throw new ElementNotFound_Exception(e.getMessage(), faultInfo); } }  @Override @WebMethod(action = "http://www.example.org/periodictableaccess/getAllElements") @WebResult(name = "elements", targetNamespace = "") @RequestWrapper(localName = "getAllElements", targetNamespace = "http://www.example.org/periodictableaccess/", className = "com.example.periodictable.ws.access.GetAllElements") @ResponseWrapper(localName = "getAllElementsResponse", targetNamespace = "http://www.example.org/periodictableaccess/", className = "com.example.periodictable.ws.access.GetAllElementsResponse") List<Element> getAllElements(); @Override @WebMethod(action = "http://www.example.org/periodictableaccess/getElementByAtomicNumber") @WebResult(name = "element", targetNamespace = "") @RequestWrapper(localName = "getElementByAtomicNumber", targetNamespace = "http://www.example.org/periodictableaccess/", className = "com.example.periodictable.ws.access.GetElementByAtomicNumber") @ResponseWrapper(localName = "getElementByAtomicNumberResponse", targetNamespace = "http://www.example.org/periodictableaccess/", className = "com.example.periodictable.ws.access.GetElementByAtomicNumberResponse") Element getElementByAtomicNumber(
        @WebParam(name = "atomicNumber", targetNamespace = "")
        int atomicNumber);  }### Answer:
@Test public void testGetElementByAtomicNumber() throws ElementNotFoundException, ElementNotFound_Exception { com.example.periodictable.ElementCategory elCat = new com.example.periodictable.ElementCategory(1, "NOBLE_GAS", "Noble gas"); com.example.periodictable.Element el = new com.example.periodictable.Element(2, 2, "", "He", elCat); when(periodicTableService.getElementByAtomicNumber(2)).thenReturn(el); Element element = periodicTableWS.getElementByAtomicNumber(2); verify(periodicTableService, times(1)).getElementByAtomicNumber(anyInt()); assertEquals(element.getAtomicNumber(), 2); }
@Test(expected = ElementNotFound_Exception.class) public void testGetElementByAtomicNumber_ElementNotFound() throws ElementNotFoundException, ElementNotFound_Exception { com.example.periodictable.ElementNotFoundException ex = new ElementNotFoundException(""); when(periodicTableService.getElementByAtomicNumber(2)).thenThrow(ex); Element element = periodicTableWS.getElementByAtomicNumber(2); }