Merge branch 'jhipster-generated'

This commit is contained in:
Michael Hierweck 2019-04-18 16:33:28 +02:00
commit 633ae1d7d1
25 changed files with 137 additions and 134 deletions

View File

@ -49,7 +49,7 @@
"otherEntityField": "documentDate" "otherEntityField": "documentDate"
} }
], ],
"changelogDate": "20190403083740", "changelogDate": "20190418143053",
"entityTableName": "asset", "entityTableName": "asset",
"dto": "mapstruct", "dto": "mapstruct",
"pagination": "infinite-scroll", "pagination": "infinite-scroll",

View File

@ -90,7 +90,7 @@
"relationshipName": "sepamandate" "relationshipName": "sepamandate"
} }
], ],
"changelogDate": "20190403083735", "changelogDate": "20190418143050",
"entityTableName": "customer", "entityTableName": "customer",
"dto": "mapstruct", "dto": "mapstruct",
"pagination": "infinite-scroll", "pagination": "infinite-scroll",

View File

@ -50,7 +50,7 @@
"otherEntityField": "prefix" "otherEntityField": "prefix"
} }
], ],
"changelogDate": "20190403083738", "changelogDate": "20190418143051",
"entityTableName": "membership", "entityTableName": "membership",
"dto": "mapstruct", "dto": "mapstruct",
"pagination": "infinite-scroll", "pagination": "infinite-scroll",

View File

@ -72,7 +72,7 @@
"otherEntityField": "prefix" "otherEntityField": "prefix"
} }
], ],
"changelogDate": "20190418100951", "changelogDate": "20190418143054",
"entityTableName": "sepa_mandate", "entityTableName": "sepa_mandate",
"dto": "mapstruct", "dto": "mapstruct",
"pagination": "infinite-scroll", "pagination": "infinite-scroll",

View File

@ -49,7 +49,7 @@
"otherEntityField": "documentDate" "otherEntityField": "documentDate"
} }
], ],
"changelogDate": "20190403083739", "changelogDate": "20190418143052",
"entityTableName": "share", "entityTableName": "share",
"dto": "mapstruct", "dto": "mapstruct",
"pagination": "infinite-scroll", "pagination": "infinite-scroll",

22
package-lock.json generated
View File

@ -6025,7 +6025,7 @@
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true, "bundled": true,
"dev": true "dev": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
@ -6046,7 +6046,7 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true "dev": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
@ -6066,17 +6066,17 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -6193,7 +6193,7 @@
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true,
"dev": true "dev": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -6226,7 +6226,7 @@
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true, "bundled": true,
"dev": true "dev": true
}, },
"minipass": { "minipass": {
"version": "2.3.5", "version": "2.3.5",
@ -6330,7 +6330,7 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -6427,7 +6427,7 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true, "bundled": true,
"dev": true "dev": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
@ -6525,12 +6525,12 @@
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true "dev": true
}, },
"yallist": { "yallist": {
"version": "3.0.3", "version": "3.0.3",
"bundled": true, "bundled": true,
"dev": true "dev": true
} }
} }
}, },

View File

