1
0

Merge branch 'jhipster-generated'

This commit is contained in:
Michael Hierweck
2019-04-24 16:14:14 +02:00
82 changed files with 2600 additions and 916 deletions

View File

@ -4,12 +4,12 @@ import org.hostsharing.hsadminng.HsadminNgApp;
import org.hostsharing.hsadminng.domain.Asset;
import org.hostsharing.hsadminng.domain.Membership;
import org.hostsharing.hsadminng.domain.Share;
import org.hostsharing.hsadminng.repository.AssetRepository;
import org.hostsharing.hsadminng.service.AssetService;
import org.hostsharing.hsadminng.service.dto.AssetDTO;
import org.hostsharing.hsadminng.service.mapper.AssetMapper;
import org.hostsharing.hsadminng.web.rest.errors.ExceptionTranslator;
import org.hostsharing.hsadminng.service.dto.AssetCriteria;
import org.hostsharing.hsadminng.service.AssetQueryService;
import org.junit.Before;
@ -129,26 +129,6 @@ public class AssetResourceIntTest {
return asset;
}
/**
* Create a persistent entity related to the given persistent membership for testing purposes.
*
* This is a static method, as tests for other entities might also need it,
* if they test an entity which requires the current entity.
*/
public static Asset createPersistentEntity(EntityManager em, final Membership membership) {
Asset asset = new Asset()
.documentDate(DEFAULT_DOCUMENT_DATE)
.valueDate(DEFAULT_VALUE_DATE)
.action(DEFAULT_ACTION)
.amount(DEFAULT_AMOUNT)
.remark(DEFAULT_REMARK);
// Add required entity
asset.setMembership(membership);
membership.addAsset(asset);
em.persist(asset);
em.flush();
return asset;
}
@Before
public void initTest() {
asset = createEntity(em);
@ -562,7 +542,7 @@ public class AssetResourceIntTest {
@Transactional
public void getAllAssetsByMembershipIsEqualToSomething() throws Exception {
// Initialize the database
Membership membership = MembershipResourceIntTest.createPersistentEntity(em, CustomerResourceIntTest.createPersistentEntity(em));
Membership membership = MembershipResourceIntTest.createEntity(em);
em.persist(membership);
em.flush();
asset.setMembership(membership);
@ -646,17 +626,17 @@ public class AssetResourceIntTest {
restAssetMockMvc.perform(put("/api/assets")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(assetDTO)))
.andExpect(status().isBadRequest());
.andExpect(status().isOk());
// Validate the Asset in the database
List<Asset> assetList = assetRepository.findAll();
assertThat(assetList).hasSize(databaseSizeBeforeUpdate);
Asset testAsset = assetList.get(assetList.size() - 1);
assertThat(testAsset.getDocumentDate()).isEqualTo(DEFAULT_DOCUMENT_DATE);
assertThat(testAsset.getValueDate()).isEqualTo(DEFAULT_VALUE_DATE);
assertThat(testAsset.getAction()).isEqualByComparingTo(DEFAULT_ACTION);
assertThat(testAsset.getAmount()).isEqualByComparingTo(DEFAULT_AMOUNT);
assertThat(testAsset.getRemark()).isEqualTo(DEFAULT_REMARK);
assertThat(testAsset.getDocumentDate()).isEqualTo(UPDATED_DOCUMENT_DATE);
assertThat(testAsset.getValueDate()).isEqualTo(UPDATED_VALUE_DATE);
assertThat(testAsset.getAction()).isEqualTo(UPDATED_ACTION);
assertThat(testAsset.getAmount()).isEqualTo(UPDATED_AMOUNT);
assertThat(testAsset.getRemark()).isEqualTo(UPDATED_REMARK);
}
@Test
@ -689,11 +669,11 @@ public class AssetResourceIntTest {
// Delete the asset
restAssetMockMvc.perform(delete("/api/assets/{id}", asset.getId())
.accept(TestUtil.APPLICATION_JSON_UTF8))
.andExpect(status().isBadRequest());
.andExpect(status().isOk());
// Validate the database still contains the same number of assets
// Validate the database is empty
List<Asset> assetList = assetRepository.findAll();
assertThat(assetList).hasSize(databaseSizeBeforeDelete);
assertThat(assetList).hasSize(databaseSizeBeforeDelete - 1);
}
@Test

View File

@ -10,6 +10,7 @@ import org.hostsharing.hsadminng.service.CustomerService;
import org.hostsharing.hsadminng.service.dto.CustomerDTO;
import org.hostsharing.hsadminng.service.mapper.CustomerMapper;
import org.hostsharing.hsadminng.web.rest.errors.ExceptionTranslator;
import org.hostsharing.hsadminng.service.dto.CustomerCriteria;
import org.hostsharing.hsadminng.service.CustomerQueryService;
import org.junit.Before;
@ -28,6 +29,8 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.Validator;
import javax.persistence.EntityManager;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.List;
@ -37,6 +40,8 @@ import static org.hamcrest.Matchers.hasItem;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
import org.hostsharing.hsadminng.domain.enumeration.CustomerKind;
import org.hostsharing.hsadminng.domain.enumeration.VatRegion;
/**
* Test class for the CustomerResource REST controller.
*
@ -74,6 +79,27 @@ public class CustomerResourceIntTest {
private static final String DEFAULT_REMARK = "Default Remark";
private static final String UPDATED_REMARK = "Updated Remark";
private static final CustomerKind DEFAULT_KIND = CustomerKind.NATURAL;
private static final CustomerKind UPDATED_KIND = CustomerKind.LEGAL;
private static final LocalDate DEFAULT_BIRTH_DATE = LocalDate.ofEpochDay(0L);
private static final LocalDate UPDATED_BIRTH_DATE = LocalDate.now(ZoneId.systemDefault());
private static final String DEFAULT_BIRTH_PLACE = "AAAAAAAAAA";
private static final String UPDATED_BIRTH_PLACE = "BBBBBBBBBB";
private static final String DEFAULT_REGISTRATION_COURT = "AAAAAAAAAA";
private static final String UPDATED_REGISTRATION_COURT = "BBBBBBBBBB";
private static final String DEFAULT_REGISTRATION_NUMBER = "AAAAAAAAAA";
private static final String UPDATED_REGISTRATION_NUMBER = "BBBBBBBBBB";
private static final VatRegion DEFAULT_VAT_REGION = VatRegion.DOMESTIC;
private static final VatRegion UPDATED_VAT_REGION = VatRegion.EU;
private static final String DEFAULT_VAT_NUMBER = "AAAAAAAAAA";
private static final String UPDATED_VAT_NUMBER = "BBBBBBBBBB";
private static int otherCounter = 0;
@Autowired
@ -130,11 +156,17 @@ public class CustomerResourceIntTest {
.reference(DEFAULT_REFERENCE)
.prefix(DEFAULT_PREFIX)
.name(DEFAULT_NAME)
.kind(DEFAULT_KIND)
.birthDate(DEFAULT_BIRTH_DATE)
.birthPlace(DEFAULT_BIRTH_PLACE)
.registrationCourt(DEFAULT_REGISTRATION_COURT)
.registrationNumber(DEFAULT_REGISTRATION_NUMBER)
.vatRegion(DEFAULT_VAT_REGION)
.vatNumber(DEFAULT_VAT_NUMBER)
.contractualSalutation(DEFAULT_CONTRACTUAL_SALUTATION)
.contractualAddress(DEFAULT_CONTRACTUAL_ADDRESS)
.billingSalutation(DEFAULT_BILLING_SALUTATION)
.billingAddress(DEFAULT_BILLING_ADDRESS)
.billingSalutation(DEFAULT_BILLING_SALUTATION)
.remark(DEFAULT_REMARK);
return customer;
}
@ -150,6 +182,8 @@ public class CustomerResourceIntTest {
.reference(OTHER_REFERENCE_BASE + otherCounter)
.prefix(OTHER_PREFIX_BASE + String.format("%02d", otherCounter))
.name(OTHER_NAME_BASE + otherCounter)
.kind(OTHER_KIND)
.vatRegion(OTHER_VAT_REGION)
.contractualAddress(OTHER_CONTRACTUAL_ADDRESS_BASE + otherCounter);
em.persist(customer);
em.flush();
@ -181,6 +215,13 @@ public class CustomerResourceIntTest {
assertThat(testCustomer.getReference()).isEqualTo(DEFAULT_REFERENCE);
assertThat(testCustomer.getPrefix()).isEqualTo(DEFAULT_PREFIX);
assertThat(testCustomer.getName()).isEqualTo(DEFAULT_NAME);
assertThat(testCustomer.getKind()).isEqualTo(DEFAULT_KIND);
assertThat(testCustomer.getBirthDate()).isEqualTo(DEFAULT_BIRTH_DATE);
assertThat(testCustomer.getBirthPlace()).isEqualTo(DEFAULT_BIRTH_PLACE);
assertThat(testCustomer.getRegistrationCourt()).isEqualTo(DEFAULT_REGISTRATION_COURT);
assertThat(testCustomer.getRegistrationNumber()).isEqualTo(DEFAULT_REGISTRATION_NUMBER);
assertThat(testCustomer.getVatRegion()).isEqualTo(DEFAULT_VAT_REGION);
assertThat(testCustomer.getVatNumber()).isEqualTo(DEFAULT_VAT_NUMBER);
assertThat(testCustomer.getContractualSalutation()).isEqualTo(DEFAULT_CONTRACTUAL_SALUTATION);
assertThat(testCustomer.getContractualAddress()).isEqualTo(DEFAULT_CONTRACTUAL_ADDRESS);
assertThat(testCustomer.getBillingSalutation()).isEqualTo(DEFAULT_BILLING_SALUTATION);
@ -265,6 +306,44 @@ public class CustomerResourceIntTest {
assertThat(customerList).hasSize(databaseSizeBeforeTest);
}
@Test
@Transactional
public void checkKindIsRequired() throws Exception {
int databaseSizeBeforeTest = customerRepository.findAll().size();
// set the field null
customer.setKind(null);
// Create the Customer, which fails.
CustomerDTO customerDTO = customerMapper.toDto(customer);
restCustomerMockMvc.perform(post("/api/customers")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(customerDTO)))
.andExpect(status().isBadRequest());
List<Customer> customerList = customerRepository.findAll();
assertThat(customerList).hasSize(databaseSizeBeforeTest);
}
@Test
@Transactional
public void checkVatRegionIsRequired() throws Exception {
int databaseSizeBeforeTest = customerRepository.findAll().size();
// set the field null
customer.setVatRegion(null);
// Create the Customer, which fails.
CustomerDTO customerDTO = customerMapper.toDto(customer);
restCustomerMockMvc.perform(post("/api/customers")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(customerDTO)))
.andExpect(status().isBadRequest());
List<Customer> customerList = customerRepository.findAll();
assertThat(customerList).hasSize(databaseSizeBeforeTest);
}
@Test
@Transactional
public void checkContractualAddressIsRequired() throws Exception {
@ -298,6 +377,13 @@ public class CustomerResourceIntTest {
.andExpect(jsonPath("$.[*].reference").value(hasItem(DEFAULT_REFERENCE)))
.andExpect(jsonPath("$.[*].prefix").value(hasItem(DEFAULT_PREFIX.toString())))
.andExpect(jsonPath("$.[*].name").value(hasItem(DEFAULT_NAME.toString())))
.andExpect(jsonPath("$.[*].kind").value(hasItem(DEFAULT_KIND.toString())))
.andExpect(jsonPath("$.[*].birthDate").value(hasItem(DEFAULT_BIRTH_DATE.toString())))
.andExpect(jsonPath("$.[*].birthPlace").value(hasItem(DEFAULT_BIRTH_PLACE.toString())))
.andExpect(jsonPath("$.[*].registrationCourt").value(hasItem(DEFAULT_REGISTRATION_COURT.toString())))
.andExpect(jsonPath("$.[*].registrationNumber").value(hasItem(DEFAULT_REGISTRATION_NUMBER.toString())))
.andExpect(jsonPath("$.[*].vatRegion").value(hasItem(DEFAULT_VAT_REGION.toString())))
.andExpect(jsonPath("$.[*].vatNumber").value(hasItem(DEFAULT_VAT_NUMBER.toString())))
.andExpect(jsonPath("$.[*].contractualSalutation").value(hasItem(DEFAULT_CONTRACTUAL_SALUTATION.toString())))
.andExpect(jsonPath("$.[*].contractualAddress").value(hasItem(DEFAULT_CONTRACTUAL_ADDRESS.toString())))
.andExpect(jsonPath("$.[*].billingSalutation").value(hasItem(DEFAULT_BILLING_SALUTATION.toString())))
@ -319,6 +405,13 @@ public class CustomerResourceIntTest {
.andExpect(jsonPath("$.reference").value(DEFAULT_REFERENCE))
.andExpect(jsonPath("$.prefix").value(DEFAULT_PREFIX.toString()))
.andExpect(jsonPath("$.name").value(DEFAULT_NAME.toString()))
.andExpect(jsonPath("$.kind").value(DEFAULT_KIND.toString()))
.andExpect(jsonPath("$.birthDate").value(DEFAULT_BIRTH_DATE.toString()))
.andExpect(jsonPath("$.birthPlace").value(DEFAULT_BIRTH_PLACE.toString()))
.andExpect(jsonPath("$.registrationCourt").value(DEFAULT_REGISTRATION_COURT.toString()))
.andExpect(jsonPath("$.registrationNumber").value(DEFAULT_REGISTRATION_NUMBER.toString()))
.andExpect(jsonPath("$.vatRegion").value(DEFAULT_VAT_REGION.toString()))
.andExpect(jsonPath("$.vatNumber").value(DEFAULT_VAT_NUMBER.toString()))
.andExpect(jsonPath("$.contractualSalutation").value(DEFAULT_CONTRACTUAL_SALUTATION.toString()))
.andExpect(jsonPath("$.contractualAddress").value(DEFAULT_CONTRACTUAL_ADDRESS.toString()))
.andExpect(jsonPath("$.billingSalutation").value(DEFAULT_BILLING_SALUTATION.toString()))
@ -470,6 +563,306 @@ public class CustomerResourceIntTest {
defaultCustomerShouldNotBeFound("name.specified=false");
}
@Test
@Transactional
public void getAllCustomersByKindIsEqualToSomething() throws Exception {
// Initialize the database
customerRepository.saveAndFlush(customer);
// Get all the customerList where kind equals to DEFAULT_KIND
defaultCustomerShouldBeFound("kind.equals=" + DEFAULT_KIND);
// Get all the customerList where kind equals to UPDATED_KIND
defaultCustomerShouldNotBeFound("kind.equals=" + UPDATED_KIND);
}
@Test
@Transactional
public void getAllCustomersByKindIsInShouldWork() throws Exception {
// Initialize the database
customerRepository.saveAndFlush(customer);
// Get all the customerList where kind in DEFAULT_KIND or UPDATED_KIND
defaultCustomerShouldBeFound("kind.in=" + DEFAULT_KIND + "," + UPDATED_KIND);
// Get all the customerList where kind equals to UPDATED_KIND
defaultCustomerShouldNotBeFound("kind.in=" + UPDATED_KIND);
}
@Test
@Transactional
public void getAllCustomersByKindIsNullOrNotNull() throws Exception {
// Initialize the database
customerRepository.saveAndFlush(customer);
// Get all the customerList where kind is not null
defaultCustomerShouldBeFound("kind.specified=true");
// Get all the customerList where kind is null
defaultCustomerShouldNotBeFound("kind.specified=false");
}
@Test
@Transactional
public void getAllCustomersByBirthDateIsEqualToSomething() throws Exception {
// Initialize the database
customerRepository.saveAndFlush(customer);
// Get all the customerList where birthDate equals to DEFAULT_BIRTH_DATE
defaultCustomerShouldBeFound("birthDate.equals=" + DEFAULT_BIRTH_DATE);
// Get all the customerList where birthDate equals to UPDATED_BIRTH_DATE
defaultCustomerShouldNotBeFound("birthDate.equals=" + UPDATED_BIRTH_DATE);
}
@Test
@Transactional
public void getAllCustomersByBirthDateIsInShouldWork() throws Exception {
// Initialize the database
customerRepository.saveAndFlush(customer);
// Get all the customerList where birthDate in DEFAULT_BIRTH_DATE or UPDATED_BIRTH_DATE
defaultCustomerShouldBeFound("birthDate.in=" + DEFAULT_BIRTH_DATE + "," + UPDATED_BIRTH_DATE);
// Get all the customerList where birthDate equals to UPDATED_BIRTH_DATE
defaultCustomerShouldNotBeFound("birthDate.in=" + UPDATED_BIRTH_DATE);
}
@Test
@Transactional
public void getAllCustomersByBirthDateIsNullOrNotNull() throws Exception {
// Initialize the database
customerRepository.saveAndFlush(customer);
// Get all the customerList where birthDate is not null
defaultCustomerShouldBeFound("birthDate.specified=true");
// Get all the customerList where birthDate is null
defaultCustomerShouldNotBeFound("birthDate.specified=false");
}
@Test
@Transactional
public void getAllCustomersByBirthDateIsGreaterThanOrEqualToSomething() throws Exception {
// Initialize the database
customerRepository.saveAndFlush(customer);
// Get all the customerList where birthDate greater than or equals to DEFAULT_BIRTH_DATE
defaultCustomerShouldBeFound("birthDate.greaterOrEqualThan=" + DEFAULT_BIRTH_DATE);
// Get all the customerList where birthDate greater than or equals to UPDATED_BIRTH_DATE
defaultCustomerShouldNotBeFound("birthDate.greaterOrEqualThan=" + UPDATED_BIRTH_DATE);
}
@Test
@Transactional
public void getAllCustomersByBirthDateIsLessThanSomething() throws Exception {
// Initialize the database
customerRepository.saveAndFlush(customer);
// Get all the customerList where birthDate less than or equals to DEFAULT_BIRTH_DATE
defaultCustomerShouldNotBeFound("birthDate.lessThan=" + DEFAULT_BIRTH_DATE);
// Get all the customerList where birthDate less than or equals to UPDATED_BIRTH_DATE
defaultCustomerShouldBeFound("birthDate.lessThan=" + UPDATED_BIRTH_DATE);
}
@Test
@Transactional
public void getAllCustomersByBirthPlaceIsEqualToSomething() throws Exception {
// Initialize the database
customerRepository.saveAndFlush(customer);
// Get all the customerList where birthPlace equals to DEFAULT_BIRTH_PLACE
defaultCustomerShouldBeFound("birthPlace.equals=" + DEFAULT_BIRTH_PLACE);
// Get all the customerList where birthPlace equals to UPDATED_BIRTH_PLACE
defaultCustomerShouldNotBeFound("birthPlace.equals=" + UPDATED_BIRTH_PLACE);
}
@Test
@Transactional
public void getAllCustomersByBirthPlaceIsInShouldWork() throws Exception {
// Initialize the database
customerRepository.saveAndFlush(customer);
// Get all the customerList where birthPlace in DEFAULT_BIRTH_PLACE or UPDATED_BIRTH_PLACE
defaultCustomerShouldBeFound("birthPlace.in=" + DEFAULT_BIRTH_PLACE + "," + UPDATED_BIRTH_PLACE);
// Get all the customerList where birthPlace equals to UPDATED_BIRTH_PLACE
defaultCustomerShouldNotBeFound("birthPlace.in=" + UPDATED_BIRTH_PLACE);
}
@Test
@Transactional
public void getAllCustomersByBirthPlaceIsNullOrNotNull() throws Exception {
// Initialize the database
customerRepository.saveAndFlush(customer);
// Get all the customerList where birthPlace is not null
defaultCustomerShouldBeFound("birthPlace.specified=true");
// Get all the customerList where birthPlace is null
defaultCustomerShouldNotBeFound("birthPlace.specified=false");
}
@Test
@Transactional
public void getAllCustomersByRegistrationCourtIsEqualToSomething() throws Exception {
// Initialize the database
customerRepository.saveAndFlush(customer);
// Get all the customerList where registrationCourt equals to DEFAULT_REGISTRATION_COURT
defaultCustomerShouldBeFound("registrationCourt.equals=" + DEFAULT_REGISTRATION_COURT);
// Get all the customerList where registrationCourt equals to UPDATED_REGISTRATION_COURT
defaultCustomerShouldNotBeFound("registrationCourt.equals=" + UPDATED_REGISTRATION_COURT);
}
@Test
@Transactional
public void getAllCustomersByRegistrationCourtIsInShouldWork() throws Exception {
// Initialize the database
customerRepository.saveAndFlush(customer);
// Get all the customerList where registrationCourt in DEFAULT_REGISTRATION_COURT or UPDATED_REGISTRATION_COURT
defaultCustomerShouldBeFound("registrationCourt.in=" + DEFAULT_REGISTRATION_COURT + "," + UPDATED_REGISTRATION_COURT);
// Get all the customerList where registrationCourt equals to UPDATED_REGISTRATION_COURT
defaultCustomerShouldNotBeFound("registrationCourt.in=" + UPDATED_REGISTRATION_COURT);
}
@Test
@Transactional
public void getAllCustomersByRegistrationCourtIsNullOrNotNull() throws Exception {
// Initialize the database
customerRepository.saveAndFlush(customer);
// Get all the customerList where registrationCourt is not null
defaultCustomerShouldBeFound("registrationCourt.specified=true");
// Get all the customerList where registrationCourt is null
defaultCustomerShouldNotBeFound("registrationCourt.specified=false");
}
@Test
@Transactional
public void getAllCustomersByRegistrationNumberIsEqualToSomething() throws Exception {
// Initialize the database
customerRepository.saveAndFlush(customer);
// Get all the customerList where registrationNumber equals to DEFAULT_REGISTRATION_NUMBER
defaultCustomerShouldBeFound("registrationNumber.equals=" + DEFAULT_REGISTRATION_NUMBER);
// Get all the customerList where registrationNumber equals to UPDATED_REGISTRATION_NUMBER
defaultCustomerShouldNotBeFound("registrationNumber.equals=" + UPDATED_REGISTRATION_NUMBER);
}
@Test
@Transactional
public void getAllCustomersByRegistrationNumberIsInShouldWork() throws Exception {
// Initialize the database
customerRepository.saveAndFlush(customer);
// Get all the customerList where registrationNumber in DEFAULT_REGISTRATION_NUMBER or UPDATED_REGISTRATION_NUMBER
defaultCustomerShouldBeFound("registrationNumber.in=" + DEFAULT_REGISTRATION_NUMBER + "," + UPDATED_REGISTRATION_NUMBER);
// Get all the customerList where registrationNumber equals to UPDATED_REGISTRATION_NUMBER
defaultCustomerShouldNotBeFound("registrationNumber.in=" + UPDATED_REGISTRATION_NUMBER);
}
@Test
@Transactional
public void getAllCustomersByRegistrationNumberIsNullOrNotNull() throws Exception {
// Initialize the database
customerRepository.saveAndFlush(customer);
// Get all the customerList where registrationNumber is not null
defaultCustomerShouldBeFound("registrationNumber.specified=true");
// Get all the customerList where registrationNumber is null
defaultCustomerShouldNotBeFound("registrationNumber.specified=false");
}
@Test
@Transactional
public void getAllCustomersByVatRegionIsEqualToSomething() throws Exception {
// Initialize the database
customerRepository.saveAndFlush(customer);
// Get all the customerList where vatRegion equals to DEFAULT_VAT_REGION
defaultCustomerShouldBeFound("vatRegion.equals=" + DEFAULT_VAT_REGION);
// Get all the customerList where vatRegion equals to UPDATED_VAT_REGION
defaultCustomerShouldNotBeFound("vatRegion.equals=" + UPDATED_VAT_REGION);
}
@Test
@Transactional
public void getAllCustomersByVatRegionIsInShouldWork() throws Exception {
// Initialize the database
customerRepository.saveAndFlush(customer);
// Get all the customerList where vatRegion in DEFAULT_VAT_REGION or UPDATED_VAT_REGION
defaultCustomerShouldBeFound("vatRegion.in=" + DEFAULT_VAT_REGION + "," + UPDATED_VAT_REGION);
// Get all the customerList where vatRegion equals to UPDATED_VAT_REGION
defaultCustomerShouldNotBeFound("vatRegion.in=" + UPDATED_VAT_REGION);
}
@Test
@Transactional
public void getAllCustomersByVatRegionIsNullOrNotNull() throws Exception {
// Initialize the database
customerRepository.saveAndFlush(customer);
// Get all the customerList where vatRegion is not null
defaultCustomerShouldBeFound("vatRegion.specified=true");
// Get all the customerList where vatRegion is null
defaultCustomerShouldNotBeFound("vatRegion.specified=false");
}
@Test
@Transactional
public void getAllCustomersByVatNumberIsEqualToSomething() throws Exception {
// Initialize the database
customerRepository.saveAndFlush(customer);
// Get all the customerList where vatNumber equals to DEFAULT_VAT_NUMBER
defaultCustomerShouldBeFound("vatNumber.equals=" + DEFAULT_VAT_NUMBER);
// Get all the customerList where vatNumber equals to UPDATED_VAT_NUMBER
defaultCustomerShouldNotBeFound("vatNumber.equals=" + UPDATED_VAT_NUMBER);
}
@Test
@Transactional
public void getAllCustomersByVatNumberIsInShouldWork() throws Exception {
// Initialize the database
customerRepository.saveAndFlush(customer);
// Get all the customerList where vatNumber in DEFAULT_VAT_NUMBER or UPDATED_VAT_NUMBER
defaultCustomerShouldBeFound("vatNumber.in=" + DEFAULT_VAT_NUMBER + "," + UPDATED_VAT_NUMBER);
// Get all the customerList where vatNumber equals to UPDATED_VAT_NUMBER
defaultCustomerShouldNotBeFound("vatNumber.in=" + UPDATED_VAT_NUMBER);
}
@Test
@Transactional
public void getAllCustomersByVatNumberIsNullOrNotNull() throws Exception {
// Initialize the database
customerRepository.saveAndFlush(customer);
// Get all the customerList where vatNumber is not null
defaultCustomerShouldBeFound("vatNumber.specified=true");
// Get all the customerList where vatNumber is null
defaultCustomerShouldNotBeFound("vatNumber.specified=false");
}
@Test
@Transactional
public void getAllCustomersByContractualSalutationIsEqualToSomething() throws Exception {
@ -713,6 +1106,13 @@ public class CustomerResourceIntTest {
.andExpect(jsonPath("$.[*].reference").value(hasItem(DEFAULT_REFERENCE)))
.andExpect(jsonPath("$.[*].prefix").value(hasItem(DEFAULT_PREFIX)))
.andExpect(jsonPath("$.[*].name").value(hasItem(DEFAULT_NAME)))
.andExpect(jsonPath("$.[*].kind").value(hasItem(DEFAULT_KIND.toString())))
.andExpect(jsonPath("$.[*].birthDate").value(hasItem(DEFAULT_BIRTH_DATE.toString())))
.andExpect(jsonPath("$.[*].birthPlace").value(hasItem(DEFAULT_BIRTH_PLACE)))
.andExpect(jsonPath("$.[*].registrationCourt").value(hasItem(DEFAULT_REGISTRATION_COURT)))
.andExpect(jsonPath("$.[*].registrationNumber").value(hasItem(DEFAULT_REGISTRATION_NUMBER)))
.andExpect(jsonPath("$.[*].vatRegion").value(hasItem(DEFAULT_VAT_REGION.toString())))
.andExpect(jsonPath("$.[*].vatNumber").value(hasItem(DEFAULT_VAT_NUMBER)))
.andExpect(jsonPath("$.[*].contractualSalutation").value(hasItem(DEFAULT_CONTRACTUAL_SALUTATION)))
.andExpect(jsonPath("$.[*].contractualAddress").value(hasItem(DEFAULT_CONTRACTUAL_ADDRESS)))
.andExpect(jsonPath("$.[*].billingSalutation").value(hasItem(DEFAULT_BILLING_SALUTATION)))
@ -768,6 +1168,13 @@ public class CustomerResourceIntTest {
.reference(UPDATED_REFERENCE)
.prefix(UPDATED_PREFIX)
.name(UPDATED_NAME)
.kind(UPDATED_KIND)
.birthDate(UPDATED_BIRTH_DATE)
.birthPlace(UPDATED_BIRTH_PLACE)
.registrationCourt(UPDATED_REGISTRATION_COURT)
.registrationNumber(UPDATED_REGISTRATION_NUMBER)
.vatRegion(UPDATED_VAT_REGION)
.vatNumber(UPDATED_VAT_NUMBER)
.contractualSalutation(UPDATED_CONTRACTUAL_SALUTATION)
.contractualAddress(UPDATED_CONTRACTUAL_ADDRESS)
.billingSalutation(UPDATED_BILLING_SALUTATION)
@ -787,6 +1194,13 @@ public class CustomerResourceIntTest {
assertThat(testCustomer.getReference()).isEqualTo(UPDATED_REFERENCE);
assertThat(testCustomer.getPrefix()).isEqualTo(UPDATED_PREFIX);
assertThat(testCustomer.getName()).isEqualTo(UPDATED_NAME);
assertThat(testCustomer.getKind()).isEqualTo(UPDATED_KIND);
assertThat(testCustomer.getBirthDate()).isEqualTo(UPDATED_BIRTH_DATE);
assertThat(testCustomer.getBirthPlace()).isEqualTo(UPDATED_BIRTH_PLACE);
assertThat(testCustomer.getRegistrationCourt()).isEqualTo(UPDATED_REGISTRATION_COURT);
assertThat(testCustomer.getRegistrationNumber()).isEqualTo(UPDATED_REGISTRATION_NUMBER);
assertThat(testCustomer.getVatRegion()).isEqualTo(UPDATED_VAT_REGION);
assertThat(testCustomer.getVatNumber()).isEqualTo(UPDATED_VAT_NUMBER);
assertThat(testCustomer.getContractualSalutation()).isEqualTo(UPDATED_CONTRACTUAL_SALUTATION);
assertThat(testCustomer.getContractualAddress()).isEqualTo(UPDATED_CONTRACTUAL_ADDRESS);
assertThat(testCustomer.getBillingSalutation()).isEqualTo(UPDATED_BILLING_SALUTATION);

View File

@ -7,10 +7,19 @@ import org.hostsharing.hsadminng.domain.Membership;
import org.hostsharing.hsadminng.domain.Share;
import org.hostsharing.hsadminng.repository.MembershipRepository;
import org.hostsharing.hsadminng.service.MembershipQueryService;
import org.hostsharing.hsadminng.domain.Membership;
import org.hostsharing.hsadminng.domain.Share;
import org.hostsharing.hsadminng.domain.Asset;
import org.hostsharing.hsadminng.domain.Customer;
import org.hostsharing.hsadminng.repository.MembershipRepository;
import org.hostsharing.hsadminng.service.MembershipService;
import org.hostsharing.hsadminng.service.dto.MembershipDTO;
import org.hostsharing.hsadminng.service.mapper.MembershipMapper;
import org.hostsharing.hsadminng.web.rest.errors.ExceptionTranslator;
import org.hostsharing.hsadminng.service.dto.MembershipCriteria;
import org.hostsharing.hsadminng.service.MembershipQueryService;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -35,6 +44,11 @@ import java.util.Objects;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.hasItem;
import static org.hostsharing.hsadminng.web.rest.TestUtil.createFormattingConversionService;
import static org.hostsharing.hsadminng.web.rest.TestUtil.createFormattingConversionService;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.hasItem;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
@ -55,6 +69,17 @@ public class MembershipResourceIntTest {
private static final LocalDate DEFAULT_MEMBER_UNTIL = DEFAULT_MEMBER_FROM.plusYears(1).withMonth(12).withDayOfMonth(31);
private static final LocalDate UPDATED_MEMBER_UNTIL = UPDATED_MEMBER_FROM.plusYears(7).withMonth(12).withDayOfMonth(31);
private static final LocalDate DEFAULT_ADMISSION_DOCUMENT_DATE = LocalDate.ofEpochDay(0L);
private static final LocalDate UPDATED_ADMISSION_DOCUMENT_DATE = LocalDate.now(ZoneId.systemDefault());
private static final LocalDate DEFAULT_CANCELLATION_DOCUMENT_DATE = LocalDate.ofEpochDay(0L);
private static final LocalDate UPDATED_CANCELLATION_DOCUMENT_DATE = LocalDate.now(ZoneId.systemDefault());
private static final LocalDate DEFAULT_MEMBER_FROM_DATE = LocalDate.ofEpochDay(0L);
private static final LocalDate UPDATED_MEMBER_FROM_DATE = LocalDate.now(ZoneId.systemDefault());
private static final LocalDate DEFAULT_MEMBER_UNTIL_DATE = LocalDate.ofEpochDay(0L);
private static final LocalDate UPDATED_MEMBER_UNTIL_DATE = LocalDate.now(ZoneId.systemDefault());
private static final String DEFAULT_REMARK = "AAAAAAAAAA";
private static final String UPDATED_REMARK = "BBBBBBBBBB";
@ -104,15 +129,16 @@ public class MembershipResourceIntTest {
/**
* Create an entity for this test.
* <p>
*
* This is a static method, as tests for other entities might also need it,
* if they test an entity which requires the current entity.
*/
public static Membership createEntity(EntityManager em) {
Membership membership = new Membership()
.documentDate(DEFAULT_DOCUMENT_DATE)
.memberFrom(DEFAULT_MEMBER_FROM)
.memberUntil(DEFAULT_MEMBER_UNTIL)
.admissionDocumentDate(DEFAULT_ADMISSION_DOCUMENT_DATE)
.cancellationDocumentDate(DEFAULT_CANCELLATION_DOCUMENT_DATE)
.memberFromDate(DEFAULT_MEMBER_FROM_DATE)
.memberUntilDate(DEFAULT_MEMBER_UNTIL_DATE)
.remark(DEFAULT_REMARK);
// Add required entity
Customer customer = CustomerResourceIntTest.createEntity(em);
@ -130,7 +156,7 @@ public class MembershipResourceIntTest {
*/
public static Membership createPersistentEntity(EntityManager em, final Customer customer) {
Membership membership = new Membership()
.documentDate(DEFAULT_DOCUMENT_DATE)
.admissionDate(DEFAULT_ADMISSION_DATE)
.memberFrom(DEFAULT_MEMBER_FROM)
.memberUntil(DEFAULT_MEMBER_UNTIL)
.remark(DEFAULT_REMARK);
@ -162,9 +188,10 @@ public class MembershipResourceIntTest {
List<Membership> membershipList = membershipRepository.findAll();
assertThat(membershipList).hasSize(databaseSizeBeforeCreate + 1);
Membership testMembership = membershipList.get(membershipList.size() - 1);
assertThat(testMembership.getDocumentDate()).isEqualTo(DEFAULT_DOCUMENT_DATE);
assertThat(testMembership.getMemberFrom()).isEqualTo(DEFAULT_MEMBER_FROM);
assertThat(testMembership.getMemberUntil()).isEqualTo(DEFAULT_MEMBER_UNTIL);
assertThat(testMembership.getAdmissionDocumentDate()).isEqualTo(DEFAULT_ADMISSION_DOCUMENT_DATE);
assertThat(testMembership.getCancellationDocumentDate()).isEqualTo(DEFAULT_CANCELLATION_DOCUMENT_DATE);
assertThat(testMembership.getMemberFromDate()).isEqualTo(DEFAULT_MEMBER_FROM_DATE);
assertThat(testMembership.getMemberUntilDate()).isEqualTo(DEFAULT_MEMBER_UNTIL_DATE);
assertThat(testMembership.getRemark()).isEqualTo(DEFAULT_REMARK);
}
@ -190,10 +217,10 @@ public class MembershipResourceIntTest {
@Test
@Transactional
public void checkDocumentDateIsRequired() throws Exception {
public void checkAdmissionDocumentDateIsRequired() throws Exception {
int databaseSizeBeforeTest = membershipRepository.findAll().size();
// set the field null
membership.setDocumentDate(null);
membership.setAdmissionDocumentDate(null);
// Create the Membership, which fails.
MembershipDTO membershipDTO = membershipMapper.toDto(membership);
@ -209,10 +236,10 @@ public class MembershipResourceIntTest {
@Test
@Transactional
public void checkMemberFromIsRequired() throws Exception {
public void checkMemberFromDateIsRequired() throws Exception {
int databaseSizeBeforeTest = membershipRepository.findAll().size();
// set the field null
membership.setMemberFrom(null);
membership.setMemberFromDate(null);
// Create the Membership, which fails.
MembershipDTO membershipDTO = membershipMapper.toDto(membership);
@ -237,9 +264,10 @@ public class MembershipResourceIntTest {
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.[*].id").value(hasItem(membership.getId().intValue())))
.andExpect(jsonPath("$.[*].documentDate").value(hasItem(DEFAULT_DOCUMENT_DATE.toString())))
.andExpect(jsonPath("$.[*].memberFrom").value(hasItem(DEFAULT_MEMBER_FROM.toString())))
.andExpect(jsonPath("$.[*].memberUntil").value(hasItem(DEFAULT_MEMBER_UNTIL.toString())))
.andExpect(jsonPath("$.[*].admissionDocumentDate").value(hasItem(DEFAULT_ADMISSION_DOCUMENT_DATE.toString())))
.andExpect(jsonPath("$.[*].cancellationDocumentDate").value(hasItem(DEFAULT_CANCELLATION_DOCUMENT_DATE.toString())))
.andExpect(jsonPath("$.[*].memberFromDate").value(hasItem(DEFAULT_MEMBER_FROM_DATE.toString())))
.andExpect(jsonPath("$.[*].memberUntilDate").value(hasItem(DEFAULT_MEMBER_UNTIL_DATE.toString())))
.andExpect(jsonPath("$.[*].remark").value(hasItem(DEFAULT_REMARK.toString())));
}
@ -254,207 +282,274 @@ public class MembershipResourceIntTest {
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.id").value(membership.getId().intValue()))
.andExpect(jsonPath("$.documentDate").value(DEFAULT_DOCUMENT_DATE.toString()))
.andExpect(jsonPath("$.memberFrom").value(DEFAULT_MEMBER_FROM.toString()))
.andExpect(jsonPath("$.memberUntil").value(DEFAULT_MEMBER_UNTIL.toString()))
.andExpect(jsonPath("$.admissionDocumentDate").value(DEFAULT_ADMISSION_DOCUMENT_DATE.toString()))
.andExpect(jsonPath("$.cancellationDocumentDate").value(DEFAULT_CANCELLATION_DOCUMENT_DATE.toString()))
.andExpect(jsonPath("$.memberFromDate").value(DEFAULT_MEMBER_FROM_DATE.toString()))
.andExpect(jsonPath("$.memberUntilDate").value(DEFAULT_MEMBER_UNTIL_DATE.toString()))
.andExpect(jsonPath("$.remark").value(DEFAULT_REMARK.toString()));
}
@Test
@Transactional
public void getAllMembershipsByDocumentDateIsEqualToSomething() throws Exception {
public void getAllMembershipsByAdmissionDocumentDateIsEqualToSomething() throws Exception {
// Initialize the database
membershipRepository.saveAndFlush(membership);
// Get all the membershipList where documentDate equals to DEFAULT_DOCUMENT_DATE
defaultMembershipShouldBeFound("documentDate.equals=" + DEFAULT_DOCUMENT_DATE);
// Get all the membershipList where admissionDocumentDate equals to DEFAULT_ADMISSION_DOCUMENT_DATE
defaultMembershipShouldBeFound("admissionDocumentDate.equals=" + DEFAULT_ADMISSION_DOCUMENT_DATE);
// Get all the membershipList where documentDate equals to UPDATED_DOCUMENT_DATE
defaultMembershipShouldNotBeFound("documentDate.equals=" + UPDATED_DOCUMENT_DATE);
// Get all the membershipList where admissionDocumentDate equals to UPDATED_ADMISSION_DOCUMENT_DATE
defaultMembershipShouldNotBeFound("admissionDocumentDate.equals=" + UPDATED_ADMISSION_DOCUMENT_DATE);
}
@Test
@Transactional
public void getAllMembershipsByDocumentDateIsInShouldWork() throws Exception {
public void getAllMembershipsByAdmissionDocumentDateIsInShouldWork() throws Exception {
// Initialize the database
membershipRepository.saveAndFlush(membership);
// Get all the membershipList where documentDate in DEFAULT_DOCUMENT_DATE or UPDATED_DOCUMENT_DATE
defaultMembershipShouldBeFound("documentDate.in=" + DEFAULT_DOCUMENT_DATE + "," + UPDATED_DOCUMENT_DATE);
// Get all the membershipList where admissionDocumentDate in DEFAULT_ADMISSION_DOCUMENT_DATE or UPDATED_ADMISSION_DOCUMENT_DATE
defaultMembershipShouldBeFound("admissionDocumentDate.in=" + DEFAULT_ADMISSION_DOCUMENT_DATE + "," + UPDATED_ADMISSION_DOCUMENT_DATE);
// Get all the membershipList where documentDate equals to UPDATED_DOCUMENT_DATE
defaultMembershipShouldNotBeFound("documentDate.in=" + UPDATED_DOCUMENT_DATE);
// Get all the membershipList where admissionDocumentDate equals to UPDATED_ADMISSION_DOCUMENT_DATE
defaultMembershipShouldNotBeFound("admissionDocumentDate.in=" + UPDATED_ADMISSION_DOCUMENT_DATE);
}
@Test
@Transactional
public void getAllMembershipsByDocumentDateIsNullOrNotNull() throws Exception {
public void getAllMembershipsByAdmissionDocumentDateIsNullOrNotNull() throws Exception {
// Initialize the database
membershipRepository.saveAndFlush(membership);
// Get all the membershipList where documentDate is not null
defaultMembershipShouldBeFound("documentDate.specified=true");
// Get all the membershipList where admissionDocumentDate is not null
defaultMembershipShouldBeFound("admissionDocumentDate.specified=true");
// Get all the membershipList where documentDate is null
defaultMembershipShouldNotBeFound("documentDate.specified=false");
// Get all the membershipList where admissionDocumentDate is null
defaultMembershipShouldNotBeFound("admissionDocumentDate.specified=false");
}
@Test
@Transactional
public void getAllMembershipsByDocumentDateIsGreaterThanOrEqualToSomething() throws Exception {
public void getAllMembershipsByAdmissionDocumentDateIsGreaterThanOrEqualToSomething() throws Exception {
// Initialize the database
membershipRepository.saveAndFlush(membership);
// Get all the membershipList where documentDate greater than or equals to DEFAULT_DOCUMENT_DATE
defaultMembershipShouldBeFound("documentDate.greaterOrEqualThan=" + DEFAULT_DOCUMENT_DATE);
// Get all the membershipList where admissionDocumentDate greater than or equals to DEFAULT_ADMISSION_DOCUMENT_DATE
defaultMembershipShouldBeFound("admissionDocumentDate.greaterOrEqualThan=" + DEFAULT_ADMISSION_DOCUMENT_DATE);
// Get all the membershipList where documentDate greater than or equals to UPDATED_DOCUMENT_DATE
defaultMembershipShouldNotBeFound("documentDate.greaterOrEqualThan=" + UPDATED_DOCUMENT_DATE);
// Get all the membershipList where admissionDocumentDate greater than or equals to UPDATED_ADMISSION_DOCUMENT_DATE
defaultMembershipShouldNotBeFound("admissionDocumentDate.greaterOrEqualThan=" + UPDATED_ADMISSION_DOCUMENT_DATE);
}
@Test
@Transactional
public void getAllMembershipsByDocumentDateIsLessThanSomething() throws Exception {
public void getAllMembershipsByAdmissionDocumentDateIsLessThanSomething() throws Exception {
// Initialize the database
membershipRepository.saveAndFlush(membership);
// Get all the membershipList where documentDate less than or equals to DEFAULT_DOCUMENT_DATE
defaultMembershipShouldNotBeFound("documentDate.lessThan=" + DEFAULT_DOCUMENT_DATE);
// Get all the membershipList where admissionDocumentDate less than or equals to DEFAULT_ADMISSION_DOCUMENT_DATE
defaultMembershipShouldNotBeFound("admissionDocumentDate.lessThan=" + DEFAULT_ADMISSION_DOCUMENT_DATE);
// Get all the membershipList where documentDate less than or equals to UPDATED_DOCUMENT_DATE
defaultMembershipShouldBeFound("documentDate.lessThan=" + UPDATED_DOCUMENT_DATE);
// Get all the membershipList where admissionDocumentDate less than or equals to UPDATED_ADMISSION_DOCUMENT_DATE
defaultMembershipShouldBeFound("admissionDocumentDate.lessThan=" + UPDATED_ADMISSION_DOCUMENT_DATE);
}
@Test
@Transactional
public void getAllMembershipsByMemberFromIsEqualToSomething() throws Exception {
public void getAllMembershipsByCancellationDocumentDateIsEqualToSomething() throws Exception {
// Initialize the database
membershipRepository.saveAndFlush(membership);
// Get all the membershipList where memberFrom equals to DEFAULT_MEMBER_FROM
defaultMembershipShouldBeFound("memberFrom.equals=" + DEFAULT_MEMBER_FROM);
// Get all the membershipList where cancellationDocumentDate equals to DEFAULT_CANCELLATION_DOCUMENT_DATE
defaultMembershipShouldBeFound("cancellationDocumentDate.equals=" + DEFAULT_CANCELLATION_DOCUMENT_DATE);
// Get all the membershipList where memberFrom equals to UPDATED_MEMBER_FROM
defaultMembershipShouldNotBeFound("memberFrom.equals=" + UPDATED_MEMBER_FROM);
// Get all the membershipList where cancellationDocumentDate equals to UPDATED_CANCELLATION_DOCUMENT_DATE
defaultMembershipShouldNotBeFound("cancellationDocumentDate.equals=" + UPDATED_CANCELLATION_DOCUMENT_DATE);
}
@Test
@Transactional
public void getAllMembershipsByMemberFromIsInShouldWork() throws Exception {
public void getAllMembershipsByCancellationDocumentDateIsInShouldWork() throws Exception {
// Initialize the database
membershipRepository.saveAndFlush(membership);
// Get all the membershipList where memberFrom in DEFAULT_MEMBER_FROM or UPDATED_MEMBER_FROM
defaultMembershipShouldBeFound("memberFrom.in=" + DEFAULT_MEMBER_FROM + "," + UPDATED_MEMBER_FROM);
// Get all the membershipList where cancellationDocumentDate in DEFAULT_CANCELLATION_DOCUMENT_DATE or UPDATED_CANCELLATION_DOCUMENT_DATE
defaultMembershipShouldBeFound("cancellationDocumentDate.in=" + DEFAULT_CANCELLATION_DOCUMENT_DATE + "," + UPDATED_CANCELLATION_DOCUMENT_DATE);
// Get all the membershipList where memberFrom equals to UPDATED_MEMBER_FROM
defaultMembershipShouldNotBeFound("memberFrom.in=" + UPDATED_MEMBER_FROM);
// Get all the membershipList where cancellationDocumentDate equals to UPDATED_CANCELLATION_DOCUMENT_DATE
defaultMembershipShouldNotBeFound("cancellationDocumentDate.in=" + UPDATED_CANCELLATION_DOCUMENT_DATE);
}
@Test
@Transactional
public void getAllMembershipsByMemberFromIsNullOrNotNull() throws Exception {
public void getAllMembershipsByCancellationDocumentDateIsNullOrNotNull() throws Exception {
// Initialize the database
membershipRepository.saveAndFlush(membership);
// Get all the membershipList where memberFrom is not null
defaultMembershipShouldBeFound("memberFrom.specified=true");
// Get all the membershipList where cancellationDocumentDate is not null
defaultMembershipShouldBeFound("cancellationDocumentDate.specified=true");
// Get all the membershipList where memberFrom is null
defaultMembershipShouldNotBeFound("memberFrom.specified=false");
// Get all the membershipList where cancellationDocumentDate is null
defaultMembershipShouldNotBeFound("cancellationDocumentDate.specified=false");
}
@Test
@Transactional
public void getAllMembershipsByMemberFromIsGreaterThanOrEqualToSomething() throws Exception {
public void getAllMembershipsByCancellationDocumentDateIsGreaterThanOrEqualToSomething() throws Exception {
// Initialize the database
membershipRepository.saveAndFlush(membership);
// Get all the membershipList where memberFrom greater than or equals to DEFAULT_MEMBER_FROM
defaultMembershipShouldBeFound("memberFrom.greaterOrEqualThan=" + DEFAULT_MEMBER_FROM);
// Get all the membershipList where cancellationDocumentDate greater than or equals to DEFAULT_CANCELLATION_DOCUMENT_DATE
defaultMembershipShouldBeFound("cancellationDocumentDate.greaterOrEqualThan=" + DEFAULT_CANCELLATION_DOCUMENT_DATE);
// Get all the membershipList where memberFrom greater than or equals to UPDATED_MEMBER_FROM
defaultMembershipShouldNotBeFound("memberFrom.greaterOrEqualThan=" + UPDATED_MEMBER_FROM);
// Get all the membershipList where cancellationDocumentDate greater than or equals to UPDATED_CANCELLATION_DOCUMENT_DATE
defaultMembershipShouldNotBeFound("cancellationDocumentDate.greaterOrEqualThan=" + UPDATED_CANCELLATION_DOCUMENT_DATE);
}
@Test
@Transactional
public void getAllMembershipsByMemberFromIsLessThanSomething() throws Exception {
public void getAllMembershipsByCancellationDocumentDateIsLessThanSomething() throws Exception {
// Initialize the database
membershipRepository.saveAndFlush(membership);
// Get all the membershipList where memberFrom less than or equals to DEFAULT_MEMBER_FROM
defaultMembershipShouldNotBeFound("memberFrom.lessThan=" + DEFAULT_MEMBER_FROM);
// Get all the membershipList where cancellationDocumentDate less than or equals to DEFAULT_CANCELLATION_DOCUMENT_DATE
defaultMembershipShouldNotBeFound("cancellationDocumentDate.lessThan=" + DEFAULT_CANCELLATION_DOCUMENT_DATE);
// Get all the membershipList where memberFrom less than or equals to UPDATED_MEMBER_FROM
defaultMembershipShouldBeFound("memberFrom.lessThan=" + UPDATED_MEMBER_FROM);
// Get all the membershipList where cancellationDocumentDate less than or equals to UPDATED_CANCELLATION_DOCUMENT_DATE
defaultMembershipShouldBeFound("cancellationDocumentDate.lessThan=" + UPDATED_CANCELLATION_DOCUMENT_DATE);
}
@Test
@Transactional
public void getAllMembershipsByMemberUntilIsEqualToSomething() throws Exception {
public void getAllMembershipsByMemberFromDateIsEqualToSomething() throws Exception {
// Initialize the database
membershipRepository.saveAndFlush(membership);
// Get all the membershipList where memberUntil equals to DEFAULT_MEMBER_UNTIL
defaultMembershipShouldBeFound("memberUntil.equals=" + DEFAULT_MEMBER_UNTIL);
// Get all the membershipList where memberFromDate equals to DEFAULT_MEMBER_FROM_DATE
defaultMembershipShouldBeFound("memberFromDate.equals=" + DEFAULT_MEMBER_FROM_DATE);
// Get all the membershipList where memberUntil equals to UPDATED_MEMBER_UNTIL
defaultMembershipShouldNotBeFound("memberUntil.equals=" + UPDATED_MEMBER_UNTIL);
// Get all the membershipList where memberFromDate equals to UPDATED_MEMBER_FROM_DATE
defaultMembershipShouldNotBeFound("memberFromDate.equals=" + UPDATED_MEMBER_FROM_DATE);
}
@Test
@Transactional
public void getAllMembershipsByMemberUntilIsInShouldWork() throws Exception {
public void getAllMembershipsByMemberFromDateIsInShouldWork() throws Exception {
// Initialize the database
membershipRepository.saveAndFlush(membership);
// Get all the membershipList where memberUntil in DEFAULT_MEMBER_UNTIL or UPDATED_MEMBER_UNTIL
defaultMembershipShouldBeFound("memberUntil.in=" + DEFAULT_MEMBER_UNTIL + "," + UPDATED_MEMBER_UNTIL);
// Get all the membershipList where memberFromDate in DEFAULT_MEMBER_FROM_DATE or UPDATED_MEMBER_FROM_DATE
defaultMembershipShouldBeFound("memberFromDate.in=" + DEFAULT_MEMBER_FROM_DATE + "," + UPDATED_MEMBER_FROM_DATE);
// Get all the membershipList where memberUntil equals to UPDATED_MEMBER_UNTIL
defaultMembershipShouldNotBeFound("memberUntil.in=" + UPDATED_MEMBER_UNTIL);
// Get all the membershipList where memberFromDate equals to UPDATED_MEMBER_FROM_DATE
defaultMembershipShouldNotBeFound("memberFromDate.in=" + UPDATED_MEMBER_FROM_DATE);
}
@Test
@Transactional
public void getAllMembershipsByMemberUntilIsNullOrNotNull() throws Exception {
public void getAllMembershipsByMemberFromDateIsNullOrNotNull() throws Exception {
// Initialize the database
membershipRepository.saveAndFlush(membership);
// Get all the membershipList where memberUntil is not null
defaultMembershipShouldBeFound("memberUntil.specified=true");
// Get all the membershipList where memberFromDate is not null
defaultMembershipShouldBeFound("memberFromDate.specified=true");
// Get all the membershipList where memberUntil is null
defaultMembershipShouldNotBeFound("memberUntil.specified=false");
// Get all the membershipList where memberFromDate is null
defaultMembershipShouldNotBeFound("memberFromDate.specified=false");
}
@Test
@Transactional
public void getAllMembershipsByMemberUntilIsGreaterThanOrEqualToSomething() throws Exception {
public void getAllMembershipsByMemberFromDateIsGreaterThanOrEqualToSomething() throws Exception {
// Initialize the database
membershipRepository.saveAndFlush(membership);
// Get all the membershipList where memberUntil greater than or equals to DEFAULT_MEMBER_UNTIL
defaultMembershipShouldBeFound("memberUntil.greaterOrEqualThan=" + DEFAULT_MEMBER_UNTIL);
// Get all the membershipList where memberFromDate greater than or equals to DEFAULT_MEMBER_FROM_DATE
defaultMembershipShouldBeFound("memberFromDate.greaterOrEqualThan=" + DEFAULT_MEMBER_FROM_DATE);
// Get all the membershipList where memberUntil greater than or equals to UPDATED_MEMBER_UNTIL
defaultMembershipShouldNotBeFound("memberUntil.greaterOrEqualThan=" + UPDATED_MEMBER_UNTIL);
// Get all the membershipList where memberFromDate greater than or equals to UPDATED_MEMBER_FROM_DATE
defaultMembershipShouldNotBeFound("memberFromDate.greaterOrEqualThan=" + UPDATED_MEMBER_FROM_DATE);
}
@Test
@Transactional
public void getAllMembershipsByMemberUntilIsLessThanSomething() throws Exception {
public void getAllMembershipsByMemberFromDateIsLessThanSomething() throws Exception {
// Initialize the database
membershipRepository.saveAndFlush(membership);
// Get all the membershipList where memberUntil less than or equals to DEFAULT_MEMBER_UNTIL
defaultMembershipShouldNotBeFound("memberUntil.lessThan=" + DEFAULT_MEMBER_UNTIL);
// Get all the membershipList where memberFromDate less than or equals to DEFAULT_MEMBER_FROM_DATE
defaultMembershipShouldNotBeFound("memberFromDate.lessThan=" + DEFAULT_MEMBER_FROM_DATE);
// Get all the membershipList where memberUntil less than or equals to UPDATED_MEMBER_UNTIL
defaultMembershipShouldBeFound("memberUntil.lessThan=" + UPDATED_MEMBER_UNTIL);
// Get all the membershipList where memberFromDate less than or equals to UPDATED_MEMBER_FROM_DATE
defaultMembershipShouldBeFound("memberFromDate.lessThan=" + UPDATED_MEMBER_FROM_DATE);
}
@Test
@Transactional
public void getAllMembershipsByMemberUntilDateIsEqualToSomething() throws Exception {
// Initialize the database
membershipRepository.saveAndFlush(membership);
// Get all the membershipList where memberUntilDate equals to DEFAULT_MEMBER_UNTIL_DATE
defaultMembershipShouldBeFound("memberUntilDate.equals=" + DEFAULT_MEMBER_UNTIL_DATE);
// Get all the membershipList where memberUntilDate equals to UPDATED_MEMBER_UNTIL_DATE
defaultMembershipShouldNotBeFound("memberUntilDate.equals=" + UPDATED_MEMBER_UNTIL_DATE);
}
@Test
@Transactional
public void getAllMembershipsByMemberUntilDateIsInShouldWork() throws Exception {
// Initialize the database
membershipRepository.saveAndFlush(membership);
// Get all the membershipList where memberUntilDate in DEFAULT_MEMBER_UNTIL_DATE or UPDATED_MEMBER_UNTIL_DATE
defaultMembershipShouldBeFound("memberUntilDate.in=" + DEFAULT_MEMBER_UNTIL_DATE + "," + UPDATED_MEMBER_UNTIL_DATE);
// Get all the membershipList where memberUntilDate equals to UPDATED_MEMBER_UNTIL_DATE
defaultMembershipShouldNotBeFound("memberUntilDate.in=" + UPDATED_MEMBER_UNTIL_DATE);
}
@Test
@Transactional
public void getAllMembershipsByMemberUntilDateIsNullOrNotNull() throws Exception {
// Initialize the database
membershipRepository.saveAndFlush(membership);
// Get all the membershipList where memberUntilDate is not null
defaultMembershipShouldBeFound("memberUntilDate.specified=true");
// Get all the membershipList where memberUntilDate is null
defaultMembershipShouldNotBeFound("memberUntilDate.specified=false");
}
@Test
@Transactional
public void getAllMembershipsByMemberUntilDateIsGreaterThanOrEqualToSomething() throws Exception {
// Initialize the database
membershipRepository.saveAndFlush(membership);
// Get all the membershipList where memberUntilDate greater than or equals to DEFAULT_MEMBER_UNTIL_DATE
defaultMembershipShouldBeFound("memberUntilDate.greaterOrEqualThan=" + DEFAULT_MEMBER_UNTIL_DATE);
// Get all the membershipList where memberUntilDate greater than or equals to UPDATED_MEMBER_UNTIL_DATE
defaultMembershipShouldNotBeFound("memberUntilDate.greaterOrEqualThan=" + UPDATED_MEMBER_UNTIL_DATE);
}
@Test
@Transactional
public void getAllMembershipsByMemberUntilDateIsLessThanSomething() throws Exception {
// Initialize the database
membershipRepository.saveAndFlush(membership);
// Get all the membershipList where memberUntilDate less than or equals to DEFAULT_MEMBER_UNTIL_DATE
defaultMembershipShouldNotBeFound("memberUntilDate.lessThan=" + DEFAULT_MEMBER_UNTIL_DATE);
// Get all the membershipList where memberUntilDate less than or equals to UPDATED_MEMBER_UNTIL_DATE
defaultMembershipShouldBeFound("memberUntilDate.lessThan=" + UPDATED_MEMBER_UNTIL_DATE);
}
@ -501,11 +596,12 @@ public class MembershipResourceIntTest {
@Transactional
public void getAllMembershipsByShareIsEqualToSomething() throws Exception {
// Initialize the database
membershipRepository.saveAndFlush(membership);
Share share = ShareResourceIntTest.createPersistentEntity(em, membership);
membership.addShare(share);
Long shareId = share.getId();
Share share = ShareResourceIntTest.createEntity(em);
em.persist(share);
em.flush();
membership.addShare(share);
membershipRepository.saveAndFlush(membership);
Long shareId = share.getId();
// Get all the membershipList where share equals to shareId
defaultMembershipShouldBeFound("shareId.equals=" + shareId);
@ -514,14 +610,16 @@ public class MembershipResourceIntTest {
defaultMembershipShouldNotBeFound("shareId.equals=" + (shareId + 1));
}
@Test
@Transactional
public void getAllMembershipsByAssetIsEqualToSomething() throws Exception {
// Initialize the database
membershipRepository.saveAndFlush(membership);
Asset asset = AssetResourceIntTest.createPersistentEntity(em, membership);
membership.addAsset(asset);
Asset asset = AssetResourceIntTest.createEntity(em);
em.persist(asset);
em.flush();
membership.addAsset(asset);
membershipRepository.saveAndFlush(membership);
Long assetId = asset.getId();
// Get all the membershipList where asset equals to assetId
@ -536,7 +634,9 @@ public class MembershipResourceIntTest {
@Transactional
public void getAllMembershipsByCustomerIsEqualToSomething() throws Exception {
// Initialize the database
Customer customer = CustomerResourceIntTest.createPersistentEntity(em);
Customer customer = CustomerResourceIntTest.createEntity(em);
em.persist(customer);
em.flush();
membership.setCustomer(customer);
membershipRepository.saveAndFlush(membership);
Long customerId = customer.getId();
@ -556,9 +656,10 @@ public class MembershipResourceIntTest {
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.[*].id").value(hasItem(membership.getId().intValue())))
.andExpect(jsonPath("$.[*].documentDate").value(hasItem(DEFAULT_DOCUMENT_DATE.toString())))
.andExpect(jsonPath("$.[*].memberFrom").value(hasItem(DEFAULT_MEMBER_FROM.toString())))
//.andExpect(jsonPath("$.[*].memberUntil").value(hasItem(DEFAULT_MEMBER_UNTIL.toString())))
.andExpect(jsonPath("$.[*].admissionDocumentDate").value(hasItem(DEFAULT_ADMISSION_DOCUMENT_DATE.toString())))
.andExpect(jsonPath("$.[*].cancellationDocumentDate").value(hasItem(DEFAULT_CANCELLATION_DOCUMENT_DATE.toString())))
.andExpect(jsonPath("$.[*].memberFromDate").value(hasItem(DEFAULT_MEMBER_FROM_DATE.toString())))
.andExpect(jsonPath("$.[*].memberUntilDate").value(hasItem(DEFAULT_MEMBER_UNTIL_DATE.toString())))
.andExpect(jsonPath("$.[*].remark").value(hasItem(DEFAULT_REMARK)));
// Check, that the count call also returns 1
@ -607,9 +708,10 @@ public class MembershipResourceIntTest {
// Disconnect from session so that the updates on updatedMembership are not directly saved in db
em.detach(updatedMembership);
updatedMembership
.documentDate(UPDATED_DOCUMENT_DATE)
.memberFrom(UPDATED_MEMBER_FROM)
.memberUntil(UPDATED_MEMBER_UNTIL)
.admissionDocumentDate(UPDATED_ADMISSION_DOCUMENT_DATE)
.cancellationDocumentDate(UPDATED_CANCELLATION_DOCUMENT_DATE)
.memberFromDate(UPDATED_MEMBER_FROM_DATE)
.memberUntilDate(UPDATED_MEMBER_UNTIL_DATE)
.remark(UPDATED_REMARK);
MembershipDTO membershipDTO = membershipMapper.toDto(updatedMembership);
@ -622,9 +724,10 @@ public class MembershipResourceIntTest {
List<Membership> membershipList = membershipRepository.findAll();
assertThat(membershipList).hasSize(databaseSizeBeforeUpdate);
Membership testMembership = membershipList.get(membershipList.size() - 1);
assertThat(testMembership.getDocumentDate()).isEqualTo(UPDATED_DOCUMENT_DATE);
assertThat(testMembership.getMemberFrom()).isEqualTo(UPDATED_MEMBER_FROM);
assertThat(testMembership.getMemberUntil()).isEqualTo(UPDATED_MEMBER_UNTIL);
assertThat(testMembership.getAdmissionDocumentDate()).isEqualTo(UPDATED_ADMISSION_DOCUMENT_DATE);
assertThat(testMembership.getCancellationDocumentDate()).isEqualTo(UPDATED_CANCELLATION_DOCUMENT_DATE);
assertThat(testMembership.getMemberFromDate()).isEqualTo(UPDATED_MEMBER_FROM_DATE);
assertThat(testMembership.getMemberUntilDate()).isEqualTo(UPDATED_MEMBER_UNTIL_DATE);
assertThat(testMembership.getRemark()).isEqualTo(UPDATED_REMARK);
}
@ -658,11 +761,11 @@ public class MembershipResourceIntTest {
// Delete the membership
restMembershipMockMvc.perform(delete("/api/memberships/{id}", membership.getId())
.accept(TestUtil.APPLICATION_JSON_UTF8))
.andExpect(status().isBadRequest());
.andExpect(status().isOk());
// Validate the database still contains the same number of memberships
// Validate the database is empty
List<Membership> membershipList = membershipRepository.findAll();
assertThat(membershipList).hasSize(databaseSizeBeforeDelete);
assertThat(membershipList).hasSize(databaseSizeBeforeDelete - 1);
}
@Test

View File

@ -71,6 +71,20 @@ public class SepaMandateResourceIntTest {
private static final LocalDate DEFAULT_CANCELLATION_DATE = LocalDate.ofEpochDay(0L);
private static final LocalDate UPDATED_CANCELLATION_DATE = LocalDate.now(ZoneId.systemDefault());
private static final LocalDate DEFAULT_GRANTING_DOCUMENT_DATE = LocalDate.ofEpochDay(0L);
private static final LocalDate UPDATED_GRANTING_DOCUMENT_DATE = LocalDate.now(ZoneId.systemDefault());
private static final LocalDate DEFAULT_REVOKATION_DOCUMENT_DATE = LocalDate.ofEpochDay(0L);
private static final LocalDate UPDATED_REVOKATION_DOCUMENT_DATE = LocalDate.now(ZoneId.systemDefault());
private static final LocalDate DEFAULT_VALID_FROM_DATE = LocalDate.ofEpochDay(0L);
private static final LocalDate UPDATED_VALID_FROM_DATE = LocalDate.now(ZoneId.systemDefault());
private static final LocalDate DEFAULT_VALID_UNTIL_DATE = LocalDate.ofEpochDay(0L);
private static final LocalDate UPDATED_VALID_UNTIL_DATE = LocalDate.now(ZoneId.systemDefault());
private static final LocalDate DEFAULT_LAST_USED_DATE = LocalDate.ofEpochDay(0L);
private static final LocalDate UPDATED_LAST_USED_DATE = LocalDate.now(ZoneId.systemDefault());
private static final String DEFAULT_REMARK = "AAAAAAAAAA";
private static final String UPDATED_REMARK = "BBBBBBBBBB";
@ -129,11 +143,11 @@ public class SepaMandateResourceIntTest {
.reference(DEFAULT_REFERENCE)
.iban(DEFAULT_IBAN)
.bic(DEFAULT_BIC)
.documentDate(DEFAULT_DOCUMENT_DATE)
.validFrom(DEFAULT_VALID_FROM)
.validUntil(DEFAULT_VALID_UNTIL)
.lastUsed(DEFAULT_LAST_USED)
.cancellationDate(DEFAULT_CANCELLATION_DATE)
.grantingDocumentDate(DEFAULT_GRANTING_DOCUMENT_DATE)
.revokationDocumentDate(DEFAULT_REVOKATION_DOCUMENT_DATE)
.validFromDate(DEFAULT_VALID_FROM_DATE)
.validUntilDate(DEFAULT_VALID_UNTIL_DATE)
.lastUsedDate(DEFAULT_LAST_USED_DATE)
.remark(DEFAULT_REMARK);
// Add required entity
Customer customer = CustomerResourceIntTest.createEntity(em);
@ -143,28 +157,6 @@ public class SepaMandateResourceIntTest {
return sepaMandate;
}
/**
* Create an entity for tests with a specific customer.
*
* This is a static method, as tests for other entities might also need it,
* if they test an entity which requires the current entity.
*/
public static SepaMandate createEntity(EntityManager em, final Customer customer) {
SepaMandate sepaMandate = new SepaMandate()
.reference(DEFAULT_REFERENCE)
.iban(DEFAULT_IBAN)
.bic(DEFAULT_BIC)
.documentDate(DEFAULT_DOCUMENT_DATE)
.validFrom(DEFAULT_VALID_FROM)
.validUntil(DEFAULT_VALID_UNTIL)
.lastUsed(DEFAULT_LAST_USED)
.cancellationDate(DEFAULT_CANCELLATION_DATE)
.remark(DEFAULT_REMARK);
// Add required entity
sepaMandate.setCustomer(customer);
return sepaMandate;
}
@Before
public void initTest() {
sepaMandate = createEntity(em);
@ -189,11 +181,11 @@ public class SepaMandateResourceIntTest {
assertThat(testSepaMandate.getReference()).isEqualTo(DEFAULT_REFERENCE);
assertThat(testSepaMandate.getIban()).isEqualTo(DEFAULT_IBAN);
assertThat(testSepaMandate.getBic()).isEqualTo(DEFAULT_BIC);
assertThat(testSepaMandate.getDocumentDate()).isEqualTo(DEFAULT_DOCUMENT_DATE);
assertThat(testSepaMandate.getValidFrom()).isEqualTo(DEFAULT_VALID_FROM);
assertThat(testSepaMandate.getValidUntil()).isEqualTo(DEFAULT_VALID_UNTIL);
assertThat(testSepaMandate.getLastUsed()).isEqualTo(DEFAULT_LAST_USED);
assertThat(testSepaMandate.getCancellationDate()).isEqualTo(DEFAULT_CANCELLATION_DATE);
assertThat(testSepaMandate.getGrantingDocumentDate()).isEqualTo(DEFAULT_GRANTING_DOCUMENT_DATE);
assertThat(testSepaMandate.getRevokationDocumentDate()).isEqualTo(DEFAULT_REVOKATION_DOCUMENT_DATE);
assertThat(testSepaMandate.getValidFromDate()).isEqualTo(DEFAULT_VALID_FROM_DATE);
assertThat(testSepaMandate.getValidUntilDate()).isEqualTo(DEFAULT_VALID_UNTIL_DATE);
assertThat(testSepaMandate.getLastUsedDate()).isEqualTo(DEFAULT_LAST_USED_DATE);
assertThat(testSepaMandate.getRemark()).isEqualTo(DEFAULT_REMARK);
}
@ -238,10 +230,10 @@ public class SepaMandateResourceIntTest {
@Test
@Transactional
public void checkDocumentDateIsRequired() throws Exception {
public void checkGrantingDocumentDateIsRequired() throws Exception {
int databaseSizeBeforeTest = sepaMandateRepository.findAll().size();
// set the field null
sepaMandate.setDocumentDate(null);
sepaMandate.setGrantingDocumentDate(null);
// Create the SepaMandate, which fails.
SepaMandateDTO sepaMandateDTO = sepaMandateMapper.toDto(sepaMandate);
@ -257,10 +249,10 @@ public class SepaMandateResourceIntTest {
@Test
@Transactional
public void checkValidFromIsRequired() throws Exception {
public void checkValidFromDateIsRequired() throws Exception {
int databaseSizeBeforeTest = sepaMandateRepository.findAll().size();
// set the field null
sepaMandate.setValidFrom(null);
sepaMandate.setValidFromDate(null);
// Create the SepaMandate, which fails.
SepaMandateDTO sepaMandateDTO = sepaMandateMapper.toDto(sepaMandate);
@ -288,11 +280,11 @@ public class SepaMandateResourceIntTest {
.andExpect(jsonPath("$.[*].reference").value(hasItem(DEFAULT_REFERENCE.toString())))
.andExpect(jsonPath("$.[*].iban").value(hasItem(DEFAULT_IBAN.toString())))
.andExpect(jsonPath("$.[*].bic").value(hasItem(DEFAULT_BIC.toString())))
.andExpect(jsonPath("$.[*].documentDate").value(hasItem(DEFAULT_DOCUMENT_DATE.toString())))
.andExpect(jsonPath("$.[*].validFrom").value(hasItem(DEFAULT_VALID_FROM.toString())))
.andExpect(jsonPath("$.[*].validUntil").value(hasItem(DEFAULT_VALID_UNTIL.toString())))
.andExpect(jsonPath("$.[*].lastUsed").value(hasItem(DEFAULT_LAST_USED.toString())))
.andExpect(jsonPath("$.[*].cancellationDate").value(hasItem(DEFAULT_CANCELLATION_DATE.toString())))
.andExpect(jsonPath("$.[*].grantingDocumentDate").value(hasItem(DEFAULT_GRANTING_DOCUMENT_DATE.toString())))
.andExpect(jsonPath("$.[*].revokationDocumentDate").value(hasItem(DEFAULT_REVOKATION_DOCUMENT_DATE.toString())))
.andExpect(jsonPath("$.[*].validFromDate").value(hasItem(DEFAULT_VALID_FROM_DATE.toString())))
.andExpect(jsonPath("$.[*].validUntilDate").value(hasItem(DEFAULT_VALID_UNTIL_DATE.toString())))
.andExpect(jsonPath("$.[*].lastUsedDate").value(hasItem(DEFAULT_LAST_USED_DATE.toString())))
.andExpect(jsonPath("$.[*].remark").value(hasItem(DEFAULT_REMARK.toString())));
}
@ -310,11 +302,11 @@ public class SepaMandateResourceIntTest {
.andExpect(jsonPath("$.reference").value(DEFAULT_REFERENCE.toString()))
.andExpect(jsonPath("$.iban").value(DEFAULT_IBAN.toString()))
.andExpect(jsonPath("$.bic").value(DEFAULT_BIC.toString()))
.andExpect(jsonPath("$.documentDate").value(DEFAULT_DOCUMENT_DATE.toString()))
.andExpect(jsonPath("$.validFrom").value(DEFAULT_VALID_FROM.toString()))
.andExpect(jsonPath("$.validUntil").value(DEFAULT_VALID_UNTIL.toString()))
.andExpect(jsonPath("$.lastUsed").value(DEFAULT_LAST_USED.toString()))
.andExpect(jsonPath("$.cancellationDate").value(DEFAULT_CANCELLATION_DATE.toString()))
.andExpect(jsonPath("$.grantingDocumentDate").value(DEFAULT_GRANTING_DOCUMENT_DATE.toString()))
.andExpect(jsonPath("$.revokationDocumentDate").value(DEFAULT_REVOKATION_DOCUMENT_DATE.toString()))
.andExpect(jsonPath("$.validFromDate").value(DEFAULT_VALID_FROM_DATE.toString()))
.andExpect(jsonPath("$.validUntilDate").value(DEFAULT_VALID_UNTIL_DATE.toString()))
.andExpect(jsonPath("$.lastUsedDate").value(DEFAULT_LAST_USED_DATE.toString()))
.andExpect(jsonPath("$.remark").value(DEFAULT_REMARK.toString()));
}
@ -437,331 +429,331 @@ public class SepaMandateResourceIntTest {
@Test
@Transactional
public void getAllSepaMandatesByDocumentDateIsEqualToSomething() throws Exception {
public void getAllSepaMandatesByGrantingDocumentDateIsEqualToSomething() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where documentDate equals to DEFAULT_DOCUMENT_DATE
defaultSepaMandateShouldBeFound("documentDate.equals=" + DEFAULT_DOCUMENT_DATE);
// Get all the sepaMandateList where grantingDocumentDate equals to DEFAULT_GRANTING_DOCUMENT_DATE
defaultSepaMandateShouldBeFound("grantingDocumentDate.equals=" + DEFAULT_GRANTING_DOCUMENT_DATE);
// Get all the sepaMandateList where documentDate equals to UPDATED_DOCUMENT_DATE
defaultSepaMandateShouldNotBeFound("documentDate.equals=" + UPDATED_DOCUMENT_DATE);
// Get all the sepaMandateList where grantingDocumentDate equals to UPDATED_GRANTING_DOCUMENT_DATE
defaultSepaMandateShouldNotBeFound("grantingDocumentDate.equals=" + UPDATED_GRANTING_DOCUMENT_DATE);
}
@Test
@Transactional
public void getAllSepaMandatesByDocumentDateIsInShouldWork() throws Exception {
public void getAllSepaMandatesByGrantingDocumentDateIsInShouldWork() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where documentDate in DEFAULT_DOCUMENT_DATE or UPDATED_DOCUMENT_DATE
defaultSepaMandateShouldBeFound("documentDate.in=" + DEFAULT_DOCUMENT_DATE + "," + UPDATED_DOCUMENT_DATE);
// Get all the sepaMandateList where grantingDocumentDate in DEFAULT_GRANTING_DOCUMENT_DATE or UPDATED_GRANTING_DOCUMENT_DATE
defaultSepaMandateShouldBeFound("grantingDocumentDate.in=" + DEFAULT_GRANTING_DOCUMENT_DATE + "," + UPDATED_GRANTING_DOCUMENT_DATE);
// Get all the sepaMandateList where documentDate equals to UPDATED_DOCUMENT_DATE
defaultSepaMandateShouldNotBeFound("documentDate.in=" + UPDATED_DOCUMENT_DATE);
// Get all the sepaMandateList where grantingDocumentDate equals to UPDATED_GRANTING_DOCUMENT_DATE
defaultSepaMandateShouldNotBeFound("grantingDocumentDate.in=" + UPDATED_GRANTING_DOCUMENT_DATE);
}
@Test
@Transactional
public void getAllSepaMandatesByDocumentDateIsNullOrNotNull() throws Exception {
public void getAllSepaMandatesByGrantingDocumentDateIsNullOrNotNull() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where documentDate is not null
defaultSepaMandateShouldBeFound("documentDate.specified=true");
// Get all the sepaMandateList where grantingDocumentDate is not null
defaultSepaMandateShouldBeFound("grantingDocumentDate.specified=true");
// Get all the sepaMandateList where documentDate is null
defaultSepaMandateShouldNotBeFound("documentDate.specified=false");
// Get all the sepaMandateList where grantingDocumentDate is null
defaultSepaMandateShouldNotBeFound("grantingDocumentDate.specified=false");
}
@Test
@Transactional
public void getAllSepaMandatesByDocumentDateIsGreaterThanOrEqualToSomething() throws Exception {
public void getAllSepaMandatesByGrantingDocumentDateIsGreaterThanOrEqualToSomething() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where documentDate greater than or equals to DEFAULT_DOCUMENT_DATE
defaultSepaMandateShouldBeFound("documentDate.greaterOrEqualThan=" + DEFAULT_DOCUMENT_DATE);
// Get all the sepaMandateList where grantingDocumentDate greater than or equals to DEFAULT_GRANTING_DOCUMENT_DATE
defaultSepaMandateShouldBeFound("grantingDocumentDate.greaterOrEqualThan=" + DEFAULT_GRANTING_DOCUMENT_DATE);
// Get all the sepaMandateList where documentDate greater than or equals to UPDATED_DOCUMENT_DATE
defaultSepaMandateShouldNotBeFound("documentDate.greaterOrEqualThan=" + UPDATED_DOCUMENT_DATE);
// Get all the sepaMandateList where grantingDocumentDate greater than or equals to UPDATED_GRANTING_DOCUMENT_DATE
defaultSepaMandateShouldNotBeFound("grantingDocumentDate.greaterOrEqualThan=" + UPDATED_GRANTING_DOCUMENT_DATE);
}
@Test
@Transactional
public void getAllSepaMandatesByDocumentDateIsLessThanSomething() throws Exception {
public void getAllSepaMandatesByGrantingDocumentDateIsLessThanSomething() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where documentDate less than or equals to DEFAULT_DOCUMENT_DATE
defaultSepaMandateShouldNotBeFound("documentDate.lessThan=" + DEFAULT_DOCUMENT_DATE);
// Get all the sepaMandateList where grantingDocumentDate less than or equals to DEFAULT_GRANTING_DOCUMENT_DATE
defaultSepaMandateShouldNotBeFound("grantingDocumentDate.lessThan=" + DEFAULT_GRANTING_DOCUMENT_DATE);
// Get all the sepaMandateList where documentDate less than or equals to UPDATED_DOCUMENT_DATE
defaultSepaMandateShouldBeFound("documentDate.lessThan=" + UPDATED_DOCUMENT_DATE);
// Get all the sepaMandateList where grantingDocumentDate less than or equals to UPDATED_GRANTING_DOCUMENT_DATE
defaultSepaMandateShouldBeFound("grantingDocumentDate.lessThan=" + UPDATED_GRANTING_DOCUMENT_DATE);
}
@Test
@Transactional
public void getAllSepaMandatesByValidFromIsEqualToSomething() throws Exception {
public void getAllSepaMandatesByRevokationDocumentDateIsEqualToSomething() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where validFrom equals to DEFAULT_VALID_FROM
defaultSepaMandateShouldBeFound("validFrom.equals=" + DEFAULT_VALID_FROM);
// Get all the sepaMandateList where revokationDocumentDate equals to DEFAULT_REVOKATION_DOCUMENT_DATE
defaultSepaMandateShouldBeFound("revokationDocumentDate.equals=" + DEFAULT_REVOKATION_DOCUMENT_DATE);
// Get all the sepaMandateList where validFrom equals to UPDATED_VALID_FROM
defaultSepaMandateShouldNotBeFound("validFrom.equals=" + UPDATED_VALID_FROM);
// Get all the sepaMandateList where revokationDocumentDate equals to UPDATED_REVOKATION_DOCUMENT_DATE
defaultSepaMandateShouldNotBeFound("revokationDocumentDate.equals=" + UPDATED_REVOKATION_DOCUMENT_DATE);
}
@Test
@Transactional
public void getAllSepaMandatesByValidFromIsInShouldWork() throws Exception {
public void getAllSepaMandatesByRevokationDocumentDateIsInShouldWork() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where validFrom in DEFAULT_VALID_FROM or UPDATED_VALID_FROM
defaultSepaMandateShouldBeFound("validFrom.in=" + DEFAULT_VALID_FROM + "," + UPDATED_VALID_FROM);
// Get all the sepaMandateList where revokationDocumentDate in DEFAULT_REVOKATION_DOCUMENT_DATE or UPDATED_REVOKATION_DOCUMENT_DATE
defaultSepaMandateShouldBeFound("revokationDocumentDate.in=" + DEFAULT_REVOKATION_DOCUMENT_DATE + "," + UPDATED_REVOKATION_DOCUMENT_DATE);
// Get all the sepaMandateList where validFrom equals to UPDATED_VALID_FROM
defaultSepaMandateShouldNotBeFound("validFrom.in=" + UPDATED_VALID_FROM);
// Get all the sepaMandateList where revokationDocumentDate equals to UPDATED_REVOKATION_DOCUMENT_DATE
defaultSepaMandateShouldNotBeFound("revokationDocumentDate.in=" + UPDATED_REVOKATION_DOCUMENT_DATE);
}
@Test
@Transactional
public void getAllSepaMandatesByValidFromIsNullOrNotNull() throws Exception {
public void getAllSepaMandatesByRevokationDocumentDateIsNullOrNotNull() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where validFrom is not null
defaultSepaMandateShouldBeFound("validFrom.specified=true");
// Get all the sepaMandateList where revokationDocumentDate is not null
defaultSepaMandateShouldBeFound("revokationDocumentDate.specified=true");
// Get all the sepaMandateList where validFrom is null
defaultSepaMandateShouldNotBeFound("validFrom.specified=false");
// Get all the sepaMandateList where revokationDocumentDate is null
defaultSepaMandateShouldNotBeFound("revokationDocumentDate.specified=false");
}
@Test
@Transactional
public void getAllSepaMandatesByValidFromIsGreaterThanOrEqualToSomething() throws Exception {
public void getAllSepaMandatesByRevokationDocumentDateIsGreaterThanOrEqualToSomething() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where validFrom greater than or equals to DEFAULT_VALID_FROM
defaultSepaMandateShouldBeFound("validFrom.greaterOrEqualThan=" + DEFAULT_VALID_FROM);
// Get all the sepaMandateList where revokationDocumentDate greater than or equals to DEFAULT_REVOKATION_DOCUMENT_DATE
defaultSepaMandateShouldBeFound("revokationDocumentDate.greaterOrEqualThan=" + DEFAULT_REVOKATION_DOCUMENT_DATE);
// Get all the sepaMandateList where validFrom greater than or equals to UPDATED_VALID_FROM
defaultSepaMandateShouldNotBeFound("validFrom.greaterOrEqualThan=" + UPDATED_VALID_FROM);
// Get all the sepaMandateList where revokationDocumentDate greater than or equals to UPDATED_REVOKATION_DOCUMENT_DATE
defaultSepaMandateShouldNotBeFound("revokationDocumentDate.greaterOrEqualThan=" + UPDATED_REVOKATION_DOCUMENT_DATE);
}
@Test
@Transactional
public void getAllSepaMandatesByValidFromIsLessThanSomething() throws Exception {
public void getAllSepaMandatesByRevokationDocumentDateIsLessThanSomething() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where validFrom less than or equals to DEFAULT_VALID_FROM
defaultSepaMandateShouldNotBeFound("validFrom.lessThan=" + DEFAULT_VALID_FROM);
// Get all the sepaMandateList where revokationDocumentDate less than or equals to DEFAULT_REVOKATION_DOCUMENT_DATE
defaultSepaMandateShouldNotBeFound("revokationDocumentDate.lessThan=" + DEFAULT_REVOKATION_DOCUMENT_DATE);
// Get all the sepaMandateList where validFrom less than or equals to UPDATED_VALID_FROM
defaultSepaMandateShouldBeFound("validFrom.lessThan=" + UPDATED_VALID_FROM);
// Get all the sepaMandateList where revokationDocumentDate less than or equals to UPDATED_REVOKATION_DOCUMENT_DATE
defaultSepaMandateShouldBeFound("revokationDocumentDate.lessThan=" + UPDATED_REVOKATION_DOCUMENT_DATE);
}
@Test
@Transactional
public void getAllSepaMandatesByValidUntilIsEqualToSomething() throws Exception {
public void getAllSepaMandatesByValidFromDateIsEqualToSomething() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where validUntil equals to DEFAULT_VALID_UNTIL
defaultSepaMandateShouldBeFound("validUntil.equals=" + DEFAULT_VALID_UNTIL);
// Get all the sepaMandateList where validFromDate equals to DEFAULT_VALID_FROM_DATE
defaultSepaMandateShouldBeFound("validFromDate.equals=" + DEFAULT_VALID_FROM_DATE);
// Get all the sepaMandateList where validUntil equals to UPDATED_VALID_UNTIL
defaultSepaMandateShouldNotBeFound("validUntil.equals=" + UPDATED_VALID_UNTIL);
// Get all the sepaMandateList where validFromDate equals to UPDATED_VALID_FROM_DATE
defaultSepaMandateShouldNotBeFound("validFromDate.equals=" + UPDATED_VALID_FROM_DATE);
}
@Test
@Transactional
public void getAllSepaMandatesByValidUntilIsInShouldWork() throws Exception {
public void getAllSepaMandatesByValidFromDateIsInShouldWork() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where validUntil in DEFAULT_VALID_UNTIL or UPDATED_VALID_UNTIL
defaultSepaMandateShouldBeFound("validUntil.in=" + DEFAULT_VALID_UNTIL + "," + UPDATED_VALID_UNTIL);
// Get all the sepaMandateList where validFromDate in DEFAULT_VALID_FROM_DATE or UPDATED_VALID_FROM_DATE
defaultSepaMandateShouldBeFound("validFromDate.in=" + DEFAULT_VALID_FROM_DATE + "," + UPDATED_VALID_FROM_DATE);
// Get all the sepaMandateList where validUntil equals to UPDATED_VALID_UNTIL
defaultSepaMandateShouldNotBeFound("validUntil.in=" + UPDATED_VALID_UNTIL);
// Get all the sepaMandateList where validFromDate equals to UPDATED_VALID_FROM_DATE
defaultSepaMandateShouldNotBeFound("validFromDate.in=" + UPDATED_VALID_FROM_DATE);
}
@Test
@Transactional
public void getAllSepaMandatesByValidUntilIsNullOrNotNull() throws Exception {
public void getAllSepaMandatesByValidFromDateIsNullOrNotNull() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where validUntil is not null
defaultSepaMandateShouldBeFound("validUntil.specified=true");
// Get all the sepaMandateList where validFromDate is not null
defaultSepaMandateShouldBeFound("validFromDate.specified=true");
// Get all the sepaMandateList where validUntil is null
defaultSepaMandateShouldNotBeFound("validUntil.specified=false");
// Get all the sepaMandateList where validFromDate is null
defaultSepaMandateShouldNotBeFound("validFromDate.specified=false");
}
@Test
@Transactional
public void getAllSepaMandatesByValidUntilIsGreaterThanOrEqualToSomething() throws Exception {
public void getAllSepaMandatesByValidFromDateIsGreaterThanOrEqualToSomething() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where validUntil greater than or equals to DEFAULT_VALID_UNTIL
defaultSepaMandateShouldBeFound("validUntil.greaterOrEqualThan=" + DEFAULT_VALID_UNTIL);
// Get all the sepaMandateList where validFromDate greater than or equals to DEFAULT_VALID_FROM_DATE
defaultSepaMandateShouldBeFound("validFromDate.greaterOrEqualThan=" + DEFAULT_VALID_FROM_DATE);
// Get all the sepaMandateList where validUntil greater than or equals to UPDATED_VALID_UNTIL
defaultSepaMandateShouldNotBeFound("validUntil.greaterOrEqualThan=" + UPDATED_VALID_UNTIL);
// Get all the sepaMandateList where validFromDate greater than or equals to UPDATED_VALID_FROM_DATE
defaultSepaMandateShouldNotBeFound("validFromDate.greaterOrEqualThan=" + UPDATED_VALID_FROM_DATE);
}
@Test
@Transactional
public void getAllSepaMandatesByValidUntilIsLessThanSomething() throws Exception {
public void getAllSepaMandatesByValidFromDateIsLessThanSomething() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where validUntil less than or equals to DEFAULT_VALID_UNTIL
defaultSepaMandateShouldNotBeFound("validUntil.lessThan=" + DEFAULT_VALID_UNTIL);
// Get all the sepaMandateList where validFromDate less than or equals to DEFAULT_VALID_FROM_DATE
defaultSepaMandateShouldNotBeFound("validFromDate.lessThan=" + DEFAULT_VALID_FROM_DATE);
// Get all the sepaMandateList where validUntil less than or equals to UPDATED_VALID_UNTIL
defaultSepaMandateShouldBeFound("validUntil.lessThan=" + UPDATED_VALID_UNTIL);
// Get all the sepaMandateList where validFromDate less than or equals to UPDATED_VALID_FROM_DATE
defaultSepaMandateShouldBeFound("validFromDate.lessThan=" + UPDATED_VALID_FROM_DATE);
}
@Test
@Transactional
public void getAllSepaMandatesByLastUsedIsEqualToSomething() throws Exception {
public void getAllSepaMandatesByValidUntilDateIsEqualToSomething() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where lastUsed equals to DEFAULT_LAST_USED
defaultSepaMandateShouldBeFound("lastUsed.equals=" + DEFAULT_LAST_USED);
// Get all the sepaMandateList where validUntilDate equals to DEFAULT_VALID_UNTIL_DATE
defaultSepaMandateShouldBeFound("validUntilDate.equals=" + DEFAULT_VALID_UNTIL_DATE);
// Get all the sepaMandateList where lastUsed equals to UPDATED_LAST_USED
defaultSepaMandateShouldNotBeFound("lastUsed.equals=" + UPDATED_LAST_USED);
// Get all the sepaMandateList where validUntilDate equals to UPDATED_VALID_UNTIL_DATE
defaultSepaMandateShouldNotBeFound("validUntilDate.equals=" + UPDATED_VALID_UNTIL_DATE);
}
@Test
@Transactional
public void getAllSepaMandatesByLastUsedIsInShouldWork() throws Exception {
public void getAllSepaMandatesByValidUntilDateIsInShouldWork() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where lastUsed in DEFAULT_LAST_USED or UPDATED_LAST_USED
defaultSepaMandateShouldBeFound("lastUsed.in=" + DEFAULT_LAST_USED + "," + UPDATED_LAST_USED);
// Get all the sepaMandateList where validUntilDate in DEFAULT_VALID_UNTIL_DATE or UPDATED_VALID_UNTIL_DATE
defaultSepaMandateShouldBeFound("validUntilDate.in=" + DEFAULT_VALID_UNTIL_DATE + "," + UPDATED_VALID_UNTIL_DATE);
// Get all the sepaMandateList where lastUsed equals to UPDATED_LAST_USED
defaultSepaMandateShouldNotBeFound("lastUsed.in=" + UPDATED_LAST_USED);
// Get all the sepaMandateList where validUntilDate equals to UPDATED_VALID_UNTIL_DATE
defaultSepaMandateShouldNotBeFound("validUntilDate.in=" + UPDATED_VALID_UNTIL_DATE);
}
@Test
@Transactional
public void getAllSepaMandatesByLastUsedIsNullOrNotNull() throws Exception {
public void getAllSepaMandatesByValidUntilDateIsNullOrNotNull() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where lastUsed is not null
defaultSepaMandateShouldBeFound("lastUsed.specified=true");
// Get all the sepaMandateList where validUntilDate is not null
defaultSepaMandateShouldBeFound("validUntilDate.specified=true");
// Get all the sepaMandateList where lastUsed is null
defaultSepaMandateShouldNotBeFound("lastUsed.specified=false");
// Get all the sepaMandateList where validUntilDate is null
defaultSepaMandateShouldNotBeFound("validUntilDate.specified=false");
}
@Test
@Transactional
public void getAllSepaMandatesByLastUsedIsGreaterThanOrEqualToSomething() throws Exception {
public void getAllSepaMandatesByValidUntilDateIsGreaterThanOrEqualToSomething() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where lastUsed greater than or equals to DEFAULT_LAST_USED
defaultSepaMandateShouldBeFound("lastUsed.greaterOrEqualThan=" + DEFAULT_LAST_USED);
// Get all the sepaMandateList where validUntilDate greater than or equals to DEFAULT_VALID_UNTIL_DATE
defaultSepaMandateShouldBeFound("validUntilDate.greaterOrEqualThan=" + DEFAULT_VALID_UNTIL_DATE);
// Get all the sepaMandateList where lastUsed greater than or equals to UPDATED_LAST_USED
defaultSepaMandateShouldNotBeFound("lastUsed.greaterOrEqualThan=" + UPDATED_LAST_USED);
// Get all the sepaMandateList where validUntilDate greater than or equals to UPDATED_VALID_UNTIL_DATE
defaultSepaMandateShouldNotBeFound("validUntilDate.greaterOrEqualThan=" + UPDATED_VALID_UNTIL_DATE);
}
@Test
@Transactional
public void getAllSepaMandatesByLastUsedIsLessThanSomething() throws Exception {
public void getAllSepaMandatesByValidUntilDateIsLessThanSomething() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where lastUsed less than or equals to DEFAULT_LAST_USED
defaultSepaMandateShouldNotBeFound("lastUsed.lessThan=" + DEFAULT_LAST_USED);
// Get all the sepaMandateList where validUntilDate less than or equals to DEFAULT_VALID_UNTIL_DATE
defaultSepaMandateShouldNotBeFound("validUntilDate.lessThan=" + DEFAULT_VALID_UNTIL_DATE);
// Get all the sepaMandateList where lastUsed less than or equals to UPDATED_LAST_USED
defaultSepaMandateShouldBeFound("lastUsed.lessThan=" + UPDATED_LAST_USED);
// Get all the sepaMandateList where validUntilDate less than or equals to UPDATED_VALID_UNTIL_DATE
defaultSepaMandateShouldBeFound("validUntilDate.lessThan=" + UPDATED_VALID_UNTIL_DATE);
}
@Test
@Transactional
public void getAllSepaMandatesByCancellationDateIsEqualToSomething() throws Exception {
public void getAllSepaMandatesByLastUsedDateIsEqualToSomething() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where cancellationDate equals to DEFAULT_CANCELLATION_DATE
defaultSepaMandateShouldBeFound("cancellationDate.equals=" + DEFAULT_CANCELLATION_DATE);
// Get all the sepaMandateList where lastUsedDate equals to DEFAULT_LAST_USED_DATE
defaultSepaMandateShouldBeFound("lastUsedDate.equals=" + DEFAULT_LAST_USED_DATE);
// Get all the sepaMandateList where cancellationDate equals to UPDATED_CANCELLATION_DATE
defaultSepaMandateShouldNotBeFound("cancellationDate.equals=" + UPDATED_CANCELLATION_DATE);
// Get all the sepaMandateList where lastUsedDate equals to UPDATED_LAST_USED_DATE
defaultSepaMandateShouldNotBeFound("lastUsedDate.equals=" + UPDATED_LAST_USED_DATE);
}
@Test
@Transactional
public void getAllSepaMandatesByCancellationDateIsInShouldWork() throws Exception {
public void getAllSepaMandatesByLastUsedDateIsInShouldWork() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where cancellationDate in DEFAULT_CANCELLATION_DATE or UPDATED_CANCELLATION_DATE
defaultSepaMandateShouldBeFound("cancellationDate.in=" + DEFAULT_CANCELLATION_DATE + "," + UPDATED_CANCELLATION_DATE);
// Get all the sepaMandateList where lastUsedDate in DEFAULT_LAST_USED_DATE or UPDATED_LAST_USED_DATE
defaultSepaMandateShouldBeFound("lastUsedDate.in=" + DEFAULT_LAST_USED_DATE + "," + UPDATED_LAST_USED_DATE);
// Get all the sepaMandateList where cancellationDate equals to UPDATED_CANCELLATION_DATE
defaultSepaMandateShouldNotBeFound("cancellationDate.in=" + UPDATED_CANCELLATION_DATE);
// Get all the sepaMandateList where lastUsedDate equals to UPDATED_LAST_USED_DATE
defaultSepaMandateShouldNotBeFound("lastUsedDate.in=" + UPDATED_LAST_USED_DATE);
}
@Test
@Transactional
public void getAllSepaMandatesByCancellationDateIsNullOrNotNull() throws Exception {
public void getAllSepaMandatesByLastUsedDateIsNullOrNotNull() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where cancellationDate is not null
defaultSepaMandateShouldBeFound("cancellationDate.specified=true");
// Get all the sepaMandateList where lastUsedDate is not null
defaultSepaMandateShouldBeFound("lastUsedDate.specified=true");
// Get all the sepaMandateList where cancellationDate is null
defaultSepaMandateShouldNotBeFound("cancellationDate.specified=false");
// Get all the sepaMandateList where lastUsedDate is null
defaultSepaMandateShouldNotBeFound("lastUsedDate.specified=false");
}
@Test
@Transactional
public void getAllSepaMandatesByCancellationDateIsGreaterThanOrEqualToSomething() throws Exception {
public void getAllSepaMandatesByLastUsedDateIsGreaterThanOrEqualToSomething() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where cancellationDate greater than or equals to DEFAULT_CANCELLATION_DATE
defaultSepaMandateShouldBeFound("cancellationDate.greaterOrEqualThan=" + DEFAULT_CANCELLATION_DATE);
// Get all the sepaMandateList where lastUsedDate greater than or equals to DEFAULT_LAST_USED_DATE
defaultSepaMandateShouldBeFound("lastUsedDate.greaterOrEqualThan=" + DEFAULT_LAST_USED_DATE);
// Get all the sepaMandateList where cancellationDate greater than or equals to UPDATED_CANCELLATION_DATE
defaultSepaMandateShouldNotBeFound("cancellationDate.greaterOrEqualThan=" + UPDATED_CANCELLATION_DATE);
// Get all the sepaMandateList where lastUsedDate greater than or equals to UPDATED_LAST_USED_DATE
defaultSepaMandateShouldNotBeFound("lastUsedDate.greaterOrEqualThan=" + UPDATED_LAST_USED_DATE);
}
@Test
@Transactional
public void getAllSepaMandatesByCancellationDateIsLessThanSomething() throws Exception {
public void getAllSepaMandatesByLastUsedDateIsLessThanSomething() throws Exception {
// Initialize the database
sepaMandateRepository.saveAndFlush(sepaMandate);
// Get all the sepaMandateList where cancellationDate less than or equals to DEFAULT_CANCELLATION_DATE
defaultSepaMandateShouldNotBeFound("cancellationDate.lessThan=" + DEFAULT_CANCELLATION_DATE);
// Get all the sepaMandateList where lastUsedDate less than or equals to DEFAULT_LAST_USED_DATE
defaultSepaMandateShouldNotBeFound("lastUsedDate.lessThan=" + DEFAULT_LAST_USED_DATE);
// Get all the sepaMandateList where cancellationDate less than or equals to UPDATED_CANCELLATION_DATE
defaultSepaMandateShouldBeFound("cancellationDate.lessThan=" + UPDATED_CANCELLATION_DATE);
// Get all the sepaMandateList where lastUsedDate less than or equals to UPDATED_LAST_USED_DATE
defaultSepaMandateShouldBeFound("lastUsedDate.lessThan=" + UPDATED_LAST_USED_DATE);
}
@ -808,7 +800,9 @@ public class SepaMandateResourceIntTest {
@Transactional
public void getAllSepaMandatesByCustomerIsEqualToSomething() throws Exception {
// Initialize the database
Customer customer = CustomerResourceIntTest.createPersistentEntity(em);
Customer customer = CustomerResourceIntTest.createEntity(em);
em.persist(customer);
em.flush();
sepaMandate.setCustomer(customer);
sepaMandateRepository.saveAndFlush(sepaMandate);
Long customerId = customer.getId();
@ -831,11 +825,11 @@ public class SepaMandateResourceIntTest {
.andExpect(jsonPath("$.[*].reference").value(hasItem(DEFAULT_REFERENCE)))
.andExpect(jsonPath("$.[*].iban").value(hasItem(DEFAULT_IBAN)))
.andExpect(jsonPath("$.[*].bic").value(hasItem(DEFAULT_BIC)))
.andExpect(jsonPath("$.[*].documentDate").value(hasItem(DEFAULT_DOCUMENT_DATE.toString())))
.andExpect(jsonPath("$.[*].validFrom").value(hasItem(DEFAULT_VALID_FROM.toString())))
.andExpect(jsonPath("$.[*].validUntil").value(hasItem(DEFAULT_VALID_UNTIL.toString())))
.andExpect(jsonPath("$.[*].lastUsed").value(hasItem(DEFAULT_LAST_USED.toString())))
.andExpect(jsonPath("$.[*].cancellationDate").value(hasItem(DEFAULT_CANCELLATION_DATE.toString())))
.andExpect(jsonPath("$.[*].grantingDocumentDate").value(hasItem(DEFAULT_GRANTING_DOCUMENT_DATE.toString())))
.andExpect(jsonPath("$.[*].revokationDocumentDate").value(hasItem(DEFAULT_REVOKATION_DOCUMENT_DATE.toString())))
.andExpect(jsonPath("$.[*].validFromDate").value(hasItem(DEFAULT_VALID_FROM_DATE.toString())))
.andExpect(jsonPath("$.[*].validUntilDate").value(hasItem(DEFAULT_VALID_UNTIL_DATE.toString())))
.andExpect(jsonPath("$.[*].lastUsedDate").value(hasItem(DEFAULT_LAST_USED_DATE.toString())))
.andExpect(jsonPath("$.[*].remark").value(hasItem(DEFAULT_REMARK)));
// Check, that the count call also returns 1
@ -887,11 +881,11 @@ public class SepaMandateResourceIntTest {
.reference(UPDATED_REFERENCE)
.iban(UPDATED_IBAN)
.bic(UPDATED_BIC)
.documentDate(UPDATED_DOCUMENT_DATE)
.validFrom(UPDATED_VALID_FROM)
.validUntil(UPDATED_VALID_UNTIL)
.lastUsed(UPDATED_LAST_USED)
.cancellationDate(UPDATED_CANCELLATION_DATE)
.grantingDocumentDate(UPDATED_GRANTING_DOCUMENT_DATE)
.revokationDocumentDate(UPDATED_REVOKATION_DOCUMENT_DATE)
.validFromDate(UPDATED_VALID_FROM_DATE)
.validUntilDate(UPDATED_VALID_UNTIL_DATE)
.lastUsedDate(UPDATED_LAST_USED_DATE)
.remark(UPDATED_REMARK);
SepaMandateDTO sepaMandateDTO = sepaMandateMapper.toDto(updatedSepaMandate);
@ -907,11 +901,11 @@ public class SepaMandateResourceIntTest {
assertThat(testSepaMandate.getReference()).isEqualTo(UPDATED_REFERENCE);
assertThat(testSepaMandate.getIban()).isEqualTo(UPDATED_IBAN);
assertThat(testSepaMandate.getBic()).isEqualTo(UPDATED_BIC);
assertThat(testSepaMandate.getDocumentDate()).isEqualTo(UPDATED_DOCUMENT_DATE);
assertThat(testSepaMandate.getValidFrom()).isEqualTo(UPDATED_VALID_FROM);
assertThat(testSepaMandate.getValidUntil()).isEqualTo(UPDATED_VALID_UNTIL);
assertThat(testSepaMandate.getLastUsed()).isEqualTo(UPDATED_LAST_USED);
assertThat(testSepaMandate.getCancellationDate()).isEqualTo(UPDATED_CANCELLATION_DATE);
assertThat(testSepaMandate.getGrantingDocumentDate()).isEqualTo(UPDATED_GRANTING_DOCUMENT_DATE);
assertThat(testSepaMandate.getRevokationDocumentDate()).isEqualTo(UPDATED_REVOKATION_DOCUMENT_DATE);
assertThat(testSepaMandate.getValidFromDate()).isEqualTo(UPDATED_VALID_FROM_DATE);
assertThat(testSepaMandate.getValidUntilDate()).isEqualTo(UPDATED_VALID_UNTIL_DATE);
assertThat(testSepaMandate.getLastUsedDate()).isEqualTo(UPDATED_LAST_USED_DATE);
assertThat(testSepaMandate.getRemark()).isEqualTo(UPDATED_REMARK);
}

View File

@ -128,27 +128,6 @@ public class ShareResourceIntTest {
return share;
}
/**
* Create a persistent entity related to the given persistent membership for testing purposes.
*
* This is a static method, as tests for other entities might also need it,
* if they test an entity which requires the current entity.
*/
public static Share createPersistentEntity(EntityManager em, final Membership membership) {
Share share = new Share()
.documentDate(DEFAULT_DOCUMENT_DATE)
.valueDate(DEFAULT_VALUE_DATE)
.action(DEFAULT_ACTION)
.quantity(DEFAULT_QUANTITY)
.remark(DEFAULT_REMARK);
// Add required entity
share.setMembership(membership);
membership.addShare(share);
em.persist(share);
em.flush();
return share;
}
@Before
public void initTest() {
share = createEntity(em);
@ -589,7 +568,9 @@ public class ShareResourceIntTest {
@Transactional
public void getAllSharesByMembershipIsEqualToSomething() throws Exception {
// Initialize the database
Membership membership = MembershipResourceIntTest.createPersistentEntity(em, CustomerResourceIntTest.createPersistentEntity(em));
Membership membership = MembershipResourceIntTest.createEntity(em);
em.persist(membership);
em.flush();
share.setMembership(membership);
shareRepository.saveAndFlush(share);
Long membershipId = membership.getId();
@ -671,17 +652,17 @@ public class ShareResourceIntTest {
restShareMockMvc.perform(put("/api/shares")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(shareDTO)))
.andExpect(status().isBadRequest());
.andExpect(status().isOk());
// Validate the Share in the database
List<Share> shareList = shareRepository.findAll();
assertThat(shareList).hasSize(databaseSizeBeforeUpdate);
Share testShare = shareList.get(shareList.size() - 1);
assertThat(testShare.getDocumentDate()).isEqualTo(DEFAULT_DOCUMENT_DATE);
assertThat(testShare.getValueDate()).isEqualTo(DEFAULT_VALUE_DATE);
assertThat(testShare.getAction()).isEqualTo(DEFAULT_ACTION);
assertThat(testShare.getQuantity()).isEqualTo(DEFAULT_QUANTITY);
assertThat(testShare.getRemark()).isEqualTo(DEFAULT_REMARK);
assertThat(testShare.getDocumentDate()).isEqualTo(UPDATED_DOCUMENT_DATE);
assertThat(testShare.getValueDate()).isEqualTo(UPDATED_VALUE_DATE);
assertThat(testShare.getAction()).isEqualTo(UPDATED_ACTION);
assertThat(testShare.getQuantity()).isEqualTo(UPDATED_QUANTITY);
assertThat(testShare.getRemark()).isEqualTo(UPDATED_REMARK);
}
@Test
@ -714,11 +695,11 @@ public class ShareResourceIntTest {
// Delete the share
restShareMockMvc.perform(delete("/api/shares/{id}", share.getId())
.accept(TestUtil.APPLICATION_JSON_UTF8))
.andExpect(status().isBadRequest());
.andExpect(status().isOk());
// Validate the database still contains the same number of shares
// Validate the database is empty
List<Share> shareList = shareRepository.findAll();
assertThat(shareList).hasSize(databaseSizeBeforeDelete);
assertThat(shareList).hasSize(databaseSizeBeforeDelete - 1);
}
@Test

View File

@ -4,8 +4,10 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/
import { HttpClient, HttpResponse } from '@angular/common/http';
import { of } from 'rxjs';
import { take, map } from 'rxjs/operators';
import * as moment from 'moment';
import { DATE_FORMAT } from 'app/shared/constants/input.constants';
import { CustomerService } from 'app/entities/customer/customer.service';
import { ICustomer, Customer } from 'app/shared/model/customer.model';
import { ICustomer, Customer, CustomerKind, VatRegion } from 'app/shared/model/customer.model';
describe('Service Tests', () => {
describe('Customer Service', () => {
@ -13,6 +15,7 @@ describe('Service Tests', () => {
let service: CustomerService;
let httpMock: HttpTestingController;
let elemDefault: ICustomer;
let currentDate: moment.Moment;
beforeEach(() => {
TestBed.configureTestingModule({
imports: [HttpClientTestingModule]
@ -20,13 +23,36 @@ describe('Service Tests', () => {
injector = getTestBed();
service = injector.get(CustomerService);
httpMock = injector.get(HttpTestingController);
currentDate = moment();
elemDefault = new Customer(0, 0, 'AAAAAAA', 'AAAAAAA', 'AAAAAAA', 'AAAAAAA', 'AAAAAAA', 'AAAAAAA', 'AAAAAAA');
elemDefault = new Customer(
0,
0,
'AAAAAAA',
'AAAAAAA',
CustomerKind.NATURAL,
currentDate,
'AAAAAAA',
'AAAAAAA',
'AAAAAAA',
VatRegion.DOMESTIC,
'AAAAAAA',
'AAAAAAA',
'AAAAAAA',
'AAAAAAA',
'AAAAAAA',
'AAAAAAA'
);
});
describe('Service methods', async () => {
it('should find an element', async () => {
const returnedFromService = Object.assign({}, elemDefault);
const returnedFromService = Object.assign(
{
birthDate: currentDate.format(DATE_FORMAT)
},
elemDefault
);
service
.find(123)
.pipe(take(1))
@ -39,11 +65,17 @@ describe('Service Tests', () => {
it('should create a Customer', async () => {
const returnedFromService = Object.assign(
{
id: 0
id: 0,
birthDate: currentDate.format(DATE_FORMAT)
},
elemDefault
);
const expected = Object.assign({}, returnedFromService);
const expected = Object.assign(
{
birthDate: currentDate
},
returnedFromService
);
service
.create(new Customer(null))
.pipe(take(1))
@ -58,6 +90,13 @@ describe('Service Tests', () => {
reference: 1,
prefix: 'BBBBBB',
name: 'BBBBBB',
kind: 'BBBBBB',
birthDate: currentDate.format(DATE_FORMAT),
birthPlace: 'BBBBBB',
registrationCourt: 'BBBBBB',
registrationNumber: 'BBBBBB',
vatRegion: 'BBBBBB',
vatNumber: 'BBBBBB',
contractualSalutation: 'BBBBBB',
contractualAddress: 'BBBBBB',
billingSalutation: 'BBBBBB',
@ -67,7 +106,12 @@ describe('Service Tests', () => {
elemDefault
);
const expected = Object.assign({}, returnedFromService);
const expected = Object.assign(
{
birthDate: currentDate
},
returnedFromService
);
service
.update(expected)
.pipe(take(1))
@ -82,6 +126,13 @@ describe('Service Tests', () => {
reference: 1,
prefix: 'BBBBBB',
name: 'BBBBBB',
kind: 'BBBBBB',
birthDate: currentDate.format(DATE_FORMAT),
birthPlace: 'BBBBBB',
registrationCourt: 'BBBBBB',
registrationNumber: 'BBBBBB',
vatRegion: 'BBBBBB',
vatNumber: 'BBBBBB',
contractualSalutation: 'BBBBBB',
contractualAddress: 'BBBBBB',
billingSalutation: 'BBBBBB',
@ -90,7 +141,12 @@ describe('Service Tests', () => {
},
elemDefault
);
const expected = Object.assign({}, returnedFromService);
const expected = Object.assign(
{
birthDate: currentDate
},
returnedFromService
);
service
.query(expected)
.pipe(

View File

@ -25,16 +25,17 @@ describe('Service Tests', () => {
httpMock = injector.get(HttpTestingController);
currentDate = moment();
elemDefault = new Membership(0, currentDate, currentDate, currentDate, 'AAAAAAA');
elemDefault = new Membership(0, currentDate, currentDate, currentDate, currentDate, 'AAAAAAA');
});
describe('Service methods', async () => {
it('should find an element', async () => {
const returnedFromService = Object.assign(
{
documentDate: currentDate.format(DATE_FORMAT),
memberFrom: currentDate.format(DATE_FORMAT),
memberUntil: currentDate.format(DATE_FORMAT)
admissionDocumentDate: currentDate.format(DATE_FORMAT),
cancellationDocumentDate: currentDate.format(DATE_FORMAT),
memberFromDate: currentDate.format(DATE_FORMAT),
memberUntilDate: currentDate.format(DATE_FORMAT)
},
elemDefault
);
@ -51,17 +52,19 @@ describe('Service Tests', () => {
const returnedFromService = Object.assign(
{
id: 0,
documentDate: currentDate.format(DATE_FORMAT),
memberFrom: currentDate.format(DATE_FORMAT),
memberUntil: currentDate.format(DATE_FORMAT)
admissionDocumentDate: currentDate.format(DATE_FORMAT),
cancellationDocumentDate: currentDate.format(DATE_FORMAT),
memberFromDate: currentDate.format(DATE_FORMAT),
memberUntilDate: currentDate.format(DATE_FORMAT)
},
elemDefault
);
const expected = Object.assign(
{
documentDate: currentDate,
memberFrom: currentDate,
memberUntil: currentDate
admissionDocumentDate: currentDate,
cancellationDocumentDate: currentDate,
memberFromDate: currentDate,
memberUntilDate: currentDate
},
returnedFromService
);
@ -76,9 +79,10 @@ describe('Service Tests', () => {
it('should update a Membership', async () => {
const returnedFromService = Object.assign(
{
documentDate: currentDate.format(DATE_FORMAT),
memberFrom: currentDate.format(DATE_FORMAT),
memberUntil: currentDate.format(DATE_FORMAT),
admissionDocumentDate: currentDate.format(DATE_FORMAT),
cancellationDocumentDate: currentDate.format(DATE_FORMAT),
memberFromDate: currentDate.format(DATE_FORMAT),
memberUntilDate: currentDate.format(DATE_FORMAT),
remark: 'BBBBBB'
},
elemDefault
@ -86,9 +90,10 @@ describe('Service Tests', () => {
const expected = Object.assign(
{
documentDate: currentDate,
memberFrom: currentDate,
memberUntil: currentDate
admissionDocumentDate: currentDate,
cancellationDocumentDate: currentDate,
memberFromDate: currentDate,
memberUntilDate: currentDate
},
returnedFromService
);
@ -103,18 +108,20 @@ describe('Service Tests', () => {
it('should return a list of Membership', async () => {
const returnedFromService = Object.assign(
{
documentDate: currentDate.format(DATE_FORMAT),
memberFrom: currentDate.format(DATE_FORMAT),
memberUntil: currentDate.format(DATE_FORMAT),
admissionDocumentDate: currentDate.format(DATE_FORMAT),
cancellationDocumentDate: currentDate.format(DATE_FORMAT),
memberFromDate: currentDate.format(DATE_FORMAT),
memberUntilDate: currentDate.format(DATE_FORMAT),
remark: 'BBBBBB'
},
elemDefault
);
const expected = Object.assign(
{
documentDate: currentDate,
memberFrom: currentDate,
memberUntil: currentDate
admissionDocumentDate: currentDate,
cancellationDocumentDate: currentDate,
memberFromDate: currentDate,
memberUntilDate: currentDate
},
returnedFromService
);

View File

@ -43,11 +43,11 @@ describe('Service Tests', () => {
it('should find an element', async () => {
const returnedFromService = Object.assign(
{
documentDate: currentDate.format(DATE_FORMAT),
validFrom: currentDate.format(DATE_FORMAT),
validUntil: currentDate.format(DATE_FORMAT),
lastUsed: currentDate.format(DATE_FORMAT),
cancellationDate: currentDate.format(DATE_FORMAT)
grantingDocumentDate: currentDate.format(DATE_FORMAT),
revokationDocumentDate: currentDate.format(DATE_FORMAT),
validFromDate: currentDate.format(DATE_FORMAT),
validUntilDate: currentDate.format(DATE_FORMAT),
lastUsedDate: currentDate.format(DATE_FORMAT)
},
elemDefault
);
@ -64,21 +64,21 @@ describe('Service Tests', () => {
const returnedFromService = Object.assign(
{
id: 0,
documentDate: currentDate.format(DATE_FORMAT),
validFrom: currentDate.format(DATE_FORMAT),
validUntil: currentDate.format(DATE_FORMAT),
lastUsed: currentDate.format(DATE_FORMAT),
cancellationDate: currentDate.format(DATE_FORMAT)
grantingDocumentDate: currentDate.format(DATE_FORMAT),
revokationDocumentDate: currentDate.format(DATE_FORMAT),
validFromDate: currentDate.format(DATE_FORMAT),
validUntilDate: currentDate.format(DATE_FORMAT),
lastUsedDate: currentDate.format(DATE_FORMAT)
},
elemDefault
);
const expected = Object.assign(
{
documentDate: currentDate,
validFrom: currentDate,
validUntil: currentDate,
lastUsed: currentDate,
cancellationDate: currentDate
grantingDocumentDate: currentDate,
revokationDocumentDate: currentDate,
validFromDate: currentDate,
validUntilDate: currentDate,
lastUsedDate: currentDate
},
returnedFromService
);
@ -96,11 +96,11 @@ describe('Service Tests', () => {
reference: 'BBBBBB',
iban: 'BBBBBB',
bic: 'BBBBBB',
documentDate: currentDate.format(DATE_FORMAT),
validFrom: currentDate.format(DATE_FORMAT),
validUntil: currentDate.format(DATE_FORMAT),
lastUsed: currentDate.format(DATE_FORMAT),
cancellationDate: currentDate.format(DATE_FORMAT),
grantingDocumentDate: currentDate.format(DATE_FORMAT),
revokationDocumentDate: currentDate.format(DATE_FORMAT),
validFromDate: currentDate.format(DATE_FORMAT),
validUntilDate: currentDate.format(DATE_FORMAT),
lastUsedDate: currentDate.format(DATE_FORMAT),
remark: 'BBBBBB'
},
elemDefault
@ -108,11 +108,11 @@ describe('Service Tests', () => {
const expected = Object.assign(
{
documentDate: currentDate,
validFrom: currentDate,
validUntil: currentDate,
lastUsed: currentDate,
cancellationDate: currentDate
grantingDocumentDate: currentDate,
revokationDocumentDate: currentDate,
validFromDate: currentDate,
validUntilDate: currentDate,
lastUsedDate: currentDate
},
returnedFromService
);
@ -130,22 +130,22 @@ describe('Service Tests', () => {
reference: 'BBBBBB',
iban: 'BBBBBB',
bic: 'BBBBBB',
documentDate: currentDate.format(DATE_FORMAT),
validFrom: currentDate.format(DATE_FORMAT),
validUntil: currentDate.format(DATE_FORMAT),
lastUsed: currentDate.format(DATE_FORMAT),
cancellationDate: currentDate.format(DATE_FORMAT),
grantingDocumentDate: currentDate.format(DATE_FORMAT),
revokationDocumentDate: currentDate.format(DATE_FORMAT),
validFromDate: currentDate.format(DATE_FORMAT),
validUntilDate: currentDate.format(DATE_FORMAT),
lastUsedDate: currentDate.format(DATE_FORMAT),
remark: 'BBBBBB'
},
elemDefault
);
const expected = Object.assign(
{
documentDate: currentDate,
validFrom: currentDate,
validUntil: currentDate,
lastUsed: currentDate,
cancellationDate: currentDate
grantingDocumentDate: currentDate,
revokationDocumentDate: currentDate,
validFromDate: currentDate,
validUntilDate: currentDate,
lastUsedDate: currentDate
},
returnedFromService
);