public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof Address)) return false; Address other = (Address) obj; if (obj == null) return false; if (this == obj) return true; if (__equalsCalc != null) { return (__equalsCalc == obj); } __equalsCalc = obj; boolean _equals; _equals = true && ((this.street == null && other.getStreet() == null) || (this.street != null && this.street.equals(other.getStreet()))) && ((this.streetNo == null && other.getStreetNo() == null) || (this.streetNo != null && this.streetNo.equals(other.getStreetNo()))) && ((this.city == null && other.getCity() == null) || (this.city != null && this.city.equals(other.getCity()))) && ((this.county == null && other.getCounty() == null) || (this.county != null && this.county.equals(other.getCounty()))) && ((this.country == null && other.getCountry() == null) || (this.country != null && this.country.equals(other.getCountry()))) && ((this.zipCode == null && other.getZipCode() == null) || (this.zipCode != null && this.zipCode.equals(other.getZipCode()))) && ((this.notes == null && other.getNotes() == null) || (this.notes != null && this.notes.equals(other.getNotes()))) && this.isPrimary == other.isIsPrimary(); __equalsCalc = null; return _equals; }
/** * Accuracy test for the method <code>getCity()</code>.<br> * The value should be properly retrieved. */ @Test public void test_getCity() { String value = "new_value"; instance.setCity(value); assertEquals("'getCity' should be correct.", value, instance.getCity()); }
/** HEADER */ @Override public void initHeader() { String cmpAdd = "<br/><br/><br/><br/><br/>"; Address registeredAddress = company.getRegisteredAddress(); if (registeredAddress != null) { cmpAdd = ("<br><font style=\"font-family:sans-serif; color:#504040;\"> " + forUnusedAddress(registeredAddress.getAddress1(), false) + forUnusedAddress(registeredAddress.getStreet(), false) + forUnusedAddress(registeredAddress.getCity(), false) + forUnusedAddress(registeredAddress.getStateOrProvinence(), false) + forUnusedAddress(registeredAddress.getZipOrPostalCode(), false) + forUnusedAddress(registeredAddress.getCountryOrRegion(), false) + "</font></br>"); } cmpAdd = ("<p><font style=\"font-family:sans-serif;\" size=\"6px\"><strong> " + forNullValue(TemplateBuilder.getCmpName()) + "</strong></font>" + cmpAdd + "</p>"); headerHtml = ("<table style=\"width: 100%; height: 100%;\" cellspacing=\"10\" ><tr><td style=\"vertical-align: top;\" align=\"left\"><div class=\"gwt-HTML\" style=\" margin-left: 43px;\">" + cmpAdd + "</div></td><td style=\"vertical-align: top;\" align=\"right\"><div class=\"gwt-HTML\" style=\" margin-right: 43px;\"><p ><font color=\"black\" style=\"font-family:sans-serif;\" size=\"6px\"><strong>Credit Note</strong></font></p><div><table style=\"width:306px;font-size: 13px; border-collapse: collapse; table-layout: fixed; font-family: sans-serif;\"><colgroup><col></colgroup><tr><td style=\"border: 1px ridge grey; padding: 6px; background: #f2f2f2; font-weight: bold; \"> Credit Note Number</td><td align=\"right\" width=\"55%\" style=\"border: 1px ridge grey; padding: 6px;\">" + forNullValue(memo.getNumber()) + "</td></tr><tr><td style=\"border: 1px ridge grey; padding: 6px; background: #f2f2f2; font-weight: bold; \">Credit Note Date</td><td align=\"right\" width=\"55%\" style=\"border: 1px ridge grey; padding: 6px;\">" + memo.getDate() + "</td></tr><tr><td style=\"border: 1px ridge grey; padding: 6px; background: #f2f2f2; font-weight: bold; \">Customer Number</td><td align=\"right\" width=\"55%\" style=\"border: 1px ridge grey; padding: 6px;\">" + forNullValue(memo.getCustomer().getNumber()) + "</td></tr></table></div></div></td></tr></table>"); }
private void setAddress() { Address addy = new Address(id); street = addy.getStreet(); district = addy.getDistrict(); city = addy.getCity(); province = addy.getProvince(); }
@Test public void testBeanPattern() { Address address = new Address("Danmarksgade 2", "9000", "Aalborg", "dk"); assertEquals("Danmarksgade 2", address.getStreet()); assertEquals("9000", address.getPostalCode()); assertEquals("Aalborg", address.getCity()); assertEquals("dk", address.getCountryCode()); }
public void testMapAndElementCollection() throws Exception { Session session = openSession(); Transaction tx = session.beginTransaction(); Address home = new Address(); home.setCity("Paris"); Address work = new Address(); work.setCity("San Francisco"); User user = new User(); user.getAddresses().put("home", home); user.getAddresses().put("work", work); user.getNicknames().add("idrA"); user.getNicknames().add("day[9]"); session.persist(home); session.persist(work); session.persist(user); User user2 = new User(); user2.getNicknames().add("idrA"); user2.getNicknames().add("day[9]"); session.persist(user2); tx.commit(); session.clear(); tx = session.beginTransaction(); user = (User) session.get(User.class, user.getId()); assertThat(user.getNicknames()).as("Should have 2 nick1").hasSize(2); assertThat(user.getNicknames()).as("Should contain nicks").contains("idrA", "day[9]"); user.getNicknames().remove("idrA"); tx.commit(); session.clear(); tx = session.beginTransaction(); user = (User) session.get(User.class, user.getId()); // TODO do null value assertThat(user.getAddresses()).as("List should have 2 elements").hasSize(2); assertThat(user.getAddresses().get("home").getCity()) .as("home address should be under home") .isEqualTo(home.getCity()); assertThat(user.getNicknames()).as("Should have 1 nick1").hasSize(1); assertThat(user.getNicknames()).as("Should contain nick").contains("day[9]"); session.delete(user); session.delete(session.load(Address.class, home.getId())); session.delete(session.load(Address.class, work.getId())); user2 = (User) session.get(User.class, user2.getId()); assertThat(user2.getNicknames()).as("Should have 2 nicks").hasSize(2); assertThat(user2.getNicknames()).as("Should contain nick").contains("idrA", "day[9]"); session.delete(user2); tx.commit(); session.close(); checkCleanCache(); }
/** test the construction of the object in the ApplicationContext */ public final void testObjectConstruction() { // get a member from the application context Address address = CoreObjectFactory.getAddress(); assertEquals("City", null, address.getCity()); assertEquals("Country", null, address.getCountry()); assertEquals("PostalCode", null, address.getPostalCode()); assertEquals("StreetName", null, address.getStreetName()); assertEquals("StreetNumber", null, address.getStreetNumber()); }
@Test @UsingDataSet({"single-user.xml", "address.yml"}) // Convention over configuration - no need to specify 'datasets' folder public void should_have_address_linked_to_user_account_using_multiple_files() throws Exception { // given String expectedCity = "Metropolis"; UserAccount user = em.find(UserAccount.class, 1L); // when Address address = user.getAddresses().iterator().next(); // then assertThat(user.getAddresses()).hasSize(1); assertThat(address.getCity()).isEqualTo(expectedCity); }
@Test @UsingDataSet("user-with-address.yml") public void should_have_address_linked_to_user_account() throws Exception { // given String expectedCity = "Metropolis"; long userAccountId = 1L; // when UserAccount user = em.find(UserAccount.class, userAccountId); Address address = user.getAddresses().iterator().next(); // then assertThat(user.getAddresses()).hasSize(1); assertThat(address.getCity()).isEqualTo(expectedCity); }
public static void main(String[] args) { Map<String, Person> people = generateExample(); String jayZcity = ""; Person person = people.get("Shawn"); if (person != null) { Address address = person.getAddress(); if (address != null) { jayZcity = address.getCity(); } } if (jayZcity == null || jayZcity.equals("") || jayZcity.length() == 0 || jayZcity.isEmpty()) { jayZcity = "No City Available"; } System.out.println(jayZcity); }
/** FOOTER */ @Override public void initFooter() { String regAdd = " "; Address tradingAddress = company.getTradingAddress(); if (tradingAddress != null) { regAdd = (", Register Address: " + forUnusedAddress(tradingAddress.getAddress1(), true) + forUnusedAddress(tradingAddress.getStreet(), true) + forUnusedAddress(tradingAddress.getCity(), true) + forUnusedAddress(tradingAddress.getStateOrProvinence(), true) + forUnusedAddress(tradingAddress.getZipOrPostalCode(), true) + tradingAddress.getCountryOrRegion() + "."); } regAdd = (company.getTradingName() + regAdd + ((company.getRegistrationNumber() != null && !company.getRegistrationNumber().equals("")) ? "<br/>Company Registration No: " + company.getRegistrationNumber() : "")); footerHtml = ("<table style=\"width: 100%; height: 100%; table-layout:fixed;\" border=\"0\" ><tr><td><table style=\"width: 100%; height: 100%; font-family:sans-serif; color:#505050;\" ><tr><td style=\"vertical-align: top;\" align=\"left\" colspan=\"2\"><table style=\"font-size:13px; width: 105%; height: 100%; margin-left:56px; border-color: #E1E1E1; border-collapse:collapse;\" border=\"1\"><colgroup><col></colgroup><tr><td><center>VAT No : " + forNullValue(company.getPreferences().getVATregistrationNumber()) + "</center></td><td><center>Sort Code : " + forNullValue(company.getSortCode()) + "</center></td><td><center>Bank Account No :" + forNullValue(company.getBankAccountNo()) + "</center></td></tr></table></td></tr><tr><td style=\"vertical-align: top;\" align=\"center\"><table style=\"width: 100%; height: 100%; padding:3.5px\" ><tr><td align=\"right\" style=\"vertical-align: top;\"<table style=\"margin-left:60px;font-size:13px;width: 95%; height: 37px; border : 1px solid #E1E1E1;\"><colgroup><col></colgroup><tr><td><center>" + regAdd + "</center></td> </tr>/tbody></table></td></tr></table></td></tr></table></td><td width=\"10%\" style=\"vertical-align: bottom;\"><div align=\"right\" style=\"margin-bottom:14px;\"><img src=\"footerimage\" width=\"67.5px\" height=\"25px\"></div></td></tr></table>"); }
@Test public void testExampleJson() throws Exception { String json = FileUtil.readFileFromClasspath("json-examples/invoicing-rule-updated-example.json"); JsonMessage jsonMessage = new JsonMessage(json); ServiceResult serviceResult = new ServiceResult(); serviceResult.setRawData(jsonMessage); ServiceResult result = (ServiceResult) transformer.doTransform(serviceResult, "UTF-8"); InvoicingRuleUpdated invoicingRuleCreated = (InvoicingRuleUpdated) result.getIntegrationMessage().getDomainObject(); MetaData metaData = invoicingRuleCreated.getMetaData(); InvoicingRule invoicingRule = invoicingRuleCreated.getInvoicingRule(); List<InvoiceRecipient> invoiceRecipients = invoicingRule.getInvoiceRecipients(); collector.checkThat(invoiceRecipients.size(), is(3)); InvoiceRecipient invoiceRecipient = invoiceRecipients.get(0); Address registeredAddressInvoiceRecipient = invoiceRecipient.getRegisteredAddress(); List<SplittingRule> splittingRules = invoiceRecipients.get(2).getSplittingRules(); collector.checkThat(splittingRules.size(), is(3)); SplittingRule splittingRule = splittingRules.get(0); List<PurchaseOrder> purchaseOrders = invoicingRule.getPurchaseOrders(); collector.checkThat(purchaseOrders.size(), is(3)); PurchaseOrder purchaseOrder = purchaseOrders.get(0); List<InvoicingRuleMessageRule> invoiceMessageRules = invoicingRule.getInvoiceMessageRules(); collector.checkThat(invoiceMessageRules.size(), is(1)); InvoicingRuleMessageRule invoiceMessageRule = invoiceMessageRules.get(0); collector.checkThat(metaData.getMessageType(), is("UpdateInvoicingRule")); collector.checkThat( metaData.getMessageId().getGuid(), is("28b62635-15a0-b15e-c5f4-5442b66d1059")); collector.checkThat( metaData.getCreationTime().getTimestamp(), is("2012-07-05T13:21:00.000+02:00")); collector.checkThat(metaData.getVersion(), is("1.0")); collector.checkThat(metaData.getSourceSystem(), is("CRM")); collector.checkThat(invoicingRule.getClientId(), is("TELIA")); collector.checkThat(invoicingRule.getMarketId().getOrganizationId(), is(51)); collector.checkThat( invoicingRule.getInvoicingRuleId().getGuid(), is("3f2504e0-4f89-11d3-9a0c-0305e82c3405")); collector.checkThat(invoicingRule.getInvoicingRuleName(), is("Volvo - do not edit")); collector.checkThat(invoicingRule.getDescription(), is("Used in unit tests - do not edit")); collector.checkThat(invoicingRule.getIssuerReference(), is("Maria Lind")); collector.checkThat(invoicingRule.getClientReference(), is("Lasse Volvosson")); collector.checkThat(invoicingRule.getCurrencyCode().getCurrencyCode(), is("EUR")); collector.checkThat(invoicingRule.getDistributionMode().getValue(), is(1)); collector.checkThat(invoicingRule.getTermsOfPayment().getDays(), is(30)); collector.checkThat(invoicingRule.getPostingProfile().getValue(), is(1)); collector.checkThat(invoicingRule.isDisplayTradeDoublerCommission(), is(true)); collector.checkThat(invoicingRule.getRevenueType().getValue(), is(1)); collector.checkThat(invoicingRule.getPaymentMethod().getValue(), is(2)); collector.checkThat(invoicingRule.isDeviatingExchangeRate(), is(false)); collector.checkThat( invoiceRecipient.getInvoiceRecipientId().getGuid(), is("703b123f-6329-4d79-bfaa-60762a5f6cf4")); collector.checkThat( invoiceRecipient.getInvoicingRuleId().getGuid(), is("3f2504e0-4f89-11d3-9a0c-0305e82c3405")); collector.checkThat(invoiceRecipient.getAttentionRow1(), is("Attention of default recipient!")); collector.checkThat(invoiceRecipient.getAttentionRow2(), nullValue()); collector.checkThat(invoiceRecipient.getEmailAddress(), nullValue()); collector.checkThat(invoiceRecipient.isDefaultRecipient(), is(true)); collector.checkThat(registeredAddressInvoiceRecipient.getLine1(), is("AVD. 50090 HB3S")); collector.checkThat(registeredAddressInvoiceRecipient.getLine2(), nullValue()); collector.checkThat(registeredAddressInvoiceRecipient.getCity(), is("Göteborg")); collector.checkThat(registeredAddressInvoiceRecipient.getCounty(), nullValue()); collector.checkThat(registeredAddressInvoiceRecipient.getPostalCode(), is("40531")); collector.checkThat(registeredAddressInvoiceRecipient.getCountryCode().getValue(), is("SE")); collector.checkThat(registeredAddressInvoiceRecipient.getAddressType().getValue(), is(1)); collector.checkThat( splittingRule.getSplittingRuleId().getGuid(), is("8f756919-c9ed-e111-8b5b-005056b45da6")); collector.checkThat( splittingRule.getInvoiceRecipientId().getGuid(), is("3ac9520d-c9ed-e111-8b5b-005056b45da6")); collector.checkThat(splittingRule.getSplitter(), is("kjhh567855")); collector.checkThat( purchaseOrder.getInvoicingRuleId().getGuid(), is("3f2504e0-4f89-11d3-9a0c-0305e82c3405")); collector.checkThat(purchaseOrder.getPoNumber(), is("234 - do not edit")); collector.checkThat( purchaseOrder.getPurchaseOrderId().getGuid(), is("00000000-0000-0000-4000-100000000001")); collector.checkThat( purchaseOrder.getValidFrom().getTimestamp(), is("2012-08-15T00:00:00.000+02:00")); collector.checkThat( purchaseOrder.getValidTo().getTimestamp(), is("2012-08-17T00:00:00.000+02:00")); collector.checkThat( invoiceMessageRule.getInvoiceMessageRuleId().getGuid(), is("00000000-0000-0000-3000-100000000001")); collector.checkThat( invoiceMessageRule.getInvoicingRuleId().getGuid(), is("3f2504e0-4f89-11d3-9a0c-0305e82c3405")); collector.checkThat( invoiceMessageRule.getMessageText(), is("This is a text to be printed on all invoices for this invoicing rule")); collector.checkThat( invoiceMessageRule.getValidFrom().getTimestamp(), is("2012-08-13T00:00:00.000+02:00")); collector.checkThat( invoiceMessageRule.getValidTo().getTimestamp(), is("2012-08-30T00:00:00.000+02:00")); }
@Test public void testExampleJson() throws Exception { String json = FileUtil.readFileFromClasspath("json-examples/client-updated-example.json"); JsonMessage jsonMessage = new JsonMessage(json); ServiceResult serviceResult = new ServiceResult(); serviceResult.setRawData(jsonMessage); ServiceResult transformedServiceResult = (ServiceResult) transformer.doTransform(serviceResult, "UTF-8"); ClientUpdated clientUpdated = (ClientUpdated) transformedServiceResult.getIntegrationMessage().getDomainObject(); MetaData metaData = clientUpdated.getMetaData(); collector.checkThat(metaData.getMessageType(), is("UpdateClient")); collector.checkThat( metaData.getMessageId().getGuid(), is("54d7887f-481a-62f6-5b41-3f33f46ec478")); collector.checkThat( metaData.getCreationTime().getTimestamp(), is("2012-07-07T12:52:20.000+02:00")); collector.checkThat(metaData.getVersion(), is("1.0")); collector.checkThat(metaData.getSourceSystem(), is("CRM")); Client client = clientUpdated.getClient(); collector.checkThat(client.getClientId(), is("Cl42824050")); collector.checkThat(client.getBusinessFormCode(), is("")); collector.checkThat(client.getCompanyRegistrationNumber(), is("556284-2319")); collector.checkThat(client.getInvoiceLanguage().getLanguageCode(), is("SV")); collector.checkThat(client.getRegisteredCompanyName(), is("Kentor IT AB")); collector.checkThat(client.getVatNumber(), is("SE556284231901")); collector.checkThat(client.getClientType(), is(ClientType.ADVERTISER)); List<Bank> bankAccounts = client.getBankAccounts(); collector.checkThat(bankAccounts.size(), is(1)); Bank bank = bankAccounts.get(0); collector.checkThat(bank.getAccountOwner(), is("Account Owner Example")); collector.checkThat(bank.getBankAccount(), is("4242424242")); collector.checkThat(bank.getBankCode(), is("SWEDSESS")); collector.checkThat(bank.getClientId(), is("Cl42824050")); collector.checkThat(bank.getMarketId().getOrganizationId(), is(51)); List<ClientMessageRule> invoiceMessageRules = client.getInvoiceMessageRules(); collector.checkThat(invoiceMessageRules.size(), is(1)); ClientMessageRule clientMessageRule = invoiceMessageRules.get(0); collector.checkThat(clientMessageRule.getClientId(), is("Cl42824050")); collector.checkThat( clientMessageRule.getInvoiceMessageRuleId().getGuid(), is("face8421-11f1-4684-1769-3478152e5597")); collector.checkThat( clientMessageRule.getMessageText(), is("This is a text to be printed on all invoices for this client")); collector.checkThat( clientMessageRule.getValidFrom().toString(), is("2012-06-25T00:00:00.000+01:00")); collector.checkThat( clientMessageRule.getValidTo().toString(), is("2012-08-30T00:00:00.000+01:00")); List<Market> marketIds = client.getMarketIds(); collector.checkThat(marketIds.size(), is(1)); collector.checkThat(marketIds.get(0).getOrganizationId(), is(51)); Address registeredAddress = client.getRegisteredAddress(); collector.checkThat(registeredAddress.getCity(), is("Stockholm")); collector.checkThat(registeredAddress.getCountryCode().getValue(), is("SE")); collector.checkThat(registeredAddress.getLine1(), is("Vasagatan 38")); collector.checkThat(registeredAddress.getLine2(), is("hejsan")); collector.checkThat(registeredAddress.getPostalCode(), is("11120")); collector.checkThat(registeredAddress.getAddressType().getValue(), is(3)); collector.checkThat(registeredAddress.getCounty(), nullValue()); }
public String getAddress() { return address.getCountry() + " " + address.getCity() + " " + address.getHouse(); }
/** BODY */ @Override public void initBody() { String addressHtml; String itemsHtml; String billAdrs = "<div align=\"left\"> " + forUnusedAddress(memo.getCustomer().getName(), false) + "</div>"; Address bill = memo.getBillingAddress(); if (bill != null) { billAdrs = "<div align=\"left\"> " + forUnusedAddress(memo.getCustomer().getName(), false) + forUnusedAddress(bill.getAddress1(), false) + forUnusedAddress(bill.getStreet(), false) + forUnusedAddress(bill.getCity(), false) + forUnusedAddress(bill.getStateOrProvinence(), false) + forUnusedAddress(bill.getZipOrPostalCode(), false) + bill.getCountryOrRegion() + "</div>"; } addressHtml = "<table style=\"width: 100%; height: 100%;\" ><tr><td style=\"vertical-align: top;\" align=\"left\"><table style=\"width: 280px; height: 100%;\" class=\"gridHeader\"><colgroup><col></colgroup><tr><td class=\"gridHeaderBackGround\"><center>Credit To</center></td></tr><tr><td align=\"left\" style=\"vertical-align: top;padding: 6px;height:105px;\">" + billAdrs + "</td></tr></table>"; String recordsHtml = "<tr class=\"item-row\"><td class=\"description\"><div></div></td><td class=\"qty\"><div></div></td><td><div class=\"cost\"></div></td><td><div class=\"price\"></div></td><td class=\"vatRate\"><span ></span></td><td class=\"vatAmount\"><div></div></td></tr>"; if (!memo.getTransactionItems().isEmpty()) { recordsHtml = ""; for (TransactionItem item : memo.getTransactionItems()) { recordsHtml = recordsHtml + "<tr class=\"item-row\"><td style=\"padding: 6px;\" class=\"description\"><div>" + forNullValue(item.getDescription()) + "</div></td><td style=\"padding: 6px;\" align=\"right\" class=\"qty\"><div>" + (forZeroAmounts( getDecimalsUsingMaxDecimals( item.getQuantity().getValue(), null, maxDecimalPoints))) + "</div></td><td style=\"padding: 6px;\" align=\"right\"><div class=\"cost\">" + (forZeroAmounts(largeAmountConversation(item.getUnitPrice()))) + "</div></td><td style=\"padding: 6px;\" align=\"right\"><div class=\"price\">" + largeAmountConversation(item.getLineTotal()) + (company.getPreferences().isTrackTax() ? "</div></td><td style=\"padding: 6px;\" align=\"right\" class=\"vatRate\"><span >" + Utility.getVATItemRate(item.getTaxCode(), true) + "%</span></td><td style=\"padding: 6px;\" align=\"right\" class=\"vatAmount\"><div>" + item.getVATfraction() == null ? " " : getDecimalsUsingMaxDecimals(item.getVATfraction(), null, 2) : "") + "</div></td></tr>"; } } itemsHtml = ("<table id=\"items\"><tr><th>Description</th><th>Qty</th><th>Unit Price</th><th>Total Price</th><th>VAT Rate</th><th>VAT Amount</th></tr>" + recordsHtml + "</table><table id=\"totals\"><tr><td class=\"blank\" style=\"padding: 5px;\">" + forNullValue(memo.getMemo()) + "</td><td class=\"total-line\" > Sub Total</td><td class=\"total-value\"><div id=\"subtotal\">" + largeAmountConversation(memo.getNetAmount()) + " </div></td></tr><tr><td class=\"blank\" ></td> <td class=\"total-line\" > VAT Total</td><td class=\"total-value\"><div id=\"total\">" + largeAmountConversation(memo.getTotal() - memo.getNetAmount()) + " </div></td></tr><tr><td class=\"blank\" > </td><td class=\"total-line balance\"> TOTAL</td><td class=\"total-value balance\"><div id=\"due\">" + largeAmountConversation(memo.getTotal()) + " </div></td></tr></table>"); bodyHtml = addressHtml + itemsHtml; }
@Test public void testConvert() throws Exception { VistaDataChunk chunk = MockVistaDataChunks.createFromJson( PatientDemographicsImporterTest.class.getResourceAsStream("patient.json"), mockPatient, "patient"); PatientDemographicsImporter pi = new PatientDemographicsImporter(); PatientDemographics p = pi.convert(chunk); Assert.assertNotNull(p); Assert.assertEquals( p.getUid(), UidUtils.getPatientUid(chunk.getSystemId(), chunk.getLocalPatientId())); Assert.assertEquals("10104", p.getIcn()); Assert.assertEquals("AVIVAPATIENT", p.getFamilyName()); Assert.assertEquals("TWENTYFOUR", p.getGivenNames()); Assert.assertEquals("A0004", p.getBriefId()); Assert.assertEquals("666000004", p.getSsn()); Assert.assertTrue(p.isSensitive()); Assert.assertEquals(new PointInTime(1935, 4, 7), p.getBirthDate()); Assert.assertEquals("Male", p.getGenderName()); Assert.assertEquals("urn:va:pat-gender:M", p.getGenderCode()); // TODO: test for religion (needs code translation) Assert.assertTrue(p.isVeteran()); Assert.assertEquals("177", p.getLrdfn()); Assert.assertTrue(p.isServiceConnected()); Assert.assertEquals("10", p.getServiceConnectedPercent()); Assert.assertEquals(1, p.getAddress().size()); Address address = p.getAddress().iterator().next(); Assert.assertEquals("Any Street", address.getLine1()); Assert.assertEquals("Any Town", address.getCity()); Assert.assertEquals("WEST VIRGINIA", address.getState()); Assert.assertEquals("99998-0071", address.getZip()); Assert.assertEquals(1, p.getPatientRecordFlag().size()); PatientRecordFlag flag = p.getPatientRecordFlag().iterator().next(); Assert.assertEquals("WANDERER", flag.getName()); Assert.assertEquals("patient has a history of wandering off and getting lost", flag.getText()); Assert.assertNotNull(p.getMaritalStatusName()); Assert.assertEquals("urn:va:pat-maritalStatus:D", p.getMaritalStatusCode()); Assert.assertEquals("Divorced", p.getMaritalStatusName()); Assert.assertEquals(1, p.getAlias().size()); Alias alias = p.getAlias().iterator().next(); Assert.assertEquals("P4", alias.getFullName()); Assert.assertNull(alias.getFamilyName()); Assert.assertNull(alias.getGivenNames()); Assert.assertEquals(2, p.getTelecom().size()); Set<Telecom> telecoms = p.getTelecom(); for (Telecom telecom : telecoms) { if (telecom.getUse().equals("H")) { Assert.assertEquals("(222)555-8235", telecom.getValue()); } else if (telecom.getUse().equals("WP")) { Assert.assertEquals("(222)555-7720", telecom.getValue()); } else { Assert.fail(); } } Assert.assertEquals(1, p.getFacility().size()); // .facilities.size() SortedSet<PatientFacility> facilities = p.getFacility(); PatientFacility facility = facilities.first(); Assert.assertEquals("500", facility.getCode()); Assert.assertEquals("CAMP MASTER", facility.getName()); Assert.assertEquals(chunk.getSystemId(), facility.getSystemId()); Assert.assertEquals(chunk.getLocalPatientId(), facility.getLocalPatientId()); Assert.assertFalse(facility.isHomeSite()); Assert.assertEquals(6, p.getExposure().size()); // assertEquals("urn:va:N", p.getExposure().iterator().next().getUid()); Assert.assertEquals(1, p.getContact().size()); PatientContact support = p.getContact().iterator().next(); Assert.assertEquals("urn:va:pat-contact:NOK", support.getTypeCode()); Assert.assertEquals("Next of Kin", support.getTypeName()); Assert.assertEquals("VETERAN,BROTHER", support.getName()); }