BALE-707 Refactoring changes (#1418)

* BAEL-707 Add the changes as per review comment

* BAEL-707 Refactored the code as per review comments
This commit is contained in:
baljeet20
2017-03-16 14:32:00 +05:30
committed by maibin
parent d1233d0437
commit de29f6af4b
6 changed files with 9 additions and 71 deletions
@@ -6,7 +6,6 @@ import org.jibx.runtime.IUnmarshallingContext;
import org.jibx.runtime.JiBXException;
import org.junit.Test;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
@@ -22,8 +21,7 @@ public class CustomerTest {
InputStream inputStream = classLoader.getResourceAsStream("Customer1.xml");
Customer customer = (Customer) uctx.unmarshalDocument(inputStream, null);
assertEquals("Stefan", customer.getPerson().getFirstName());
assertEquals("Jaeger", customer.getPerson().getLastName());
assertEquals("Stefan Jaegar", customer.getPerson().getName());
assertEquals("Davos Dorf", customer.getCity());
}
@@ -47,9 +45,7 @@ public class CustomerTest {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
InputStream inputStream = classLoader.getResourceAsStream("Customer1.xml");
Customer customer = (Customer) uctx.unmarshalDocument(inputStream, null);
assertEquals("1", customer.getHomePhone().getCountryCode());
assertEquals("234", customer.getHomePhone().getNetworkPrefix());
assertEquals("234678", customer.getHomePhone().getNumber());
}
+1 -6
View File
@@ -2,18 +2,13 @@
<customer>
<person>
<customer-id>12345</customer-id>
<first-name>Stefan</first-name>
<last-name>Jaeger</last-name>
<name>Stefan Jaeger</name>
</person>
<home-phone>
<country-code>1</country-code>
<network-prefix>234</network-prefix>
<number>234678</number>
</home-phone>
<office-phone>
<country-code>1</country-code>
<network-prefix>234</network-prefix>
<number>234678</number>
</office-phone>
<city>Davos Dorf</city>