@ -30,15 +30,23 @@ public class Membership implements Serializable {
private Long id; private Long id;
@NotNull @NotNull
@Column(name = "since_date", nullable = false) @Column(name = "document_date", nullable = false)
private LocalDate sinceDate; private LocalDate documentDate;
@Column(name = "until_date") @NotNull
private LocalDate untilDate; @Column(name = "member_from", nullable = false)
private LocalDate memberFrom;
@OneToMany(mappedBy = "member") @Column(name = "member_until")
private LocalDate memberUntil;
@Size(max = 160)
@Column(name = "remark", length = 160)
private String remark;
@OneToMany(mappedBy = "membership")
private Set<Share> shares = new HashSet<>(); private Set<Share> shares = new HashSet<>();
@OneToMany(mappedBy = "member") @OneToMany(mappedBy = "membership")
private Set<Asset> assets = new HashSet<>(); private Set<Asset> assets = new HashSet<>();
@ManyToOne(optional = false) @ManyToOne(optional = false)
@NotNull @NotNull
@ -54,30 +62,56 @@ public class Membership implements Serializable {
this.id = id; this.id = id;
} }
public LocalDate getSinceDate() { public LocalDate getDocumentDate() {
return sinceDate; return documentDate;
} }
public Membership sinceDate(LocalDate sinceDate) { public Membership documentDate(LocalDate documentDate) {
this.sinceDate = sinceDate; this.documentDate = documentDate;
return this; return this;
} }
public void setSinceDate(LocalDate sinceDate) { public void setDocumentDate(LocalDate documentDate) {
this.sinceDate = sinceDate; this.documentDate = documentDate;
} }
public LocalDate getUntilDate() { public LocalDate getMemberFrom() {
return untilDate; return memberFrom;
} }
public Membership untilDate(LocalDate untilDate) { public Membership memberFrom(LocalDate memberFrom) {
this.untilDate = untilDate; this.memberFrom = memberFrom;
return this; return this;
} }
public void setUntilDate(LocalDate untilDate) { public void setMemberFrom(LocalDate memberFrom) {
this.untilDate = untilDate; this.memberFrom = memberFrom;
}
public LocalDate getMemberUntil() {
return memberUntil;
}
public Membership memberUntil(LocalDate memberUntil) {
this.memberUntil = memberUntil;
return this;
}
public void setMemberUntil(LocalDate memberUntil) {
this.memberUntil = memberUntil;
}
public String getRemark() {
return remark;
}
public Membership remark(String remark) {
this.remark = remark;
return this;
}
public void setRemark(String remark) {
this.remark = remark;
} }
public Set<Share> getShares() { public Set<Share> getShares() {
@ -168,8 +202,10 @@ public class Membership implements Serializable {
public String toString() { public String toString() {
return "Membership{" + return "Membership{" +
"id=" + getId() + "id=" + getId() +
", sinceDate='" + getSinceDate() + "'" + ", documentDate='" + getDocumentDate() + "'" +
", untilDate='" + getUntilDate() + "'" + ", memberFrom='" + getMemberFrom() + "'" +
", memberUntil='" + getMemberUntil() + "'" +
", remark='" + getRemark() + "'" +
"}"; "}";
} }
} }

View File

@ -16,6 +16,6 @@ import org.springframework.stereotype.Repository;
public interface MembershipRepository extends JpaRepository<Membership, Long>, JpaSpecificationExecutor<Membership> { public interface MembershipRepository extends JpaRepository<Membership, Long>, JpaSpecificationExecutor<Membership> {
@Query("SELECT CASE WHEN COUNT(m)> 0 THEN TRUE ELSE FALSE END " + @Query("SELECT CASE WHEN COUNT(m)> 0 THEN TRUE ELSE FALSE END " +
" FROM Membership m WHERE m.customer.id=:customerId AND m.to IS NULL") " FROM Membership m WHERE m.customer.id=:customerId AND m.memberUntil IS NULL")
boolean hasUncancelledMembershipForCustomer(@Param("customerId") final long customerId); boolean hasUncancelledMembershipForCustomer(@Param("customerId") final long customerId);
} }

View File

@ -14,7 +14,7 @@ public class MembershipValidator {
private MembershipRepository membershipRepository; private MembershipRepository membershipRepository;
public void validate(final MembershipDTO membershipDTO) { public void validate(final MembershipDTO membershipDTO) {
if (membershipDTO.getTo() != null && !membershipDTO.getTo().isAfter(membershipDTO.getFrom())) { if (membershipDTO.getMemberUntil() != null && !membershipDTO.getMemberUntil().isAfter(membershipDTO.getMemberFrom())) {
throw new BadRequestAlertException("Invalid untilDate", Membership.ENTITY_NAME, "untilDateMustBeAfterSinceDate"); throw new BadRequestAlertException("Invalid untilDate", Membership.ENTITY_NAME, "untilDateMustBeAfterSinceDate");
} }

View File

@ -3,6 +3,7 @@ import java.time.LocalDate;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import java.io.Serializable; import java.io.Serializable;
import java.util.Objects; import java.util.Objects;
import java.util.function.Consumer;
/** /**
* A DTO for the Membership entity. * A DTO for the Membership entity.

View File

@ -16,7 +16,7 @@
<!-- <!--
Added the entity Customer. Added the entity Customer.
--> -->
<changeSet id="20190403083735-1" author="jhipster"> <changeSet id="20190418143050-1" author="jhipster">
<createTable tableName="customer"> <createTable tableName="customer">
<column name="id" type="bigint" autoIncrement="${autoIncrement}"> <column name="id" type="bigint" autoIncrement="${autoIncrement}">
<constraints primaryKey="true" nullable="false"/> <constraints primaryKey="true" nullable="false"/>

View File

@ -16,7 +16,7 @@
<!-- <!--
Added the entity Membership. Added the entity Membership.
--> -->
<changeSet id="20190403083738-1" author="jhipster"> <changeSet id="20190418143051-1" author="jhipster">
<createTable tableName="membership"> <createTable tableName="membership">
<column name="id" type="bigint" autoIncrement="${autoIncrement}"> <column name="id" type="bigint" autoIncrement="${autoIncrement}">
<constraints primaryKey="true" nullable="false"/> <constraints primaryKey="true" nullable="false"/>

View File

@ -6,7 +6,7 @@
<!-- <!--
Added the constraints for entity Membership. Added the constraints for entity Membership.
--> -->
<changeSet id="20190418073044-2" author="jhipster"> <changeSet id="20190418143051-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="customer_id" <addForeignKeyConstraint baseColumnNames="customer_id"
baseTableName="membership" baseTableName="membership"

View File

@ -16,7 +16,7 @@
<!-- <!--
Added the entity Share. Added the entity Share.
--> -->
<changeSet id="20190418073045-1" author="jhipster"> <changeSet id="20190418143052-1" author="jhipster">
<createTable tableName="share"> <createTable tableName="share">
<column name="id" type="bigint" autoIncrement="${autoIncrement}"> <column name="id" type="bigint" autoIncrement="${autoIncrement}">
<constraints primaryKey="true" nullable="false"/> <constraints primaryKey="true" nullable="false"/>

View File

@ -6,7 +6,7 @@
<!-- <!--
Added the constraints for entity Share. Added the constraints for entity Share.
--> -->
<changeSet id="20190418073045-2" author="jhipster"> <changeSet id="20190418143052-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="membership_id" <addForeignKeyConstraint baseColumnNames="membership_id"
baseTableName="share" baseTableName="share"

View File

@ -16,7 +16,7 @@
<!-- <!--
Added the entity Asset. Added the entity Asset.
--> -->
<changeSet id="20190418073046-1" author="jhipster"> <changeSet id="20190418143053-1" author="jhipster">
<createTable tableName="asset"> <createTable tableName="asset">
<column name="id" type="bigint" autoIncrement="${autoIncrement}"> <column name="id" type="bigint" autoIncrement="${autoIncrement}">
<constraints primaryKey="true" nullable="false"/> <constraints primaryKey="true" nullable="false"/>

View File

@ -6,7 +6,7 @@
<!-- <!--
Added the constraints for entity Asset. Added the constraints for entity Asset.
--> -->
<changeSet id="20190418073046-2" author="jhipster"> <changeSet id="20190418143053-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="membership_id" <addForeignKeyConstraint baseColumnNames="membership_id"
baseTableName="asset" baseTableName="asset"

View File

@ -16,7 +16,7 @@
<!-- <!--
Added the entity SepaMandate. Added the entity SepaMandate.
--> -->
<changeSet id="20190418100951-1" author="jhipster"> <changeSet id="20190418143054-1" author="jhipster">
<createTable tableName="sepa_mandate"> <createTable tableName="sepa_mandate">
<column name="id" type="bigint" autoIncrement="${autoIncrement}"> <column name="id" type="bigint" autoIncrement="${autoIncrement}">
<constraints primaryKey="true" nullable="false"/> <constraints primaryKey="true" nullable="false"/>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
<!--
Added the constraints for entity SepaMandate.
-->
<changeSet id="20190418143054-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="customer_id"
baseTableName="sepa_mandate"
constraintName="fk_sepa_mandate_customer_id"
referencedColumnNames="id"
referencedTableName="customer"/>
</changeSet>
</databaseChangeLog>

View File

@ -5,22 +5,15 @@
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd"> xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
<include file="config/liquibase/changelog/00000000000000_initial_schema.xml" relativeToChangelogFile="false"/> <include file="config/liquibase/changelog/00000000000000_initial_schema.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20190403083735_added_entity_Customer.xml" relativeToChangelogFile="false"/> <include file="config/liquibase/changelog/20190418143050_added_entity_Customer.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20190403083736_added_entity_Contact.xml" relativeToChangelogFile="false"/> <include file="config/liquibase/changelog/20190418143051_added_entity_Membership.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20190403083737_added_entity_CustomerContact.xml" relativeToChangelogFile="false"/> <include file="config/liquibase/changelog/20190418143052_added_entity_Share.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20190403083738_added_entity_Membership.xml" relativeToChangelogFile="false"/> <include file="config/liquibase/changelog/20190418143053_added_entity_Asset.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20190403083739_added_entity_Share.xml" relativeToChangelogFile="false"/> <include file="config/liquibase/changelog/20190418143054_added_entity_SepaMandate.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20190403083740_added_entity_Asset.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20190418100951_added_entity_SepaMandate.xml" relativeToChangelogFile="false"/>
<!-- jhipster-needle-liquibase-add-changelog - JHipster will add liquibase changelogs here --> <!-- jhipster-needle-liquibase-add-changelog - JHipster will add liquibase changelogs here -->
<include file="config/liquibase/changelog/20190403083737_added_entity_constraints_CustomerContact.xml" relativeToChangelogFile="false"/> <include file="config/liquibase/changelog/20190418143051_added_entity_constraints_Membership.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20190403083738_added_entity_constraints_Membership.xml" relativeToChangelogFile="false"/> <include file="config/liquibase/changelog/20190418143052_added_entity_constraints_Share.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20190403083739_added_entity_constraints_Share.xml" relativeToChangelogFile="false"/> <include file="config/liquibase/changelog/20190418143053_added_entity_constraints_Asset.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20190403083740_added_entity_constraints_Asset.xml" relativeToChangelogFile="false"/> <include file="config/liquibase/changelog/20190418143054_added_entity_constraints_SepaMandate.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20190418100951_added_entity_constraints_SepaMandate.xml" relativeToChangelogFile="false"/>
<!-- jhipster-needle-liquibase-add-constraints-changelog - JHipster will add liquibase constraints changelogs here --> <!-- jhipster-needle-liquibase-add-constraints-changelog - JHipster will add liquibase constraints changelogs here -->
<include file="config/liquibase/changelog/sample-data-Customer.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/sample-data-Membership.xml" relativeToChangelogFile="false"/>
</databaseChangeLog> </databaseChangeLog>

View File

@ -1,49 +1,9 @@
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
@NgModule({ @NgModule({
imports: [ imports: [
RouterModule.forChild([ RouterModule.forChild([
{
path: 'customer',
loadChildren: './customer/customer.module#HsadminNgCustomerModule'
},
{
path: 'contact',
loadChildren: './contact/contact.module#HsadminNgContactModule'
},
{
path: 'customer-contact',
loadChildren: './customer-contact/customer-contact.module#HsadminNgCustomerContactModule'
},
{
path: 'membership',
loadChildren: './membership/membership.module#HsadminNgMembershipModule'
},
{
path: 'share',
loadChildren: './share/share.module#HsadminNgShareModule'
},
{
path: 'asset',
loadChildren: './asset/asset.module#HsadminNgAssetModule'
},
{
path: 'customer',
loadChildren: './customer/customer.module#HsadminNgCustomerModule'
},
{
path: 'membership',
loadChildren: './membership/membership.module#HsadminNgMembershipModule'
},
{
path: 'share',
loadChildren: './share/share.module#HsadminNgShareModule'
},
{
path: 'asset',
loadChildren: './asset/asset.module#HsadminNgAssetModule'
},
{ {
path: 'customer', path: 'customer',
loadChildren: './customer/customer.module#HsadminNgCustomerModule' loadChildren: './customer/customer.module#HsadminNgCustomerModule'

View File

@ -19,11 +19,11 @@ export class SepaMandateUpdateComponent implements OnInit {
isSaving: boolean; isSaving: boolean;
customers: ICustomer[]; customers: ICustomer[];
createdDp: any; documentDateDp: any;
validFromDp: any; validFromDp: any;
validToDp: any; validUntilDp: any;
lastUsedDp: any; lastUsedDp: any;
cancelledDp: any; cancellationDateDp: any;
constructor( constructor(
protected jhiAlertService: JhiAlertService, protected jhiAlertService: JhiAlertService,

View File

@ -69,7 +69,7 @@ public class MembershipRepositoryIntTest {
private Customer createCustomer() { private Customer createCustomer() {
final Customer customer = new Customer(); final Customer customer = new Customer();
customer.setPrefix(RandomStringUtils.randomAlphabetic(3).toLowerCase()); customer.setPrefix(RandomStringUtils.randomAlphabetic(3).toLowerCase());
customer.setNumber(RandomUtils.nextInt(10001, 19999)); customer.setReference(RandomUtils.nextInt(10001, 19999));
customer.setName(RandomStringUtils.randomAlphabetic(10)); customer.setName(RandomStringUtils.randomAlphabetic(10));
customer.setContractualAddress(RandomStringUtils.randomAlphabetic(10)); customer.setContractualAddress(RandomStringUtils.randomAlphabetic(10));
customerRepository.save(customer); customerRepository.save(customer);
@ -80,9 +80,9 @@ public class MembershipRepositoryIntTest {
final Customer customer = createCustomer(); final Customer customer = createCustomer();
final Membership membership = new Membership(); final Membership membership = new Membership();
membership.setCustomer(customer); membership.setCustomer(customer);
membership.setTo(LocalDate.parse(from)); membership.setMemberUntil(LocalDate.parse(from));
if (to != null) { if (to != null) {
membership.setFrom(LocalDate.parse(to)); membership.setMemberFrom(LocalDate.parse(to));
} }
membershipRepository.save(membership); membershipRepository.save(membership);
return customer; return customer;

View File

@ -101,12 +101,12 @@ public class MembershipValidatorUnitTest {
GivenMembershipValidationTestCase since(final String sinceDate) { GivenMembershipValidationTestCase since(final String sinceDate) {
membershipDto.setFrom(LocalDate.parse(sinceDate)); membershipDto.setMemberFrom(LocalDate.parse(sinceDate));
return this; return this;
} }
public GivenMembershipValidationTestCase until(final String untilDate) { public GivenMembershipValidationTestCase until(final String untilDate) {
membershipDto.setTo(LocalDate.parse(untilDate)); membershipDto.setMemberUntil(LocalDate.parse(untilDate));
return this; return this;
} }

View File

@ -50,8 +50,8 @@ public class CustomerResourceIntTest {
private static final Integer DEFAULT_REFERENCE = 10000; private static final Integer DEFAULT_REFERENCE = 10000;
private static final Integer UPDATED_REFERENCE = 10001; private static final Integer UPDATED_REFERENCE = 10001;
private static final String DEFAULT_PREFIX = "nf"; private static final String DEFAULT_PREFIX = "hu";
private static final String UPDATED_PREFIX = "m2"; private static final String UPDATED_PREFIX = "umj";
private static final String DEFAULT_NAME = "AAAAAAAAAA"; private static final String DEFAULT_NAME = "AAAAAAAAAA";
private static final String UPDATED_NAME = "BBBBBBBBBB"; private static final String UPDATED_NAME = "BBBBBBBBBB";
@ -62,12 +62,6 @@ public class CustomerResourceIntTest {
private static final String DEFAULT_CONTRACTUAL_ADDRESS = "AAAAAAAAAA"; private static final String DEFAULT_CONTRACTUAL_ADDRESS = "AAAAAAAAAA";
private static final String UPDATED_CONTRACTUAL_ADDRESS = "BBBBBBBBBB"; private static final String UPDATED_CONTRACTUAL_ADDRESS = "BBBBBBBBBB";
private static final String DEFAULT_BILLING_SALUTATION = "AAAAAAAAAA";
private static final String UPDATED_BILLING_SALUTATION = "BBBBBBBBBB";
private static final String DEFAULT_CONTRACTUAL_SALUTATION = "AAAAAAAAAA";
private static final String UPDATED_CONTRACTUAL_SALUTATION = "BBBBBBBBBB";
@Autowired
private static final String DEFAULT_BILLING_SALUTATION = "AAAAAAAAAA"; private static final String DEFAULT_BILLING_SALUTATION = "AAAAAAAAAA";
private static final String UPDATED_BILLING_SALUTATION = "BBBBBBBBBB"; private static final String UPDATED_BILLING_SALUTATION = "BBBBBBBBBB";
@ -77,6 +71,7 @@ public class CustomerResourceIntTest {
private static final String DEFAULT_REMARK = "AAAAAAAAAA"; private static final String DEFAULT_REMARK = "AAAAAAAAAA";
private static final String UPDATED_REMARK = "BBBBBBBBBB"; private static final String UPDATED_REMARK = "BBBBBBBBBB";
@Autowired
private CustomerRepository customerRepository; private CustomerRepository customerRepository;
@Autowired @Autowired
@ -570,41 +565,41 @@ public class CustomerResourceIntTest {
@Test @Test
@Transactional @Transactional
public void getAllCustomersByContractualAddressIsEqualToSomething() throws Exception { public void getAllCustomersByBillingAddressIsEqualToSomething() throws Exception {
// Initialize the database // Initialize the database
customerRepository.saveAndFlush(customer); customerRepository.saveAndFlush(customer);
// Get all the customerList where contractualAddress equals to DEFAULT_CONTRACTUAL_ADDRESS // Get all the customerList where billingAddress equals to DEFAULT_BILLING_ADDRESS
defaultCustomerShouldBeFound("contractualAddress.equals=" + DEFAULT_CONTRACTUAL_ADDRESS); defaultCustomerShouldBeFound("billingAddress.equals=" + DEFAULT_BILLING_ADDRESS);
// Get all the customerList where contractualAddress equals to UPDATED_CONTRACTUAL_ADDRESS // Get all the customerList where billingAddress equals to UPDATED_BILLING_ADDRESS
defaultCustomerShouldNotBeFound("contractualAddress.equals=" + UPDATED_CONTRACTUAL_ADDRESS); defaultCustomerShouldNotBeFound("billingAddress.equals=" + UPDATED_BILLING_ADDRESS);
} }
@Test @Test
@Transactional @Transactional
public void getAllCustomersByContractualAddressIsInShouldWork() throws Exception { public void getAllCustomersByBillingAddressIsInShouldWork() throws Exception {
// Initialize the database // Initialize the database
customerRepository.saveAndFlush(customer); customerRepository.saveAndFlush(customer);
// Get all the customerList where contractualAddress in DEFAULT_CONTRACTUAL_ADDRESS or UPDATED_CONTRACTUAL_ADDRESS // Get all the customerList where billingAddress in DEFAULT_BILLING_ADDRESS or UPDATED_BILLING_ADDRESS
defaultCustomerShouldBeFound("contractualAddress.in=" + DEFAULT_CONTRACTUAL_ADDRESS + "," + UPDATED_CONTRACTUAL_ADDRESS); defaultCustomerShouldBeFound("billingAddress.in=" + DEFAULT_BILLING_ADDRESS + "," + UPDATED_BILLING_ADDRESS);
// Get all the customerList where contractualAddress equals to UPDATED_CONTRACTUAL_ADDRESS // Get all the customerList where billingAddress equals to UPDATED_BILLING_ADDRESS
defaultCustomerShouldNotBeFound("contractualAddress.in=" + UPDATED_CONTRACTUAL_ADDRESS); defaultCustomerShouldNotBeFound("billingAddress.in=" + UPDATED_BILLING_ADDRESS);
} }
@Test @Test
@Transactional @Transactional
public void getAllCustomersByContractualAddressIsNullOrNotNull() throws Exception { public void getAllCustomersByBillingAddressIsNullOrNotNull() throws Exception {
// Initialize the database // Initialize the database
customerRepository.saveAndFlush(customer); customerRepository.saveAndFlush(customer);
// Get all the customerList where contractualAddress is not null // Get all the customerList where billingAddress is not null
defaultCustomerShouldBeFound("contractualAddress.specified=true"); defaultCustomerShouldBeFound("billingAddress.specified=true");
// Get all the customerList where contractualAddress is null // Get all the customerList where billingAddress is null
defaultCustomerShouldNotBeFound("contractualAddress.specified=false"); defaultCustomerShouldNotBeFound("billingAddress.specified=false");
} }
@Test @Test