### Question:
HelloWorldImpl implements HelloWorldPortType { @Override public Greeting sayHello(Person person) { String firstName = person.getFirstName(); LOGGER.debug("firstName={}", firstName); String lasttName = person.getLastName(); LOGGER.debug("lastName={}", lasttName); ObjectFactory factory = new ObjectFactory(); Greeting response = factory.createGreeting(); String greeting = "Hello " + firstName + " " + lasttName + "!"; LOGGER.info("greeting={}", greeting); response.setText(greeting); return response; }  @Override Greeting sayHello(Person person);  }### Answer:
@Test public void testSayHello() { Person person = new Person(); person.setFirstName("John"); person.setLastName("Doe"); assertEquals("Hello John Doe!", helloWorldClient.sayHello(person)); }
@Test public void testSayHelloUnknownUser() { Person person = new Person(); person.setFirstName("Jon"); person.setLastName("Doe"); helloWorldClient.setCredentials("jon.doe", "source4code"); try { helloWorldClient.sayHello(person); fail("unknown user should fail"); } catch (SOAPFaultException soapFaultException) { assertEquals( "Authentication failed (details can be found in server log)", soapFaultException.getFault().getFaultString()); } }
@Test public void testSayHelloIncorrectPassword() { Person person = new Person(); person.setFirstName("John"); person.setLastName("Doe"); helloWorldClient.setCredentials("john.doe", "sourceFOURcode"); try { helloWorldClient.sayHello(person); fail("incorrect password should fail"); } catch (SOAPFaultException soapFaultException) { assertEquals( "Authentication failed (details can be found in server log)", soapFaultException.getFault().getFaultString()); } }
@Test public void testSayHello() { Person person = new Person(); person.setLastName("Doe"); String firstNameMedium = TestHelper.generateLongName("John", 512); person.setFirstName(firstNameMedium); assertEquals("Hello " + firstNameMedium + " Doe!", helloWorldClient.sayHello(person)); person.setFirstName("John"); assertEquals("Hello John Doe!", helloWorldClient.sayHello(person)); String firstNameLarge = TestHelper.generateLongName("John", 1024); person.setFirstName(firstNameLarge); assertEquals("Hello " + firstNameLarge + " Doe!", helloWorldClient.sayHello(person)); }
@Test public void testSayHello() { Person person = new Person(); person.setFirstName("Jane"); person.setLastName("Doe"); assertEquals("Hello Jane Doe!", helloWorldClientBean.sayHello(person)); }
@Test public void testSayHelloProxy() { Person person = new Person(); person.setFirstName("Jane"); person.setLastName("Doe"); Greeting greeting = helloWorldRequesterProxy.sayHello(person); assertEquals("Hello Jane Doe!", greeting.getText()); }