package br.usp.choreos.examples.auctionhouse;

import javax.xml.ws.Endpoint;

import org.junit.Test;

import br.usp.ime.choreos.vv.WSClient;

public class AuctionHouseWSTest {
    @Test
    public void shouldPublishTheRightWS() throws Exception {
	AuctionHouseWS auctionHouseWS = new AuctionHouseWS();
	Endpoint endpoint = Endpoint.create(auctionHouseWS);
	endpoint.publish("http://localhost:6166/AuctionHouseService");
	
	WSClient wsClient = new WSClient("http://localhost:6166/AuctionHouseService?wsdl");
	wsClient.request("publishAuction", "test_headline", "test_description", "1");
    }
}

@@ -40,16 +40,62 @@
 house;%0A%0A
+import static org.junit.Assert.assertEquals;%0A%0A
 import j
@@ -113,24 +113,49 @@
 .Endpoint;%0A%0A
+import org.junit.Before;%0A
 import org.j
@@ -162,24 +162,67 @@
 unit.Test;%0A%0A
+import br.usp.ime.choreos.vv.ResponseItem;%0A
 import br.us
@@ -291,53 +291,69 @@
     
-@Test%0A    public void shouldPublishTheRightWS
+private WSClient wsClient;%0A%0A    @Before%0A    public void setUp
 () t
@@ -546,25 +546,16 @@
 e%22);%0A%09%0A%09
-WSClient 
 wsClient
@@ -625,84 +625,305 @@
 %22);%0A
-%09wsClient.request(%22publishAuction%22, %22test_headline%22, %22test_description%22, %221%22
+    %7D%0A    %0A    @Test%0A    public void firstRequestShouldReturnTheFirstId() throws Exception %7B%0A%09ResponseItem responseItem = wsClient.request(%22publishAuction%22, %22test_headline%22, %22test_description%22, %221%22);%0A%09int auctionId = responseItem.getChild(%22auctionId%22).getContentAsInt();%0A%09assertEquals(0, auctionId
 );%0A 

Refactor test.