Search in sources :

Example 6 with Country

use of org.incode.module.country.dom.impl.Country in project estatio by estatio.

the class CommunicationChannelOwner_newChannelContributions method default3NewPostal.

public State default3NewPostal() {
    final Country country = default2NewPostal();
    final List<State> statesInCountry = stateRepository.findStatesByCountry(country);
    return statesInCountry.size() > 0 ? statesInCountry.get(0) : null;
}
Also used : State(org.incode.module.country.dom.impl.State) Country(org.incode.module.country.dom.impl.Country)

Example 7 with Country

use of org.incode.module.country.dom.impl.Country in project estatio by estatio.

the class EstatioApplicationTenancyRepositoryForLease_Test method propertyWith.

private Property propertyWith(String countryCode, String reference) {
    Property property = new Property();
    property.setReference(reference);
    property.setCountry(new Country(countryCode, countryCode, countryCode));
    return property;
}
Also used : EstatioApplicationTenancyRepositoryForCountry(org.estatio.module.countryapptenancy.dom.EstatioApplicationTenancyRepositoryForCountry) Country(org.incode.module.country.dom.impl.Country) Property(org.estatio.module.asset.dom.Property) EstatioApplicationTenancyRepositoryForProperty(org.estatio.module.asset.dom.EstatioApplicationTenancyRepositoryForProperty)

Example 8 with Country

use of org.incode.module.country.dom.impl.Country in project estatio by estatio.

the class EstatioApplicationTenancyRepositoryForLease_Test method country.

private static Country country(final String reference) {
    Country country = new Country();
    country.setReference(reference);
    return country;
}
Also used : EstatioApplicationTenancyRepositoryForCountry(org.estatio.module.countryapptenancy.dom.EstatioApplicationTenancyRepositoryForCountry) Country(org.incode.module.country.dom.impl.Country)

Example 9 with Country

use of org.incode.module.country.dom.impl.Country in project estatio by estatio.

the class EstatioApplicationTenancyRepositoryForCountry_Test method testFindOrCreateCountryTenancy_whenExists.

@Test
public void testFindOrCreateCountryTenancy_whenExists() throws Exception {
    // given
    Country country = new Country();
    country.setReference("ITA");
    // when
    ApplicationTenancy countryTenancy = estatioApplicationTenancyRepository.findOrCreateTenancyFor(country);
    // then
    assertThat(countryTenancy).isEqualTo(italy);
}
Also used : Country(org.incode.module.country.dom.impl.Country) ApplicationTenancy(org.isisaddons.module.security.dom.tenancy.ApplicationTenancy) Test(org.junit.Test)

Example 10 with Country

use of org.incode.module.country.dom.impl.Country in project estatio by estatio.

the class EstatioApplicationTenancyRepositoryForCountry_Test method testPathForCountry.

@Test
public void testPathForCountry() throws Exception {
    // given
    Country country = new Country("ITA", "IT", "ITALY");
    // then
    assertThat(estatioApplicationTenancyRepository.pathFor(country)).isEqualTo("/ITA");
}
Also used : Country(org.incode.module.country.dom.impl.Country) Test(org.junit.Test)

Aggregations

Country (org.incode.module.country.dom.impl.Country)20 Test (org.junit.Test)6 EstatioApplicationTenancyRepositoryForCountry (org.estatio.module.countryapptenancy.dom.EstatioApplicationTenancyRepositoryForCountry)4 ApplicationTenancy (org.isisaddons.module.security.dom.tenancy.ApplicationTenancy)4 Programmatic (org.apache.isis.applib.annotation.Programmatic)3 Party (org.estatio.module.party.dom.Party)3 State (org.incode.module.country.dom.impl.State)3 Property (org.estatio.module.asset.dom.Property)2 Lease (org.estatio.module.lease.dom.Lease)2 Organisation (org.estatio.module.party.dom.Organisation)2 Expectations (org.jmock.Expectations)2 ArrayList (java.util.ArrayList)1 ApplicationException (org.apache.isis.applib.ApplicationException)1 DomainObject (org.apache.isis.applib.annotation.DomainObject)1 Persistable_datanucleusIdLong (org.apache.isis.core.metamodel.services.jdosupport.Persistable_datanucleusIdLong)1 PostalAddressDto (org.estatio.canonical.communicationchannel.v1.PostalAddressDto)1 AgreementRole (org.estatio.module.agreement.dom.AgreementRole)1 AgreementRoleCommunicationChannelType (org.estatio.module.agreement.dom.AgreementRoleCommunicationChannelType)1 AgreementRoleType (org.estatio.module.agreement.dom.role.AgreementRoleType)1 AdminDashboard (org.estatio.module.application.app.AdminDashboard)1