22
33import static org .junit .Assert .assertEquals ;
44
5- import org .junit .Before ;
6- import org .junit .Test ;
7-
85import java .util .Map ;
96
107import javax .xml .namespace .QName ;
118import javax .xml .ws .Service ;
129import javax .xml .ws .soap .SOAPBinding ;
1310
14- import com .baeldung .cxf .introduction .Baeldung ;
15- import com .baeldung .cxf .introduction .Student ;
16- import com .baeldung .cxf .introduction .StudentImpl ;
11+ import org .junit .Before ;
12+ import org .junit .Test ;
1713
18- public class StudentTest {
14+ public class StudentLiveTest {
1915 private static QName SERVICE_NAME = new QName ("http://introduction.cxf.baeldung.com/" , "Baeldung" );
2016 private static QName PORT_NAME = new QName ("http://introduction.cxf.baeldung.com/" , "BaeldungPort" );
2117
@@ -25,7 +21,7 @@ public class StudentTest {
2521
2622 {
2723 service = Service .create (SERVICE_NAME );
28- String endpointAddress = "http://localhost:8080 /baeldung" ;
24+ final String endpointAddress = "http://localhost:8082/cxf-introduction /baeldung" ;
2925 service .addPort (PORT_NAME , SOAPBinding .SOAP11HTTP_BINDING , endpointAddress );
3026 }
3127
@@ -37,28 +33,28 @@ public void reinstantiateBaeldungInstances() {
3733
3834 @ Test
3935 public void whenUsingHelloMethod_thenCorrect () {
40- String endpointResponse = baeldungProxy .hello ("Baeldung" );
41- String localResponse = baeldungImpl .hello ("Baeldung" );
36+ final String endpointResponse = baeldungProxy .hello ("Baeldung" );
37+ final String localResponse = baeldungImpl .hello ("Baeldung" );
4238 assertEquals (localResponse , endpointResponse );
4339 }
4440
4541 @ Test
4642 public void whenUsingHelloStudentMethod_thenCorrect () {
47- Student student = new StudentImpl ("John Doe" );
48- String endpointResponse = baeldungProxy .helloStudent (student );
49- String localResponse = baeldungImpl .helloStudent (student );
43+ final Student student = new StudentImpl ("John Doe" );
44+ final String endpointResponse = baeldungProxy .helloStudent (student );
45+ final String localResponse = baeldungImpl .helloStudent (student );
5046 assertEquals (localResponse , endpointResponse );
5147 }
5248
5349 @ Test
5450 public void usingGetStudentsMethod_thenCorrect () {
55- Student student1 = new StudentImpl ("Adam" );
51+ final Student student1 = new StudentImpl ("Adam" );
5652 baeldungProxy .helloStudent (student1 );
5753
58- Student student2 = new StudentImpl ("Eve" );
54+ final Student student2 = new StudentImpl ("Eve" );
5955 baeldungProxy .helloStudent (student2 );
60-
61- Map <Integer , Student > students = baeldungProxy .getStudents ();
56+
57+ final Map <Integer , Student > students = baeldungProxy .getStudents ();
6258 assertEquals ("Adam" , students .get (1 ).getName ());
6359 assertEquals ("Eve" , students .get (2 ).getName ());
6460 }
0 commit comments