Merge branch 'jhipster-generated'
This commit is contained in:
@@ -50,8 +50,11 @@ import org.hostsharing.hsadminng.domain.enumeration.AssetAction;
|
||||
@SpringBootTest(classes = HsadminNgApp.class)
|
||||
public class AssetResourceIntTest {
|
||||
|
||||
private static final LocalDate DEFAULT_DATE = LocalDate.ofEpochDay(0L);
|
||||
private static final LocalDate UPDATED_DATE = LocalDate.now(ZoneId.systemDefault());
|
||||
private static final LocalDate DEFAULT_DOCUMENT_DATE = LocalDate.ofEpochDay(0L);
|
||||
private static final LocalDate UPDATED_DOCUMENT_DATE = LocalDate.now(ZoneId.systemDefault());
|
||||
|
||||
private static final LocalDate DEFAULT_VALUE_DATE = LocalDate.ofEpochDay(0L);
|
||||
private static final LocalDate UPDATED_VALUE_DATE = LocalDate.now(ZoneId.systemDefault());
|
||||
|
||||
private static final AssetAction DEFAULT_ACTION = AssetAction.PAYMENT;
|
||||
private static final AssetAction UPDATED_ACTION = AssetAction.HANDOVER;
|
||||
@@ -59,8 +62,8 @@ public class AssetResourceIntTest {
|
||||
private static final BigDecimal DEFAULT_AMOUNT = new BigDecimal(1);
|
||||
private static final BigDecimal UPDATED_AMOUNT = new BigDecimal(2);
|
||||
|
||||
private static final String DEFAULT_COMMENT = "AAAAAAAAAA";
|
||||
private static final String UPDATED_COMMENT = "BBBBBBBBBB";
|
||||
private static final String DEFAULT_REMARK = "AAAAAAAAAA";
|
||||
private static final String UPDATED_REMARK = "BBBBBBBBBB";
|
||||
|
||||
@Autowired
|
||||
private AssetRepository assetRepository;
|
||||
@@ -113,10 +116,11 @@ public class AssetResourceIntTest {
|
||||
*/
|
||||
public static Asset createEntity(EntityManager em) {
|
||||
Asset asset = new Asset()
|
||||
.date(DEFAULT_DATE)
|
||||
.documentDate(DEFAULT_DOCUMENT_DATE)
|
||||
.valueDate(DEFAULT_VALUE_DATE)
|
||||
.action(DEFAULT_ACTION)
|
||||
.amount(DEFAULT_AMOUNT)
|
||||
.comment(DEFAULT_COMMENT);
|
||||
.remark(DEFAULT_REMARK);
|
||||
// Add required entity
|
||||
Membership membership = MembershipResourceIntTest.createEntity(em);
|
||||
em.persist(membership);
|
||||
@@ -146,10 +150,11 @@ public class AssetResourceIntTest {
|
||||
List<Asset> assetList = assetRepository.findAll();
|
||||
assertThat(assetList).hasSize(databaseSizeBeforeCreate + 1);
|
||||
Asset testAsset = assetList.get(assetList.size() - 1);
|
||||
assertThat(testAsset.getDate()).isEqualTo(DEFAULT_DATE);
|
||||
assertThat(testAsset.getDocumentDate()).isEqualTo(DEFAULT_DOCUMENT_DATE);
|
||||
assertThat(testAsset.getValueDate()).isEqualTo(DEFAULT_VALUE_DATE);
|
||||
assertThat(testAsset.getAction()).isEqualTo(DEFAULT_ACTION);
|
||||
assertThat(testAsset.getAmount()).isEqualTo(DEFAULT_AMOUNT);
|
||||
assertThat(testAsset.getComment()).isEqualTo(DEFAULT_COMMENT);
|
||||
assertThat(testAsset.getRemark()).isEqualTo(DEFAULT_REMARK);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -174,10 +179,29 @@ public class AssetResourceIntTest {
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkDateIsRequired() throws Exception {
|
||||
public void checkDocumentDateIsRequired() throws Exception {
|
||||
int databaseSizeBeforeTest = assetRepository.findAll().size();
|
||||
// set the field null
|
||||
asset.setDate(null);
|
||||
asset.setDocumentDate(null);
|
||||
|
||||
// Create the Asset, which fails.
|
||||
AssetDTO assetDTO = assetMapper.toDto(asset);
|
||||
|
||||
restAssetMockMvc.perform(post("/api/assets")
|
||||
.contentType(TestUtil.APPLICATION_JSON_UTF8)
|
||||
.content(TestUtil.convertObjectToJsonBytes(assetDTO)))
|
||||
.andExpect(status().isBadRequest());
|
||||
|
||||
List<Asset> assetList = assetRepository.findAll();
|
||||
assertThat(assetList).hasSize(databaseSizeBeforeTest);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkValueDateIsRequired() throws Exception {
|
||||
int databaseSizeBeforeTest = assetRepository.findAll().size();
|
||||
// set the field null
|
||||
asset.setValueDate(null);
|
||||
|
||||
// Create the Asset, which fails.
|
||||
AssetDTO assetDTO = assetMapper.toDto(asset);
|
||||
@@ -240,10 +264,11 @@ public class AssetResourceIntTest {
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
|
||||
.andExpect(jsonPath("$.[*].id").value(hasItem(asset.getId().intValue())))
|
||||
.andExpect(jsonPath("$.[*].date").value(hasItem(DEFAULT_DATE.toString())))
|
||||
.andExpect(jsonPath("$.[*].documentDate").value(hasItem(DEFAULT_DOCUMENT_DATE.toString())))
|
||||
.andExpect(jsonPath("$.[*].valueDate").value(hasItem(DEFAULT_VALUE_DATE.toString())))
|
||||
.andExpect(jsonPath("$.[*].action").value(hasItem(DEFAULT_ACTION.toString())))
|
||||
.andExpect(jsonPath("$.[*].amount").value(hasItem(DEFAULT_AMOUNT.intValue())))
|
||||
.andExpect(jsonPath("$.[*].comment").value(hasItem(DEFAULT_COMMENT.toString())));
|
||||
.andExpect(jsonPath("$.[*].remark").value(hasItem(DEFAULT_REMARK.toString())));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -257,75 +282,142 @@ public class AssetResourceIntTest {
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
|
||||
.andExpect(jsonPath("$.id").value(asset.getId().intValue()))
|
||||
.andExpect(jsonPath("$.date").value(DEFAULT_DATE.toString()))
|
||||
.andExpect(jsonPath("$.documentDate").value(DEFAULT_DOCUMENT_DATE.toString()))
|
||||
.andExpect(jsonPath("$.valueDate").value(DEFAULT_VALUE_DATE.toString()))
|
||||
.andExpect(jsonPath("$.action").value(DEFAULT_ACTION.toString()))
|
||||
.andExpect(jsonPath("$.amount").value(DEFAULT_AMOUNT.intValue()))
|
||||
.andExpect(jsonPath("$.comment").value(DEFAULT_COMMENT.toString()));
|
||||
.andExpect(jsonPath("$.remark").value(DEFAULT_REMARK.toString()));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllAssetsByDateIsEqualToSomething() throws Exception {
|
||||
public void getAllAssetsByDocumentDateIsEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
assetRepository.saveAndFlush(asset);
|
||||
|
||||
// Get all the assetList where date equals to DEFAULT_DATE
|
||||
defaultAssetShouldBeFound("date.equals=" + DEFAULT_DATE);
|
||||
// Get all the assetList where documentDate equals to DEFAULT_DOCUMENT_DATE
|
||||
defaultAssetShouldBeFound("documentDate.equals=" + DEFAULT_DOCUMENT_DATE);
|
||||
|
||||
// Get all the assetList where date equals to UPDATED_DATE
|
||||
defaultAssetShouldNotBeFound("date.equals=" + UPDATED_DATE);
|
||||
// Get all the assetList where documentDate equals to UPDATED_DOCUMENT_DATE
|
||||
defaultAssetShouldNotBeFound("documentDate.equals=" + UPDATED_DOCUMENT_DATE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllAssetsByDateIsInShouldWork() throws Exception {
|
||||
public void getAllAssetsByDocumentDateIsInShouldWork() throws Exception {
|
||||
// Initialize the database
|
||||
assetRepository.saveAndFlush(asset);
|
||||
|
||||
// Get all the assetList where date in DEFAULT_DATE or UPDATED_DATE
|
||||
defaultAssetShouldBeFound("date.in=" + DEFAULT_DATE + "," + UPDATED_DATE);
|
||||
// Get all the assetList where documentDate in DEFAULT_DOCUMENT_DATE or UPDATED_DOCUMENT_DATE
|
||||
defaultAssetShouldBeFound("documentDate.in=" + DEFAULT_DOCUMENT_DATE + "," + UPDATED_DOCUMENT_DATE);
|
||||
|
||||
// Get all the assetList where date equals to UPDATED_DATE
|
||||
defaultAssetShouldNotBeFound("date.in=" + UPDATED_DATE);
|
||||
// Get all the assetList where documentDate equals to UPDATED_DOCUMENT_DATE
|
||||
defaultAssetShouldNotBeFound("documentDate.in=" + UPDATED_DOCUMENT_DATE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllAssetsByDateIsNullOrNotNull() throws Exception {
|
||||
public void getAllAssetsByDocumentDateIsNullOrNotNull() throws Exception {
|
||||
// Initialize the database
|
||||
assetRepository.saveAndFlush(asset);
|
||||
|
||||
// Get all the assetList where date is not null
|
||||
defaultAssetShouldBeFound("date.specified=true");
|
||||
// Get all the assetList where documentDate is not null
|
||||
defaultAssetShouldBeFound("documentDate.specified=true");
|
||||
|
||||
// Get all the assetList where date is null
|
||||
defaultAssetShouldNotBeFound("date.specified=false");
|
||||
// Get all the assetList where documentDate is null
|
||||
defaultAssetShouldNotBeFound("documentDate.specified=false");
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllAssetsByDateIsGreaterThanOrEqualToSomething() throws Exception {
|
||||
public void getAllAssetsByDocumentDateIsGreaterThanOrEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
assetRepository.saveAndFlush(asset);
|
||||
|
||||
// Get all the assetList where date greater than or equals to DEFAULT_DATE
|
||||
defaultAssetShouldBeFound("date.greaterOrEqualThan=" + DEFAULT_DATE);
|
||||
// Get all the assetList where documentDate greater than or equals to DEFAULT_DOCUMENT_DATE
|
||||
defaultAssetShouldBeFound("documentDate.greaterOrEqualThan=" + DEFAULT_DOCUMENT_DATE);
|
||||
|
||||
// Get all the assetList where date greater than or equals to UPDATED_DATE
|
||||
defaultAssetShouldNotBeFound("date.greaterOrEqualThan=" + UPDATED_DATE);
|
||||
// Get all the assetList where documentDate greater than or equals to UPDATED_DOCUMENT_DATE
|
||||
defaultAssetShouldNotBeFound("documentDate.greaterOrEqualThan=" + UPDATED_DOCUMENT_DATE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllAssetsByDateIsLessThanSomething() throws Exception {
|
||||
public void getAllAssetsByDocumentDateIsLessThanSomething() throws Exception {
|
||||
// Initialize the database
|
||||
assetRepository.saveAndFlush(asset);
|
||||
|
||||
// Get all the assetList where date less than or equals to DEFAULT_DATE
|
||||
defaultAssetShouldNotBeFound("date.lessThan=" + DEFAULT_DATE);
|
||||
// Get all the assetList where documentDate less than or equals to DEFAULT_DOCUMENT_DATE
|
||||
defaultAssetShouldNotBeFound("documentDate.lessThan=" + DEFAULT_DOCUMENT_DATE);
|
||||
|
||||
// Get all the assetList where date less than or equals to UPDATED_DATE
|
||||
defaultAssetShouldBeFound("date.lessThan=" + UPDATED_DATE);
|
||||
// Get all the assetList where documentDate less than or equals to UPDATED_DOCUMENT_DATE
|
||||
defaultAssetShouldBeFound("documentDate.lessThan=" + UPDATED_DOCUMENT_DATE);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllAssetsByValueDateIsEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
assetRepository.saveAndFlush(asset);
|
||||
|
||||
// Get all the assetList where valueDate equals to DEFAULT_VALUE_DATE
|
||||
defaultAssetShouldBeFound("valueDate.equals=" + DEFAULT_VALUE_DATE);
|
||||
|
||||
// Get all the assetList where valueDate equals to UPDATED_VALUE_DATE
|
||||
defaultAssetShouldNotBeFound("valueDate.equals=" + UPDATED_VALUE_DATE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllAssetsByValueDateIsInShouldWork() throws Exception {
|
||||
// Initialize the database
|
||||
assetRepository.saveAndFlush(asset);
|
||||
|
||||
// Get all the assetList where valueDate in DEFAULT_VALUE_DATE or UPDATED_VALUE_DATE
|
||||
defaultAssetShouldBeFound("valueDate.in=" + DEFAULT_VALUE_DATE + "," + UPDATED_VALUE_DATE);
|
||||
|
||||
// Get all the assetList where valueDate equals to UPDATED_VALUE_DATE
|
||||
defaultAssetShouldNotBeFound("valueDate.in=" + UPDATED_VALUE_DATE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllAssetsByValueDateIsNullOrNotNull() throws Exception {
|
||||
// Initialize the database
|
||||
assetRepository.saveAndFlush(asset);
|
||||
|
||||
// Get all the assetList where valueDate is not null
|
||||
defaultAssetShouldBeFound("valueDate.specified=true");
|
||||
|
||||
// Get all the assetList where valueDate is null
|
||||
defaultAssetShouldNotBeFound("valueDate.specified=false");
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllAssetsByValueDateIsGreaterThanOrEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
assetRepository.saveAndFlush(asset);
|
||||
|
||||
// Get all the assetList where valueDate greater than or equals to DEFAULT_VALUE_DATE
|
||||
defaultAssetShouldBeFound("valueDate.greaterOrEqualThan=" + DEFAULT_VALUE_DATE);
|
||||
|
||||
// Get all the assetList where valueDate greater than or equals to UPDATED_VALUE_DATE
|
||||
defaultAssetShouldNotBeFound("valueDate.greaterOrEqualThan=" + UPDATED_VALUE_DATE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllAssetsByValueDateIsLessThanSomething() throws Exception {
|
||||
// Initialize the database
|
||||
assetRepository.saveAndFlush(asset);
|
||||
|
||||
// Get all the assetList where valueDate less than or equals to DEFAULT_VALUE_DATE
|
||||
defaultAssetShouldNotBeFound("valueDate.lessThan=" + DEFAULT_VALUE_DATE);
|
||||
|
||||
// Get all the assetList where valueDate less than or equals to UPDATED_VALUE_DATE
|
||||
defaultAssetShouldBeFound("valueDate.lessThan=" + UPDATED_VALUE_DATE);
|
||||
}
|
||||
|
||||
|
||||
@@ -409,41 +501,41 @@ public class AssetResourceIntTest {
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllAssetsByCommentIsEqualToSomething() throws Exception {
|
||||
public void getAllAssetsByRemarkIsEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
assetRepository.saveAndFlush(asset);
|
||||
|
||||
// Get all the assetList where comment equals to DEFAULT_COMMENT
|
||||
defaultAssetShouldBeFound("comment.equals=" + DEFAULT_COMMENT);
|
||||
// Get all the assetList where remark equals to DEFAULT_REMARK
|
||||
defaultAssetShouldBeFound("remark.equals=" + DEFAULT_REMARK);
|
||||
|
||||
// Get all the assetList where comment equals to UPDATED_COMMENT
|
||||
defaultAssetShouldNotBeFound("comment.equals=" + UPDATED_COMMENT);
|
||||
// Get all the assetList where remark equals to UPDATED_REMARK
|
||||
defaultAssetShouldNotBeFound("remark.equals=" + UPDATED_REMARK);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllAssetsByCommentIsInShouldWork() throws Exception {
|
||||
public void getAllAssetsByRemarkIsInShouldWork() throws Exception {
|
||||
// Initialize the database
|
||||
assetRepository.saveAndFlush(asset);
|
||||
|
||||
// Get all the assetList where comment in DEFAULT_COMMENT or UPDATED_COMMENT
|
||||
defaultAssetShouldBeFound("comment.in=" + DEFAULT_COMMENT + "," + UPDATED_COMMENT);
|
||||
// Get all the assetList where remark in DEFAULT_REMARK or UPDATED_REMARK
|
||||
defaultAssetShouldBeFound("remark.in=" + DEFAULT_REMARK + "," + UPDATED_REMARK);
|
||||
|
||||
// Get all the assetList where comment equals to UPDATED_COMMENT
|
||||
defaultAssetShouldNotBeFound("comment.in=" + UPDATED_COMMENT);
|
||||
// Get all the assetList where remark equals to UPDATED_REMARK
|
||||
defaultAssetShouldNotBeFound("remark.in=" + UPDATED_REMARK);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllAssetsByCommentIsNullOrNotNull() throws Exception {
|
||||
public void getAllAssetsByRemarkIsNullOrNotNull() throws Exception {
|
||||
// Initialize the database
|
||||
assetRepository.saveAndFlush(asset);
|
||||
|
||||
// Get all the assetList where comment is not null
|
||||
defaultAssetShouldBeFound("comment.specified=true");
|
||||
// Get all the assetList where remark is not null
|
||||
defaultAssetShouldBeFound("remark.specified=true");
|
||||
|
||||
// Get all the assetList where comment is null
|
||||
defaultAssetShouldNotBeFound("comment.specified=false");
|
||||
// Get all the assetList where remark is null
|
||||
defaultAssetShouldNotBeFound("remark.specified=false");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -472,10 +564,11 @@ public class AssetResourceIntTest {
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
|
||||
.andExpect(jsonPath("$.[*].id").value(hasItem(asset.getId().intValue())))
|
||||
.andExpect(jsonPath("$.[*].date").value(hasItem(DEFAULT_DATE.toString())))
|
||||
.andExpect(jsonPath("$.[*].documentDate").value(hasItem(DEFAULT_DOCUMENT_DATE.toString())))
|
||||
.andExpect(jsonPath("$.[*].valueDate").value(hasItem(DEFAULT_VALUE_DATE.toString())))
|
||||
.andExpect(jsonPath("$.[*].action").value(hasItem(DEFAULT_ACTION.toString())))
|
||||
.andExpect(jsonPath("$.[*].amount").value(hasItem(DEFAULT_AMOUNT.intValue())))
|
||||
.andExpect(jsonPath("$.[*].comment").value(hasItem(DEFAULT_COMMENT)));
|
||||
.andExpect(jsonPath("$.[*].remark").value(hasItem(DEFAULT_REMARK)));
|
||||
|
||||
// Check, that the count call also returns 1
|
||||
restAssetMockMvc.perform(get("/api/assets/count?sort=id,desc&" + filter))
|
||||
@@ -523,10 +616,11 @@ public class AssetResourceIntTest {
|
||||
// Disconnect from session so that the updates on updatedAsset are not directly saved in db
|
||||
em.detach(updatedAsset);
|
||||
updatedAsset
|
||||
.date(UPDATED_DATE)
|
||||
.documentDate(UPDATED_DOCUMENT_DATE)
|
||||
.valueDate(UPDATED_VALUE_DATE)
|
||||
.action(UPDATED_ACTION)
|
||||
.amount(UPDATED_AMOUNT)
|
||||
.comment(UPDATED_COMMENT);
|
||||
.remark(UPDATED_REMARK);
|
||||
AssetDTO assetDTO = assetMapper.toDto(updatedAsset);
|
||||
|
||||
restAssetMockMvc.perform(put("/api/assets")
|
||||
@@ -538,10 +632,11 @@ public class AssetResourceIntTest {
|
||||
List<Asset> assetList = assetRepository.findAll();
|
||||
assertThat(assetList).hasSize(databaseSizeBeforeUpdate);
|
||||
Asset testAsset = assetList.get(assetList.size() - 1);
|
||||
assertThat(testAsset.getDate()).isEqualTo(UPDATED_DATE);
|
||||
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.getComment()).isEqualTo(UPDATED_COMMENT);
|
||||
assertThat(testAsset.getRemark()).isEqualTo(UPDATED_REMARK);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -47,8 +47,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
@SpringBootTest(classes = HsadminNgApp.class)
|
||||
public class CustomerResourceIntTest {
|
||||
|
||||
private static final Integer DEFAULT_NUMBER = 10000;
|
||||
private static final Integer UPDATED_NUMBER = 10001;
|
||||
private static final Integer DEFAULT_REFERENCE = 10000;
|
||||
private static final Integer UPDATED_REFERENCE = 10001;
|
||||
|
||||
private static final String DEFAULT_PREFIX = "nf";
|
||||
private static final String UPDATED_PREFIX = "m2";
|
||||
@@ -62,13 +62,21 @@ public class CustomerResourceIntTest {
|
||||
private static final String DEFAULT_CONTRACTUAL_ADDRESS = "AAAAAAAAAA";
|
||||
private static final String UPDATED_CONTRACTUAL_ADDRESS = "BBBBBBBBBB";
|
||||
|
||||
private static final String DEFAULT_BILLING_SALUTATION = "AAAAAAAAAA";
|
||||
private static final String UPDATED_BILLING_SALUTATION = "BBBBBBBBBB";
|
||||
private static final String DEFAULT_CONTRACTUAL_SALUTATION = "AAAAAAAAAA";
|
||||
private static final String UPDATED_CONTRACTUAL_SALUTATION = "BBBBBBBBBB";
|
||||
|
||||
@Autowired
|
||||
private static final String DEFAULT_BILLING_SALUTATION = "AAAAAAAAAA";
|
||||
private static final String UPDATED_BILLING_SALUTATION = "BBBBBBBBBB";
|
||||
|
||||
private static final String DEFAULT_BILLING_ADDRESS = "AAAAAAAAAA";
|
||||
private static final String UPDATED_BILLING_ADDRESS = "BBBBBBBBBB";
|
||||
|
||||
@Autowired
|
||||
private static final String DEFAULT_REMARK = "AAAAAAAAAA";
|
||||
private static final String UPDATED_REMARK = "BBBBBBBBBB";
|
||||
|
||||
private CustomerRepository customerRepository;
|
||||
|
||||
@Autowired
|
||||
@@ -119,13 +127,14 @@ public class CustomerResourceIntTest {
|
||||
*/
|
||||
public static Customer createEntity(EntityManager em) {
|
||||
Customer customer = new Customer()
|
||||
.number(DEFAULT_NUMBER)
|
||||
.reference(DEFAULT_REFERENCE)
|
||||
.prefix(DEFAULT_PREFIX)
|
||||
.name(DEFAULT_NAME)
|
||||
.contractualSalutation(DEFAULT_CONTRACTUAL_SALUTATION)
|
||||
.contractualAddress(DEFAULT_CONTRACTUAL_ADDRESS)
|
||||
.billingSalutation(DEFAULT_BILLING_SALUTATION)
|
||||
.billingAddress(DEFAULT_BILLING_ADDRESS);
|
||||
.billingAddress(DEFAULT_BILLING_ADDRESS)
|
||||
.remark(DEFAULT_REMARK);
|
||||
return customer;
|
||||
}
|
||||
|
||||
@@ -150,13 +159,14 @@ public class CustomerResourceIntTest {
|
||||
List<Customer> customerList = customerRepository.findAll();
|
||||
assertThat(customerList).hasSize(databaseSizeBeforeCreate + 1);
|
||||
Customer testCustomer = customerList.get(customerList.size() - 1);
|
||||
assertThat(testCustomer.getNumber()).isEqualTo(DEFAULT_NUMBER);
|
||||
assertThat(testCustomer.getReference()).isEqualTo(DEFAULT_REFERENCE);
|
||||
assertThat(testCustomer.getPrefix()).isEqualTo(DEFAULT_PREFIX);
|
||||
assertThat(testCustomer.getName()).isEqualTo(DEFAULT_NAME);
|
||||
assertThat(testCustomer.getContractualSalutation()).isEqualTo(DEFAULT_CONTRACTUAL_SALUTATION);
|
||||
assertThat(testCustomer.getContractualAddress()).isEqualTo(DEFAULT_CONTRACTUAL_ADDRESS);
|
||||
assertThat(testCustomer.getBillingSalutation()).isEqualTo(DEFAULT_BILLING_SALUTATION);
|
||||
assertThat(testCustomer.getBillingAddress()).isEqualTo(DEFAULT_BILLING_ADDRESS);
|
||||
assertThat(testCustomer.getRemark()).isEqualTo(DEFAULT_REMARK);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -181,10 +191,10 @@ public class CustomerResourceIntTest {
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkNumberIsRequired() throws Exception {
|
||||
public void checkReferenceIsRequired() throws Exception {
|
||||
int databaseSizeBeforeTest = customerRepository.findAll().size();
|
||||
// set the field null
|
||||
customer.setNumber(null);
|
||||
customer.setReference(null);
|
||||
|
||||
// Create the Customer, which fails.
|
||||
CustomerDTO customerDTO = customerMapper.toDto(customer);
|
||||
@@ -266,13 +276,14 @@ public class CustomerResourceIntTest {
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
|
||||
.andExpect(jsonPath("$.[*].id").value(hasItem(customer.getId().intValue())))
|
||||
.andExpect(jsonPath("$.[*].number").value(hasItem(DEFAULT_NUMBER)))
|
||||
.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("$.[*].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())))
|
||||
.andExpect(jsonPath("$.[*].billingAddress").value(hasItem(DEFAULT_BILLING_ADDRESS.toString())));
|
||||
.andExpect(jsonPath("$.[*].billingAddress").value(hasItem(DEFAULT_BILLING_ADDRESS.toString())))
|
||||
.andExpect(jsonPath("$.[*].remark").value(hasItem(DEFAULT_REMARK.toString())));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -286,78 +297,79 @@ public class CustomerResourceIntTest {
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
|
||||
.andExpect(jsonPath("$.id").value(customer.getId().intValue()))
|
||||
.andExpect(jsonPath("$.number").value(DEFAULT_NUMBER))
|
||||
.andExpect(jsonPath("$.reference").value(DEFAULT_REFERENCE))
|
||||
.andExpect(jsonPath("$.prefix").value(DEFAULT_PREFIX.toString()))
|
||||
.andExpect(jsonPath("$.name").value(DEFAULT_NAME.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()))
|
||||
.andExpect(jsonPath("$.billingAddress").value(DEFAULT_BILLING_ADDRESS.toString()));
|
||||
.andExpect(jsonPath("$.billingAddress").value(DEFAULT_BILLING_ADDRESS.toString()))
|
||||
.andExpect(jsonPath("$.remark").value(DEFAULT_REMARK.toString()));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllCustomersByNumberIsEqualToSomething() throws Exception {
|
||||
public void getAllCustomersByReferenceIsEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
customerRepository.saveAndFlush(customer);
|
||||
|
||||
// Get all the customerList where number equals to DEFAULT_NUMBER
|
||||
defaultCustomerShouldBeFound("number.equals=" + DEFAULT_NUMBER);
|
||||
// Get all the customerList where reference equals to DEFAULT_REFERENCE
|
||||
defaultCustomerShouldBeFound("reference.equals=" + DEFAULT_REFERENCE);
|
||||
|
||||
// Get all the customerList where number equals to UPDATED_NUMBER
|
||||
defaultCustomerShouldNotBeFound("number.equals=" + UPDATED_NUMBER);
|
||||
// Get all the customerList where reference equals to UPDATED_REFERENCE
|
||||
defaultCustomerShouldNotBeFound("reference.equals=" + UPDATED_REFERENCE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllCustomersByNumberIsInShouldWork() throws Exception {
|
||||
public void getAllCustomersByReferenceIsInShouldWork() throws Exception {
|
||||
// Initialize the database
|
||||
customerRepository.saveAndFlush(customer);
|
||||
|
||||
// Get all the customerList where number in DEFAULT_NUMBER or UPDATED_NUMBER
|
||||
defaultCustomerShouldBeFound("number.in=" + DEFAULT_NUMBER + "," + UPDATED_NUMBER);
|
||||
// Get all the customerList where reference in DEFAULT_REFERENCE or UPDATED_REFERENCE
|
||||
defaultCustomerShouldBeFound("reference.in=" + DEFAULT_REFERENCE + "," + UPDATED_REFERENCE);
|
||||
|
||||
// Get all the customerList where number equals to UPDATED_NUMBER
|
||||
defaultCustomerShouldNotBeFound("number.in=" + UPDATED_NUMBER);
|
||||
// Get all the customerList where reference equals to UPDATED_REFERENCE
|
||||
defaultCustomerShouldNotBeFound("reference.in=" + UPDATED_REFERENCE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllCustomersByNumberIsNullOrNotNull() throws Exception {
|
||||
public void getAllCustomersByReferenceIsNullOrNotNull() throws Exception {
|
||||
// Initialize the database
|
||||
customerRepository.saveAndFlush(customer);
|
||||
|
||||
// Get all the customerList where number is not null
|
||||
defaultCustomerShouldBeFound("number.specified=true");
|
||||
// Get all the customerList where reference is not null
|
||||
defaultCustomerShouldBeFound("reference.specified=true");
|
||||
|
||||
// Get all the customerList where number is null
|
||||
defaultCustomerShouldNotBeFound("number.specified=false");
|
||||
// Get all the customerList where reference is null
|
||||
defaultCustomerShouldNotBeFound("reference.specified=false");
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllCustomersByNumberIsGreaterThanOrEqualToSomething() throws Exception {
|
||||
public void getAllCustomersByReferenceIsGreaterThanOrEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
customerRepository.saveAndFlush(customer);
|
||||
|
||||
// Get all the customerList where number greater than or equals to DEFAULT_NUMBER
|
||||
defaultCustomerShouldBeFound("number.greaterOrEqualThan=" + DEFAULT_NUMBER);
|
||||
// Get all the customerList where reference greater than or equals to DEFAULT_REFERENCE
|
||||
defaultCustomerShouldBeFound("reference.greaterOrEqualThan=" + DEFAULT_REFERENCE);
|
||||
|
||||
// Get all the customerList where number greater than or equals to (DEFAULT_NUMBER + 1)
|
||||
defaultCustomerShouldNotBeFound("number.greaterOrEqualThan=" + (DEFAULT_NUMBER + 1));
|
||||
// Get all the customerList where reference greater than or equals to (DEFAULT_REFERENCE + 1)
|
||||
defaultCustomerShouldNotBeFound("reference.greaterOrEqualThan=" + (DEFAULT_REFERENCE + 1));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllCustomersByNumberIsLessThanSomething() throws Exception {
|
||||
public void getAllCustomersByReferenceIsLessThanSomething() throws Exception {
|
||||
// Initialize the database
|
||||
customerRepository.saveAndFlush(customer);
|
||||
|
||||
// Get all the customerList where number less than or equals to DEFAULT_NUMBER
|
||||
defaultCustomerShouldNotBeFound("number.lessThan=" + DEFAULT_NUMBER);
|
||||
// Get all the customerList where reference less than or equals to DEFAULT_REFERENCE
|
||||
defaultCustomerShouldNotBeFound("reference.lessThan=" + DEFAULT_REFERENCE);
|
||||
|
||||
// Get all the customerList where number less than or equals to (DEFAULT_NUMBER + 1)
|
||||
defaultCustomerShouldBeFound("number.lessThan=" + (DEFAULT_NUMBER + 1));
|
||||
// Get all the customerList where reference less than or equals to (DEFAULT_REFERENCE + 1)
|
||||
defaultCustomerShouldBeFound("reference.lessThan=" + (DEFAULT_REFERENCE + 1));
|
||||
}
|
||||
|
||||
|
||||
@@ -558,41 +570,80 @@ public class CustomerResourceIntTest {
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllCustomersByBillingAddressIsEqualToSomething() throws Exception {
|
||||
public void getAllCustomersByContractualAddressIsEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
customerRepository.saveAndFlush(customer);
|
||||
|
||||
// Get all the customerList where billingAddress equals to DEFAULT_BILLING_ADDRESS
|
||||
defaultCustomerShouldBeFound("billingAddress.equals=" + DEFAULT_BILLING_ADDRESS);
|
||||
// Get all the customerList where contractualAddress equals to DEFAULT_CONTRACTUAL_ADDRESS
|
||||
defaultCustomerShouldBeFound("contractualAddress.equals=" + DEFAULT_CONTRACTUAL_ADDRESS);
|
||||
|
||||
// Get all the customerList where billingAddress equals to UPDATED_BILLING_ADDRESS
|
||||
defaultCustomerShouldNotBeFound("billingAddress.equals=" + UPDATED_BILLING_ADDRESS);
|
||||
// Get all the customerList where contractualAddress equals to UPDATED_CONTRACTUAL_ADDRESS
|
||||
defaultCustomerShouldNotBeFound("contractualAddress.equals=" + UPDATED_CONTRACTUAL_ADDRESS);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllCustomersByBillingAddressIsInShouldWork() throws Exception {
|
||||
public void getAllCustomersByContractualAddressIsInShouldWork() throws Exception {
|
||||
// Initialize the database
|
||||
customerRepository.saveAndFlush(customer);
|
||||
|
||||
// Get all the customerList where billingAddress in DEFAULT_BILLING_ADDRESS or UPDATED_BILLING_ADDRESS
|
||||
defaultCustomerShouldBeFound("billingAddress.in=" + DEFAULT_BILLING_ADDRESS + "," + UPDATED_BILLING_ADDRESS);
|
||||
// Get all the customerList where contractualAddress in DEFAULT_CONTRACTUAL_ADDRESS or UPDATED_CONTRACTUAL_ADDRESS
|
||||
defaultCustomerShouldBeFound("contractualAddress.in=" + DEFAULT_CONTRACTUAL_ADDRESS + "," + UPDATED_CONTRACTUAL_ADDRESS);
|
||||
|
||||
// Get all the customerList where billingAddress equals to UPDATED_BILLING_ADDRESS
|
||||
defaultCustomerShouldNotBeFound("billingAddress.in=" + UPDATED_BILLING_ADDRESS);
|
||||
// Get all the customerList where contractualAddress equals to UPDATED_CONTRACTUAL_ADDRESS
|
||||
defaultCustomerShouldNotBeFound("contractualAddress.in=" + UPDATED_CONTRACTUAL_ADDRESS);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllCustomersByBillingAddressIsNullOrNotNull() throws Exception {
|
||||
public void getAllCustomersByContractualAddressIsNullOrNotNull() throws Exception {
|
||||
// Initialize the database
|
||||
customerRepository.saveAndFlush(customer);
|
||||
|
||||
// Get all the customerList where billingAddress is not null
|
||||
defaultCustomerShouldBeFound("billingAddress.specified=true");
|
||||
// Get all the customerList where contractualAddress is not null
|
||||
defaultCustomerShouldBeFound("contractualAddress.specified=true");
|
||||
|
||||
// Get all the customerList where billingAddress is null
|
||||
defaultCustomerShouldNotBeFound("billingAddress.specified=false");
|
||||
// Get all the customerList where contractualAddress is null
|
||||
defaultCustomerShouldNotBeFound("contractualAddress.specified=false");
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllCustomersByRemarkIsEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
customerRepository.saveAndFlush(customer);
|
||||
|
||||
// Get all the customerList where remark equals to DEFAULT_REMARK
|
||||
defaultCustomerShouldBeFound("remark.equals=" + DEFAULT_REMARK);
|
||||
|
||||
// Get all the customerList where remark equals to UPDATED_REMARK
|
||||
defaultCustomerShouldNotBeFound("remark.equals=" + UPDATED_REMARK);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllCustomersByRemarkIsInShouldWork() throws Exception {
|
||||
// Initialize the database
|
||||
customerRepository.saveAndFlush(customer);
|
||||
|
||||
// Get all the customerList where remark in DEFAULT_REMARK or UPDATED_REMARK
|
||||
defaultCustomerShouldBeFound("remark.in=" + DEFAULT_REMARK + "," + UPDATED_REMARK);
|
||||
|
||||
// Get all the customerList where remark equals to UPDATED_REMARK
|
||||
defaultCustomerShouldNotBeFound("remark.in=" + UPDATED_REMARK);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllCustomersByRemarkIsNullOrNotNull() throws Exception {
|
||||
// Initialize the database
|
||||
customerRepository.saveAndFlush(customer);
|
||||
|
||||
// Get all the customerList where remark is not null
|
||||
defaultCustomerShouldBeFound("remark.specified=true");
|
||||
|
||||
// Get all the customerList where remark is null
|
||||
defaultCustomerShouldNotBeFound("remark.specified=false");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -640,13 +691,14 @@ public class CustomerResourceIntTest {
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
|
||||
.andExpect(jsonPath("$.[*].id").value(hasItem(customer.getId().intValue())))
|
||||
.andExpect(jsonPath("$.[*].number").value(hasItem(DEFAULT_NUMBER)))
|
||||
.andExpect(jsonPath("$.[*].reference").value(hasItem(DEFAULT_REFERENCE)))
|
||||
.andExpect(jsonPath("$.[*].prefix").value(hasItem(DEFAULT_PREFIX)))
|
||||
.andExpect(jsonPath("$.[*].name").value(hasItem(DEFAULT_NAME)))
|
||||
.andExpect(jsonPath("$.[*].contractualSalutation").value(hasItem(DEFAULT_CONTRACTUAL_SALUTATION)))
|
||||
.andExpect(jsonPath("$.[*].contractualAddress").value(hasItem(DEFAULT_CONTRACTUAL_ADDRESS)))
|
||||
.andExpect(jsonPath("$.[*].billingSalutation").value(hasItem(DEFAULT_BILLING_SALUTATION)))
|
||||
.andExpect(jsonPath("$.[*].billingAddress").value(hasItem(DEFAULT_BILLING_ADDRESS)));
|
||||
.andExpect(jsonPath("$.[*].billingAddress").value(hasItem(DEFAULT_BILLING_ADDRESS)))
|
||||
.andExpect(jsonPath("$.[*].remark").value(hasItem(DEFAULT_REMARK)));
|
||||
|
||||
// Check, that the count call also returns 1
|
||||
restCustomerMockMvc.perform(get("/api/customers/count?sort=id,desc&" + filter))
|
||||
@@ -694,13 +746,14 @@ public class CustomerResourceIntTest {
|
||||
// Disconnect from session so that the updates on updatedCustomer are not directly saved in db
|
||||
em.detach(updatedCustomer);
|
||||
updatedCustomer
|
||||
.number(UPDATED_NUMBER)
|
||||
.reference(UPDATED_REFERENCE)
|
||||
.prefix(UPDATED_PREFIX)
|
||||
.name(UPDATED_NAME)
|
||||
.contractualSalutation(UPDATED_CONTRACTUAL_SALUTATION)
|
||||
.contractualAddress(UPDATED_CONTRACTUAL_ADDRESS)
|
||||
.billingSalutation(UPDATED_BILLING_SALUTATION)
|
||||
.billingAddress(UPDATED_BILLING_ADDRESS);
|
||||
.billingAddress(UPDATED_BILLING_ADDRESS)
|
||||
.remark(UPDATED_REMARK);
|
||||
CustomerDTO customerDTO = customerMapper.toDto(updatedCustomer);
|
||||
|
||||
restCustomerMockMvc.perform(put("/api/customers")
|
||||
@@ -712,13 +765,14 @@ public class CustomerResourceIntTest {
|
||||
List<Customer> customerList = customerRepository.findAll();
|
||||
assertThat(customerList).hasSize(databaseSizeBeforeUpdate);
|
||||
Customer testCustomer = customerList.get(customerList.size() - 1);
|
||||
assertThat(testCustomer.getNumber()).isEqualTo(UPDATED_NUMBER);
|
||||
assertThat(testCustomer.getReference()).isEqualTo(UPDATED_REFERENCE);
|
||||
assertThat(testCustomer.getPrefix()).isEqualTo(UPDATED_PREFIX);
|
||||
assertThat(testCustomer.getName()).isEqualTo(UPDATED_NAME);
|
||||
assertThat(testCustomer.getContractualSalutation()).isEqualTo(UPDATED_CONTRACTUAL_SALUTATION);
|
||||
assertThat(testCustomer.getContractualAddress()).isEqualTo(UPDATED_CONTRACTUAL_ADDRESS);
|
||||
assertThat(testCustomer.getBillingSalutation()).isEqualTo(UPDATED_BILLING_SALUTATION);
|
||||
assertThat(testCustomer.getBillingAddress()).isEqualTo(UPDATED_BILLING_ADDRESS);
|
||||
assertThat(testCustomer.getRemark()).isEqualTo(UPDATED_REMARK);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -50,14 +50,17 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
@SpringBootTest(classes = HsadminNgApp.class)
|
||||
public class MembershipResourceIntTest {
|
||||
|
||||
private static final LocalDate DEFAULT_FROM = LocalDate.ofEpochDay(0L);
|
||||
private static final LocalDate UPDATED_FROM = LocalDate.now(ZoneId.systemDefault());
|
||||
private static final LocalDate DEFAULT_DOCUMENT_DATE = LocalDate.ofEpochDay(0L);
|
||||
private static final LocalDate UPDATED_DOCUMENT_DATE = LocalDate.now(ZoneId.systemDefault());
|
||||
|
||||
private static final LocalDate DEFAULT_TO = LocalDate.ofEpochDay(0L);
|
||||
private static final LocalDate UPDATED_TO = LocalDate.now(ZoneId.systemDefault());
|
||||
private static final LocalDate DEFAULT_MEMBER_FROM = LocalDate.ofEpochDay(0L);
|
||||
private static final LocalDate UPDATED_MEMBER_FROM = LocalDate.now(ZoneId.systemDefault());
|
||||
|
||||
private static final String DEFAULT_COMMENT = "AAAAAAAAAA";
|
||||
private static final String UPDATED_COMMENT = "BBBBBBBBBB";
|
||||
private static final LocalDate DEFAULT_MEMBER_UNTIL = LocalDate.ofEpochDay(0L);
|
||||
private static final LocalDate UPDATED_MEMBER_UNTIL = LocalDate.now(ZoneId.systemDefault());
|
||||
|
||||
private static final String DEFAULT_REMARK = "AAAAAAAAAA";
|
||||
private static final String UPDATED_REMARK = "BBBBBBBBBB";
|
||||
|
||||
@Autowired
|
||||
private MembershipRepository membershipRepository;
|
||||
@@ -110,9 +113,10 @@ public class MembershipResourceIntTest {
|
||||
*/
|
||||
public static Membership createEntity(EntityManager em) {
|
||||
Membership membership = new Membership()
|
||||
.from(DEFAULT_FROM)
|
||||
.to(DEFAULT_TO)
|
||||
.comment(DEFAULT_COMMENT);
|
||||
.documentDate(DEFAULT_DOCUMENT_DATE)
|
||||
.memberFrom(DEFAULT_MEMBER_FROM)
|
||||
.memberUntil(DEFAULT_MEMBER_UNTIL)
|
||||
.remark(DEFAULT_REMARK);
|
||||
// Add required entity
|
||||
Customer customer = CustomerResourceIntTest.createEntity(em);
|
||||
em.persist(customer);
|
||||
@@ -142,9 +146,10 @@ public class MembershipResourceIntTest {
|
||||
List<Membership> membershipList = membershipRepository.findAll();
|
||||
assertThat(membershipList).hasSize(databaseSizeBeforeCreate + 1);
|
||||
Membership testMembership = membershipList.get(membershipList.size() - 1);
|
||||
assertThat(testMembership.getFrom()).isEqualTo(DEFAULT_FROM);
|
||||
assertThat(testMembership.getTo()).isEqualTo(DEFAULT_TO);
|
||||
assertThat(testMembership.getComment()).isEqualTo(DEFAULT_COMMENT);
|
||||
assertThat(testMembership.getDocumentDate()).isEqualTo(DEFAULT_DOCUMENT_DATE);
|
||||
assertThat(testMembership.getMemberFrom()).isEqualTo(DEFAULT_MEMBER_FROM);
|
||||
assertThat(testMembership.getMemberUntil()).isEqualTo(DEFAULT_MEMBER_UNTIL);
|
||||
assertThat(testMembership.getRemark()).isEqualTo(DEFAULT_REMARK);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -169,10 +174,29 @@ public class MembershipResourceIntTest {
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkFromIsRequired() throws Exception {
|
||||
public void checkDocumentDateIsRequired() throws Exception {
|
||||
int databaseSizeBeforeTest = membershipRepository.findAll().size();
|
||||
// set the field null
|
||||
membership.setFrom(null);
|
||||
membership.setDocumentDate(null);
|
||||
|
||||
// Create the Membership, which fails.
|
||||
MembershipDTO membershipDTO = membershipMapper.toDto(membership);
|
||||
|
||||
restMembershipMockMvc.perform(post("/api/memberships")
|
||||
.contentType(TestUtil.APPLICATION_JSON_UTF8)
|
||||
.content(TestUtil.convertObjectToJsonBytes(membershipDTO)))
|
||||
.andExpect(status().isBadRequest());
|
||||
|
||||
List<Membership> membershipList = membershipRepository.findAll();
|
||||
assertThat(membershipList).hasSize(databaseSizeBeforeTest);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkMemberFromIsRequired() throws Exception {
|
||||
int databaseSizeBeforeTest = membershipRepository.findAll().size();
|
||||
// set the field null
|
||||
membership.setMemberFrom(null);
|
||||
|
||||
// Create the Membership, which fails.
|
||||
MembershipDTO membershipDTO = membershipMapper.toDto(membership);
|
||||
@@ -197,9 +221,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("$.[*].from").value(hasItem(DEFAULT_FROM.toString())))
|
||||
.andExpect(jsonPath("$.[*].to").value(hasItem(DEFAULT_TO.toString())))
|
||||
.andExpect(jsonPath("$.[*].comment").value(hasItem(DEFAULT_COMMENT.toString())));
|
||||
.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("$.[*].remark").value(hasItem(DEFAULT_REMARK.toString())));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -213,180 +238,247 @@ public class MembershipResourceIntTest {
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
|
||||
.andExpect(jsonPath("$.id").value(membership.getId().intValue()))
|
||||
.andExpect(jsonPath("$.from").value(DEFAULT_FROM.toString()))
|
||||
.andExpect(jsonPath("$.to").value(DEFAULT_TO.toString()))
|
||||
.andExpect(jsonPath("$.comment").value(DEFAULT_COMMENT.toString()));
|
||||
.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("$.remark").value(DEFAULT_REMARK.toString()));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllMembershipsByFromIsEqualToSomething() throws Exception {
|
||||
public void getAllMembershipsByDocumentDateIsEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
membershipRepository.saveAndFlush(membership);
|
||||
|
||||
// Get all the membershipList where from equals to DEFAULT_FROM
|
||||
defaultMembershipShouldBeFound("from.equals=" + DEFAULT_FROM);
|
||||
// Get all the membershipList where documentDate equals to DEFAULT_DOCUMENT_DATE
|
||||
defaultMembershipShouldBeFound("documentDate.equals=" + DEFAULT_DOCUMENT_DATE);
|
||||
|
||||
// Get all the membershipList where from equals to UPDATED_FROM
|
||||
defaultMembershipShouldNotBeFound("from.equals=" + UPDATED_FROM);
|
||||
// Get all the membershipList where documentDate equals to UPDATED_DOCUMENT_DATE
|
||||
defaultMembershipShouldNotBeFound("documentDate.equals=" + UPDATED_DOCUMENT_DATE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllMembershipsByFromIsInShouldWork() throws Exception {
|
||||
public void getAllMembershipsByDocumentDateIsInShouldWork() throws Exception {
|
||||
// Initialize the database
|
||||
membershipRepository.saveAndFlush(membership);
|
||||
|
||||
// Get all the membershipList where from in DEFAULT_FROM or UPDATED_FROM
|
||||
defaultMembershipShouldBeFound("from.in=" + DEFAULT_FROM + "," + UPDATED_FROM);
|
||||
// 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 from equals to UPDATED_FROM
|
||||
defaultMembershipShouldNotBeFound("from.in=" + UPDATED_FROM);
|
||||
// Get all the membershipList where documentDate equals to UPDATED_DOCUMENT_DATE
|
||||
defaultMembershipShouldNotBeFound("documentDate.in=" + UPDATED_DOCUMENT_DATE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllMembershipsByFromIsNullOrNotNull() throws Exception {
|
||||
public void getAllMembershipsByDocumentDateIsNullOrNotNull() throws Exception {
|
||||
// Initialize the database
|
||||
membershipRepository.saveAndFlush(membership);
|
||||
|
||||
// Get all the membershipList where from is not null
|
||||
defaultMembershipShouldBeFound("from.specified=true");
|
||||
// Get all the membershipList where documentDate is not null
|
||||
defaultMembershipShouldBeFound("documentDate.specified=true");
|
||||
|
||||
// Get all the membershipList where from is null
|
||||
defaultMembershipShouldNotBeFound("from.specified=false");
|
||||
// Get all the membershipList where documentDate is null
|
||||
defaultMembershipShouldNotBeFound("documentDate.specified=false");
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllMembershipsByFromIsGreaterThanOrEqualToSomething() throws Exception {
|
||||
public void getAllMembershipsByDocumentDateIsGreaterThanOrEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
membershipRepository.saveAndFlush(membership);
|
||||
|
||||
// Get all the membershipList where from greater than or equals to DEFAULT_FROM
|
||||
defaultMembershipShouldBeFound("from.greaterOrEqualThan=" + DEFAULT_FROM);
|
||||
// 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 from greater than or equals to UPDATED_FROM
|
||||
defaultMembershipShouldNotBeFound("from.greaterOrEqualThan=" + UPDATED_FROM);
|
||||
// Get all the membershipList where documentDate greater than or equals to UPDATED_DOCUMENT_DATE
|
||||
defaultMembershipShouldNotBeFound("documentDate.greaterOrEqualThan=" + UPDATED_DOCUMENT_DATE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllMembershipsByFromIsLessThanSomething() throws Exception {
|
||||
public void getAllMembershipsByDocumentDateIsLessThanSomething() throws Exception {
|
||||
// Initialize the database
|
||||
membershipRepository.saveAndFlush(membership);
|
||||
|
||||
// Get all the membershipList where from less than or equals to DEFAULT_FROM
|
||||
defaultMembershipShouldNotBeFound("from.lessThan=" + DEFAULT_FROM);
|
||||
// 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 from less than or equals to UPDATED_FROM
|
||||
defaultMembershipShouldBeFound("from.lessThan=" + UPDATED_FROM);
|
||||
// Get all the membershipList where documentDate less than or equals to UPDATED_DOCUMENT_DATE
|
||||
defaultMembershipShouldBeFound("documentDate.lessThan=" + UPDATED_DOCUMENT_DATE);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllMembershipsByToIsEqualToSomething() throws Exception {
|
||||
public void getAllMembershipsByMemberFromIsEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
membershipRepository.saveAndFlush(membership);
|
||||
|
||||
// Get all the membershipList where to equals to DEFAULT_TO
|
||||
defaultMembershipShouldBeFound("to.equals=" + DEFAULT_TO);
|
||||
// Get all the membershipList where memberFrom equals to DEFAULT_MEMBER_FROM
|
||||
defaultMembershipShouldBeFound("memberFrom.equals=" + DEFAULT_MEMBER_FROM);
|
||||
|
||||
// Get all the membershipList where to equals to UPDATED_TO
|
||||
defaultMembershipShouldNotBeFound("to.equals=" + UPDATED_TO);
|
||||
// Get all the membershipList where memberFrom equals to UPDATED_MEMBER_FROM
|
||||
defaultMembershipShouldNotBeFound("memberFrom.equals=" + UPDATED_MEMBER_FROM);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllMembershipsByToIsInShouldWork() throws Exception {
|
||||
public void getAllMembershipsByMemberFromIsInShouldWork() throws Exception {
|
||||
// Initialize the database
|
||||
membershipRepository.saveAndFlush(membership);
|
||||
|
||||
// Get all the membershipList where to in DEFAULT_TO or UPDATED_TO
|
||||
defaultMembershipShouldBeFound("to.in=" + DEFAULT_TO + "," + UPDATED_TO);
|
||||
// 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 to equals to UPDATED_TO
|
||||
defaultMembershipShouldNotBeFound("to.in=" + UPDATED_TO);
|
||||
// Get all the membershipList where memberFrom equals to UPDATED_MEMBER_FROM
|
||||
defaultMembershipShouldNotBeFound("memberFrom.in=" + UPDATED_MEMBER_FROM);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllMembershipsByToIsNullOrNotNull() throws Exception {
|
||||
public void getAllMembershipsByMemberFromIsNullOrNotNull() throws Exception {
|
||||
// Initialize the database
|
||||
membershipRepository.saveAndFlush(membership);
|
||||
|
||||
// Get all the membershipList where to is not null
|
||||
defaultMembershipShouldBeFound("to.specified=true");
|
||||
// Get all the membershipList where memberFrom is not null
|
||||
defaultMembershipShouldBeFound("memberFrom.specified=true");
|
||||
|
||||
// Get all the membershipList where to is null
|
||||
defaultMembershipShouldNotBeFound("to.specified=false");
|
||||
// Get all the membershipList where memberFrom is null
|
||||
defaultMembershipShouldNotBeFound("memberFrom.specified=false");
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllMembershipsByToIsGreaterThanOrEqualToSomething() throws Exception {
|
||||
public void getAllMembershipsByMemberFromIsGreaterThanOrEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
membershipRepository.saveAndFlush(membership);
|
||||
|
||||
// Get all the membershipList where to greater than or equals to DEFAULT_TO
|
||||
defaultMembershipShouldBeFound("to.greaterOrEqualThan=" + DEFAULT_TO);
|
||||
// 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 to greater than or equals to UPDATED_TO
|
||||
defaultMembershipShouldNotBeFound("to.greaterOrEqualThan=" + UPDATED_TO);
|
||||
// Get all the membershipList where memberFrom greater than or equals to UPDATED_MEMBER_FROM
|
||||
defaultMembershipShouldNotBeFound("memberFrom.greaterOrEqualThan=" + UPDATED_MEMBER_FROM);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllMembershipsByToIsLessThanSomething() throws Exception {
|
||||
public void getAllMembershipsByMemberFromIsLessThanSomething() throws Exception {
|
||||
// Initialize the database
|
||||
membershipRepository.saveAndFlush(membership);
|
||||
|
||||
// Get all the membershipList where to less than or equals to DEFAULT_TO
|
||||
defaultMembershipShouldNotBeFound("to.lessThan=" + DEFAULT_TO);
|
||||
// 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 to less than or equals to UPDATED_TO
|
||||
defaultMembershipShouldBeFound("to.lessThan=" + UPDATED_TO);
|
||||
// Get all the membershipList where memberFrom less than or equals to UPDATED_MEMBER_FROM
|
||||
defaultMembershipShouldBeFound("memberFrom.lessThan=" + UPDATED_MEMBER_FROM);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllMembershipsByCommentIsEqualToSomething() throws Exception {
|
||||
public void getAllMembershipsByMemberUntilIsEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
membershipRepository.saveAndFlush(membership);
|
||||
|
||||
// Get all the membershipList where comment equals to DEFAULT_COMMENT
|
||||
defaultMembershipShouldBeFound("comment.equals=" + DEFAULT_COMMENT);
|
||||
// Get all the membershipList where memberUntil equals to DEFAULT_MEMBER_UNTIL
|
||||
defaultMembershipShouldBeFound("memberUntil.equals=" + DEFAULT_MEMBER_UNTIL);
|
||||
|
||||
// Get all the membershipList where comment equals to UPDATED_COMMENT
|
||||
defaultMembershipShouldNotBeFound("comment.equals=" + UPDATED_COMMENT);
|
||||
// Get all the membershipList where memberUntil equals to UPDATED_MEMBER_UNTIL
|
||||
defaultMembershipShouldNotBeFound("memberUntil.equals=" + UPDATED_MEMBER_UNTIL);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllMembershipsByCommentIsInShouldWork() throws Exception {
|
||||
public void getAllMembershipsByMemberUntilIsInShouldWork() throws Exception {
|
||||
// Initialize the database
|
||||
membershipRepository.saveAndFlush(membership);
|
||||
|
||||
// Get all the membershipList where comment in DEFAULT_COMMENT or UPDATED_COMMENT
|
||||
defaultMembershipShouldBeFound("comment.in=" + DEFAULT_COMMENT + "," + UPDATED_COMMENT);
|
||||
// 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 comment equals to UPDATED_COMMENT
|
||||
defaultMembershipShouldNotBeFound("comment.in=" + UPDATED_COMMENT);
|
||||
// Get all the membershipList where memberUntil equals to UPDATED_MEMBER_UNTIL
|
||||
defaultMembershipShouldNotBeFound("memberUntil.in=" + UPDATED_MEMBER_UNTIL);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllMembershipsByCommentIsNullOrNotNull() throws Exception {
|
||||
public void getAllMembershipsByMemberUntilIsNullOrNotNull() throws Exception {
|
||||
// Initialize the database
|
||||
membershipRepository.saveAndFlush(membership);
|
||||
|
||||
// Get all the membershipList where comment is not null
|
||||
defaultMembershipShouldBeFound("comment.specified=true");
|
||||
// Get all the membershipList where memberUntil is not null
|
||||
defaultMembershipShouldBeFound("memberUntil.specified=true");
|
||||
|
||||
// Get all the membershipList where comment is null
|
||||
defaultMembershipShouldNotBeFound("comment.specified=false");
|
||||
// Get all the membershipList where memberUntil is null
|
||||
defaultMembershipShouldNotBeFound("memberUntil.specified=false");
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllMembershipsByMemberUntilIsGreaterThanOrEqualToSomething() 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 memberUntil greater than or equals to UPDATED_MEMBER_UNTIL
|
||||
defaultMembershipShouldNotBeFound("memberUntil.greaterOrEqualThan=" + UPDATED_MEMBER_UNTIL);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllMembershipsByMemberUntilIsLessThanSomething() 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 memberUntil less than or equals to UPDATED_MEMBER_UNTIL
|
||||
defaultMembershipShouldBeFound("memberUntil.lessThan=" + UPDATED_MEMBER_UNTIL);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllMembershipsByRemarkIsEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
membershipRepository.saveAndFlush(membership);
|
||||
|
||||
// Get all the membershipList where remark equals to DEFAULT_REMARK
|
||||
defaultMembershipShouldBeFound("remark.equals=" + DEFAULT_REMARK);
|
||||
|
||||
// Get all the membershipList where remark equals to UPDATED_REMARK
|
||||
defaultMembershipShouldNotBeFound("remark.equals=" + UPDATED_REMARK);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllMembershipsByRemarkIsInShouldWork() throws Exception {
|
||||
// Initialize the database
|
||||
membershipRepository.saveAndFlush(membership);
|
||||
|
||||
// Get all the membershipList where remark in DEFAULT_REMARK or UPDATED_REMARK
|
||||
defaultMembershipShouldBeFound("remark.in=" + DEFAULT_REMARK + "," + UPDATED_REMARK);
|
||||
|
||||
// Get all the membershipList where remark equals to UPDATED_REMARK
|
||||
defaultMembershipShouldNotBeFound("remark.in=" + UPDATED_REMARK);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllMembershipsByRemarkIsNullOrNotNull() throws Exception {
|
||||
// Initialize the database
|
||||
membershipRepository.saveAndFlush(membership);
|
||||
|
||||
// Get all the membershipList where remark is not null
|
||||
defaultMembershipShouldBeFound("remark.specified=true");
|
||||
|
||||
// Get all the membershipList where remark is null
|
||||
defaultMembershipShouldNotBeFound("remark.specified=false");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -453,9 +545,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("$.[*].from").value(hasItem(DEFAULT_FROM.toString())))
|
||||
.andExpect(jsonPath("$.[*].to").value(hasItem(DEFAULT_TO.toString())))
|
||||
.andExpect(jsonPath("$.[*].comment").value(hasItem(DEFAULT_COMMENT)));
|
||||
.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("$.[*].remark").value(hasItem(DEFAULT_REMARK)));
|
||||
|
||||
// Check, that the count call also returns 1
|
||||
restMembershipMockMvc.perform(get("/api/memberships/count?sort=id,desc&" + filter))
|
||||
@@ -503,9 +596,10 @@ public class MembershipResourceIntTest {
|
||||
// Disconnect from session so that the updates on updatedMembership are not directly saved in db
|
||||
em.detach(updatedMembership);
|
||||
updatedMembership
|
||||
.from(UPDATED_FROM)
|
||||
.to(UPDATED_TO)
|
||||
.comment(UPDATED_COMMENT);
|
||||
.documentDate(UPDATED_DOCUMENT_DATE)
|
||||
.memberFrom(UPDATED_MEMBER_FROM)
|
||||
.memberUntil(UPDATED_MEMBER_UNTIL)
|
||||
.remark(UPDATED_REMARK);
|
||||
MembershipDTO membershipDTO = membershipMapper.toDto(updatedMembership);
|
||||
|
||||
restMembershipMockMvc.perform(put("/api/memberships")
|
||||
@@ -517,9 +611,10 @@ public class MembershipResourceIntTest {
|
||||
List<Membership> membershipList = membershipRepository.findAll();
|
||||
assertThat(membershipList).hasSize(databaseSizeBeforeUpdate);
|
||||
Membership testMembership = membershipList.get(membershipList.size() - 1);
|
||||
assertThat(testMembership.getFrom()).isEqualTo(UPDATED_FROM);
|
||||
assertThat(testMembership.getTo()).isEqualTo(UPDATED_TO);
|
||||
assertThat(testMembership.getComment()).isEqualTo(UPDATED_COMMENT);
|
||||
assertThat(testMembership.getDocumentDate()).isEqualTo(UPDATED_DOCUMENT_DATE);
|
||||
assertThat(testMembership.getMemberFrom()).isEqualTo(UPDATED_MEMBER_FROM);
|
||||
assertThat(testMembership.getMemberUntil()).isEqualTo(UPDATED_MEMBER_UNTIL);
|
||||
assertThat(testMembership.getRemark()).isEqualTo(UPDATED_REMARK);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -57,23 +57,23 @@ public class SepaMandateResourceIntTest {
|
||||
private static final String DEFAULT_BIC = "AAAAAAAAAA";
|
||||
private static final String UPDATED_BIC = "BBBBBBBBBB";
|
||||
|
||||
private static final LocalDate DEFAULT_CREATED = LocalDate.ofEpochDay(0L);
|
||||
private static final LocalDate UPDATED_CREATED = LocalDate.now(ZoneId.systemDefault());
|
||||
private static final LocalDate DEFAULT_DOCUMENT_DATE = LocalDate.ofEpochDay(0L);
|
||||
private static final LocalDate UPDATED_DOCUMENT_DATE = LocalDate.now(ZoneId.systemDefault());
|
||||
|
||||
private static final LocalDate DEFAULT_VALID_FROM = LocalDate.ofEpochDay(0L);
|
||||
private static final LocalDate UPDATED_VALID_FROM = LocalDate.now(ZoneId.systemDefault());
|
||||
|
||||
private static final LocalDate DEFAULT_VALID_TO = LocalDate.ofEpochDay(0L);
|
||||
private static final LocalDate UPDATED_VALID_TO = LocalDate.now(ZoneId.systemDefault());
|
||||
private static final LocalDate DEFAULT_VALID_UNTIL = LocalDate.ofEpochDay(0L);
|
||||
private static final LocalDate UPDATED_VALID_UNTIL = LocalDate.now(ZoneId.systemDefault());
|
||||
|
||||
private static final LocalDate DEFAULT_LAST_USED = LocalDate.ofEpochDay(0L);
|
||||
private static final LocalDate UPDATED_LAST_USED = LocalDate.now(ZoneId.systemDefault());
|
||||
|
||||
private static final LocalDate DEFAULT_CANCELLED = LocalDate.ofEpochDay(0L);
|
||||
private static final LocalDate UPDATED_CANCELLED = LocalDate.now(ZoneId.systemDefault());
|
||||
private static final LocalDate DEFAULT_CANCELLATION_DATE = LocalDate.ofEpochDay(0L);
|
||||
private static final LocalDate UPDATED_CANCELLATION_DATE = LocalDate.now(ZoneId.systemDefault());
|
||||
|
||||
private static final String DEFAULT_COMMENT = "AAAAAAAAAA";
|
||||
private static final String UPDATED_COMMENT = "BBBBBBBBBB";
|
||||
private static final String DEFAULT_REMARK = "AAAAAAAAAA";
|
||||
private static final String UPDATED_REMARK = "BBBBBBBBBB";
|
||||
|
||||
@Autowired
|
||||
private SepaMandateRepository sepaMandateRepository;
|
||||
@@ -129,12 +129,12 @@ public class SepaMandateResourceIntTest {
|
||||
.reference(DEFAULT_REFERENCE)
|
||||
.iban(DEFAULT_IBAN)
|
||||
.bic(DEFAULT_BIC)
|
||||
.created(DEFAULT_CREATED)
|
||||
.documentDate(DEFAULT_DOCUMENT_DATE)
|
||||
.validFrom(DEFAULT_VALID_FROM)
|
||||
.validTo(DEFAULT_VALID_TO)
|
||||
.validUntil(DEFAULT_VALID_UNTIL)
|
||||
.lastUsed(DEFAULT_LAST_USED)
|
||||
.cancelled(DEFAULT_CANCELLED)
|
||||
.comment(DEFAULT_COMMENT);
|
||||
.cancellationDate(DEFAULT_CANCELLATION_DATE)
|
||||
.remark(DEFAULT_REMARK);
|
||||
// Add required entity
|
||||
Customer customer = CustomerResourceIntTest.createEntity(em);
|
||||
em.persist(customer);
|
||||
@@ -167,12 +167,12 @@ public class SepaMandateResourceIntTest {
|
||||
assertThat(testSepaMandate.getReference()).isEqualTo(DEFAULT_REFERENCE);
|
||||
assertThat(testSepaMandate.getIban()).isEqualTo(DEFAULT_IBAN);
|
||||
assertThat(testSepaMandate.getBic()).isEqualTo(DEFAULT_BIC);
|
||||
assertThat(testSepaMandate.getCreated()).isEqualTo(DEFAULT_CREATED);
|
||||
assertThat(testSepaMandate.getDocumentDate()).isEqualTo(DEFAULT_DOCUMENT_DATE);
|
||||
assertThat(testSepaMandate.getValidFrom()).isEqualTo(DEFAULT_VALID_FROM);
|
||||
assertThat(testSepaMandate.getValidTo()).isEqualTo(DEFAULT_VALID_TO);
|
||||
assertThat(testSepaMandate.getValidUntil()).isEqualTo(DEFAULT_VALID_UNTIL);
|
||||
assertThat(testSepaMandate.getLastUsed()).isEqualTo(DEFAULT_LAST_USED);
|
||||
assertThat(testSepaMandate.getCancelled()).isEqualTo(DEFAULT_CANCELLED);
|
||||
assertThat(testSepaMandate.getComment()).isEqualTo(DEFAULT_COMMENT);
|
||||
assertThat(testSepaMandate.getCancellationDate()).isEqualTo(DEFAULT_CANCELLATION_DATE);
|
||||
assertThat(testSepaMandate.getRemark()).isEqualTo(DEFAULT_REMARK);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -216,10 +216,10 @@ public class SepaMandateResourceIntTest {
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkCreatedIsRequired() throws Exception {
|
||||
public void checkDocumentDateIsRequired() throws Exception {
|
||||
int databaseSizeBeforeTest = sepaMandateRepository.findAll().size();
|
||||
// set the field null
|
||||
sepaMandate.setCreated(null);
|
||||
sepaMandate.setDocumentDate(null);
|
||||
|
||||
// Create the SepaMandate, which fails.
|
||||
SepaMandateDTO sepaMandateDTO = sepaMandateMapper.toDto(sepaMandate);
|
||||
@@ -266,12 +266,12 @@ 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("$.[*].created").value(hasItem(DEFAULT_CREATED.toString())))
|
||||
.andExpect(jsonPath("$.[*].documentDate").value(hasItem(DEFAULT_DOCUMENT_DATE.toString())))
|
||||
.andExpect(jsonPath("$.[*].validFrom").value(hasItem(DEFAULT_VALID_FROM.toString())))
|
||||
.andExpect(jsonPath("$.[*].validTo").value(hasItem(DEFAULT_VALID_TO.toString())))
|
||||
.andExpect(jsonPath("$.[*].validUntil").value(hasItem(DEFAULT_VALID_UNTIL.toString())))
|
||||
.andExpect(jsonPath("$.[*].lastUsed").value(hasItem(DEFAULT_LAST_USED.toString())))
|
||||
.andExpect(jsonPath("$.[*].cancelled").value(hasItem(DEFAULT_CANCELLED.toString())))
|
||||
.andExpect(jsonPath("$.[*].comment").value(hasItem(DEFAULT_COMMENT.toString())));
|
||||
.andExpect(jsonPath("$.[*].cancellationDate").value(hasItem(DEFAULT_CANCELLATION_DATE.toString())))
|
||||
.andExpect(jsonPath("$.[*].remark").value(hasItem(DEFAULT_REMARK.toString())));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -288,12 +288,12 @@ 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("$.created").value(DEFAULT_CREATED.toString()))
|
||||
.andExpect(jsonPath("$.documentDate").value(DEFAULT_DOCUMENT_DATE.toString()))
|
||||
.andExpect(jsonPath("$.validFrom").value(DEFAULT_VALID_FROM.toString()))
|
||||
.andExpect(jsonPath("$.validTo").value(DEFAULT_VALID_TO.toString()))
|
||||
.andExpect(jsonPath("$.validUntil").value(DEFAULT_VALID_UNTIL.toString()))
|
||||
.andExpect(jsonPath("$.lastUsed").value(DEFAULT_LAST_USED.toString()))
|
||||
.andExpect(jsonPath("$.cancelled").value(DEFAULT_CANCELLED.toString()))
|
||||
.andExpect(jsonPath("$.comment").value(DEFAULT_COMMENT.toString()));
|
||||
.andExpect(jsonPath("$.cancellationDate").value(DEFAULT_CANCELLATION_DATE.toString()))
|
||||
.andExpect(jsonPath("$.remark").value(DEFAULT_REMARK.toString()));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -415,67 +415,67 @@ public class SepaMandateResourceIntTest {
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSepaMandatesByCreatedIsEqualToSomething() throws Exception {
|
||||
public void getAllSepaMandatesByDocumentDateIsEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
sepaMandateRepository.saveAndFlush(sepaMandate);
|
||||
|
||||
// Get all the sepaMandateList where created equals to DEFAULT_CREATED
|
||||
defaultSepaMandateShouldBeFound("created.equals=" + DEFAULT_CREATED);
|
||||
// Get all the sepaMandateList where documentDate equals to DEFAULT_DOCUMENT_DATE
|
||||
defaultSepaMandateShouldBeFound("documentDate.equals=" + DEFAULT_DOCUMENT_DATE);
|
||||
|
||||
// Get all the sepaMandateList where created equals to UPDATED_CREATED
|
||||
defaultSepaMandateShouldNotBeFound("created.equals=" + UPDATED_CREATED);
|
||||
// Get all the sepaMandateList where documentDate equals to UPDATED_DOCUMENT_DATE
|
||||
defaultSepaMandateShouldNotBeFound("documentDate.equals=" + UPDATED_DOCUMENT_DATE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSepaMandatesByCreatedIsInShouldWork() throws Exception {
|
||||
public void getAllSepaMandatesByDocumentDateIsInShouldWork() throws Exception {
|
||||
// Initialize the database
|
||||
sepaMandateRepository.saveAndFlush(sepaMandate);
|
||||
|
||||
// Get all the sepaMandateList where created in DEFAULT_CREATED or UPDATED_CREATED
|
||||
defaultSepaMandateShouldBeFound("created.in=" + DEFAULT_CREATED + "," + UPDATED_CREATED);
|
||||
// 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 created equals to UPDATED_CREATED
|
||||
defaultSepaMandateShouldNotBeFound("created.in=" + UPDATED_CREATED);
|
||||
// Get all the sepaMandateList where documentDate equals to UPDATED_DOCUMENT_DATE
|
||||
defaultSepaMandateShouldNotBeFound("documentDate.in=" + UPDATED_DOCUMENT_DATE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSepaMandatesByCreatedIsNullOrNotNull() throws Exception {
|
||||
public void getAllSepaMandatesByDocumentDateIsNullOrNotNull() throws Exception {
|
||||
// Initialize the database
|
||||
sepaMandateRepository.saveAndFlush(sepaMandate);
|
||||
|
||||
// Get all the sepaMandateList where created is not null
|
||||
defaultSepaMandateShouldBeFound("created.specified=true");
|
||||
// Get all the sepaMandateList where documentDate is not null
|
||||
defaultSepaMandateShouldBeFound("documentDate.specified=true");
|
||||
|
||||
// Get all the sepaMandateList where created is null
|
||||
defaultSepaMandateShouldNotBeFound("created.specified=false");
|
||||
// Get all the sepaMandateList where documentDate is null
|
||||
defaultSepaMandateShouldNotBeFound("documentDate.specified=false");
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSepaMandatesByCreatedIsGreaterThanOrEqualToSomething() throws Exception {
|
||||
public void getAllSepaMandatesByDocumentDateIsGreaterThanOrEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
sepaMandateRepository.saveAndFlush(sepaMandate);
|
||||
|
||||
// Get all the sepaMandateList where created greater than or equals to DEFAULT_CREATED
|
||||
defaultSepaMandateShouldBeFound("created.greaterOrEqualThan=" + DEFAULT_CREATED);
|
||||
// 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 created greater than or equals to UPDATED_CREATED
|
||||
defaultSepaMandateShouldNotBeFound("created.greaterOrEqualThan=" + UPDATED_CREATED);
|
||||
// Get all the sepaMandateList where documentDate greater than or equals to UPDATED_DOCUMENT_DATE
|
||||
defaultSepaMandateShouldNotBeFound("documentDate.greaterOrEqualThan=" + UPDATED_DOCUMENT_DATE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSepaMandatesByCreatedIsLessThanSomething() throws Exception {
|
||||
public void getAllSepaMandatesByDocumentDateIsLessThanSomething() throws Exception {
|
||||
// Initialize the database
|
||||
sepaMandateRepository.saveAndFlush(sepaMandate);
|
||||
|
||||
// Get all the sepaMandateList where created less than or equals to DEFAULT_CREATED
|
||||
defaultSepaMandateShouldNotBeFound("created.lessThan=" + DEFAULT_CREATED);
|
||||
// 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 created less than or equals to UPDATED_CREATED
|
||||
defaultSepaMandateShouldBeFound("created.lessThan=" + UPDATED_CREATED);
|
||||
// Get all the sepaMandateList where documentDate less than or equals to UPDATED_DOCUMENT_DATE
|
||||
defaultSepaMandateShouldBeFound("documentDate.lessThan=" + UPDATED_DOCUMENT_DATE);
|
||||
}
|
||||
|
||||
|
||||
@@ -547,67 +547,67 @@ public class SepaMandateResourceIntTest {
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSepaMandatesByValidToIsEqualToSomething() throws Exception {
|
||||
public void getAllSepaMandatesByValidUntilIsEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
sepaMandateRepository.saveAndFlush(sepaMandate);
|
||||
|
||||
// Get all the sepaMandateList where validTo equals to DEFAULT_VALID_TO
|
||||
defaultSepaMandateShouldBeFound("validTo.equals=" + DEFAULT_VALID_TO);
|
||||
// Get all the sepaMandateList where validUntil equals to DEFAULT_VALID_UNTIL
|
||||
defaultSepaMandateShouldBeFound("validUntil.equals=" + DEFAULT_VALID_UNTIL);
|
||||
|
||||
// Get all the sepaMandateList where validTo equals to UPDATED_VALID_TO
|
||||
defaultSepaMandateShouldNotBeFound("validTo.equals=" + UPDATED_VALID_TO);
|
||||
// Get all the sepaMandateList where validUntil equals to UPDATED_VALID_UNTIL
|
||||
defaultSepaMandateShouldNotBeFound("validUntil.equals=" + UPDATED_VALID_UNTIL);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSepaMandatesByValidToIsInShouldWork() throws Exception {
|
||||
public void getAllSepaMandatesByValidUntilIsInShouldWork() throws Exception {
|
||||
// Initialize the database
|
||||
sepaMandateRepository.saveAndFlush(sepaMandate);
|
||||
|
||||
// Get all the sepaMandateList where validTo in DEFAULT_VALID_TO or UPDATED_VALID_TO
|
||||
defaultSepaMandateShouldBeFound("validTo.in=" + DEFAULT_VALID_TO + "," + UPDATED_VALID_TO);
|
||||
// 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 validTo equals to UPDATED_VALID_TO
|
||||
defaultSepaMandateShouldNotBeFound("validTo.in=" + UPDATED_VALID_TO);
|
||||
// Get all the sepaMandateList where validUntil equals to UPDATED_VALID_UNTIL
|
||||
defaultSepaMandateShouldNotBeFound("validUntil.in=" + UPDATED_VALID_UNTIL);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSepaMandatesByValidToIsNullOrNotNull() throws Exception {
|
||||
public void getAllSepaMandatesByValidUntilIsNullOrNotNull() throws Exception {
|
||||
// Initialize the database
|
||||
sepaMandateRepository.saveAndFlush(sepaMandate);
|
||||
|
||||
// Get all the sepaMandateList where validTo is not null
|
||||
defaultSepaMandateShouldBeFound("validTo.specified=true");
|
||||
// Get all the sepaMandateList where validUntil is not null
|
||||
defaultSepaMandateShouldBeFound("validUntil.specified=true");
|
||||
|
||||
// Get all the sepaMandateList where validTo is null
|
||||
defaultSepaMandateShouldNotBeFound("validTo.specified=false");
|
||||
// Get all the sepaMandateList where validUntil is null
|
||||
defaultSepaMandateShouldNotBeFound("validUntil.specified=false");
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSepaMandatesByValidToIsGreaterThanOrEqualToSomething() throws Exception {
|
||||
public void getAllSepaMandatesByValidUntilIsGreaterThanOrEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
sepaMandateRepository.saveAndFlush(sepaMandate);
|
||||
|
||||
// Get all the sepaMandateList where validTo greater than or equals to DEFAULT_VALID_TO
|
||||
defaultSepaMandateShouldBeFound("validTo.greaterOrEqualThan=" + DEFAULT_VALID_TO);
|
||||
// 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 validTo greater than or equals to UPDATED_VALID_TO
|
||||
defaultSepaMandateShouldNotBeFound("validTo.greaterOrEqualThan=" + UPDATED_VALID_TO);
|
||||
// Get all the sepaMandateList where validUntil greater than or equals to UPDATED_VALID_UNTIL
|
||||
defaultSepaMandateShouldNotBeFound("validUntil.greaterOrEqualThan=" + UPDATED_VALID_UNTIL);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSepaMandatesByValidToIsLessThanSomething() throws Exception {
|
||||
public void getAllSepaMandatesByValidUntilIsLessThanSomething() throws Exception {
|
||||
// Initialize the database
|
||||
sepaMandateRepository.saveAndFlush(sepaMandate);
|
||||
|
||||
// Get all the sepaMandateList where validTo less than or equals to DEFAULT_VALID_TO
|
||||
defaultSepaMandateShouldNotBeFound("validTo.lessThan=" + DEFAULT_VALID_TO);
|
||||
// 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 validTo less than or equals to UPDATED_VALID_TO
|
||||
defaultSepaMandateShouldBeFound("validTo.lessThan=" + UPDATED_VALID_TO);
|
||||
// Get all the sepaMandateList where validUntil less than or equals to UPDATED_VALID_UNTIL
|
||||
defaultSepaMandateShouldBeFound("validUntil.lessThan=" + UPDATED_VALID_UNTIL);
|
||||
}
|
||||
|
||||
|
||||
@@ -679,107 +679,107 @@ public class SepaMandateResourceIntTest {
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSepaMandatesByCancelledIsEqualToSomething() throws Exception {
|
||||
public void getAllSepaMandatesByCancellationDateIsEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
sepaMandateRepository.saveAndFlush(sepaMandate);
|
||||
|
||||
// Get all the sepaMandateList where cancelled equals to DEFAULT_CANCELLED
|
||||
defaultSepaMandateShouldBeFound("cancelled.equals=" + DEFAULT_CANCELLED);
|
||||
// Get all the sepaMandateList where cancellationDate equals to DEFAULT_CANCELLATION_DATE
|
||||
defaultSepaMandateShouldBeFound("cancellationDate.equals=" + DEFAULT_CANCELLATION_DATE);
|
||||
|
||||
// Get all the sepaMandateList where cancelled equals to UPDATED_CANCELLED
|
||||
defaultSepaMandateShouldNotBeFound("cancelled.equals=" + UPDATED_CANCELLED);
|
||||
// Get all the sepaMandateList where cancellationDate equals to UPDATED_CANCELLATION_DATE
|
||||
defaultSepaMandateShouldNotBeFound("cancellationDate.equals=" + UPDATED_CANCELLATION_DATE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSepaMandatesByCancelledIsInShouldWork() throws Exception {
|
||||
public void getAllSepaMandatesByCancellationDateIsInShouldWork() throws Exception {
|
||||
// Initialize the database
|
||||
sepaMandateRepository.saveAndFlush(sepaMandate);
|
||||
|
||||
// Get all the sepaMandateList where cancelled in DEFAULT_CANCELLED or UPDATED_CANCELLED
|
||||
defaultSepaMandateShouldBeFound("cancelled.in=" + DEFAULT_CANCELLED + "," + UPDATED_CANCELLED);
|
||||
// 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 cancelled equals to UPDATED_CANCELLED
|
||||
defaultSepaMandateShouldNotBeFound("cancelled.in=" + UPDATED_CANCELLED);
|
||||
// Get all the sepaMandateList where cancellationDate equals to UPDATED_CANCELLATION_DATE
|
||||
defaultSepaMandateShouldNotBeFound("cancellationDate.in=" + UPDATED_CANCELLATION_DATE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSepaMandatesByCancelledIsNullOrNotNull() throws Exception {
|
||||
public void getAllSepaMandatesByCancellationDateIsNullOrNotNull() throws Exception {
|
||||
// Initialize the database
|
||||
sepaMandateRepository.saveAndFlush(sepaMandate);
|
||||
|
||||
// Get all the sepaMandateList where cancelled is not null
|
||||
defaultSepaMandateShouldBeFound("cancelled.specified=true");
|
||||
// Get all the sepaMandateList where cancellationDate is not null
|
||||
defaultSepaMandateShouldBeFound("cancellationDate.specified=true");
|
||||
|
||||
// Get all the sepaMandateList where cancelled is null
|
||||
defaultSepaMandateShouldNotBeFound("cancelled.specified=false");
|
||||
// Get all the sepaMandateList where cancellationDate is null
|
||||
defaultSepaMandateShouldNotBeFound("cancellationDate.specified=false");
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSepaMandatesByCancelledIsGreaterThanOrEqualToSomething() throws Exception {
|
||||
public void getAllSepaMandatesByCancellationDateIsGreaterThanOrEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
sepaMandateRepository.saveAndFlush(sepaMandate);
|
||||
|
||||
// Get all the sepaMandateList where cancelled greater than or equals to DEFAULT_CANCELLED
|
||||
defaultSepaMandateShouldBeFound("cancelled.greaterOrEqualThan=" + DEFAULT_CANCELLED);
|
||||
// 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 cancelled greater than or equals to UPDATED_CANCELLED
|
||||
defaultSepaMandateShouldNotBeFound("cancelled.greaterOrEqualThan=" + UPDATED_CANCELLED);
|
||||
// Get all the sepaMandateList where cancellationDate greater than or equals to UPDATED_CANCELLATION_DATE
|
||||
defaultSepaMandateShouldNotBeFound("cancellationDate.greaterOrEqualThan=" + UPDATED_CANCELLATION_DATE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSepaMandatesByCancelledIsLessThanSomething() throws Exception {
|
||||
public void getAllSepaMandatesByCancellationDateIsLessThanSomething() throws Exception {
|
||||
// Initialize the database
|
||||
sepaMandateRepository.saveAndFlush(sepaMandate);
|
||||
|
||||
// Get all the sepaMandateList where cancelled less than or equals to DEFAULT_CANCELLED
|
||||
defaultSepaMandateShouldNotBeFound("cancelled.lessThan=" + DEFAULT_CANCELLED);
|
||||
// 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 cancelled less than or equals to UPDATED_CANCELLED
|
||||
defaultSepaMandateShouldBeFound("cancelled.lessThan=" + UPDATED_CANCELLED);
|
||||
// Get all the sepaMandateList where cancellationDate less than or equals to UPDATED_CANCELLATION_DATE
|
||||
defaultSepaMandateShouldBeFound("cancellationDate.lessThan=" + UPDATED_CANCELLATION_DATE);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSepaMandatesByCommentIsEqualToSomething() throws Exception {
|
||||
public void getAllSepaMandatesByRemarkIsEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
sepaMandateRepository.saveAndFlush(sepaMandate);
|
||||
|
||||
// Get all the sepaMandateList where comment equals to DEFAULT_COMMENT
|
||||
defaultSepaMandateShouldBeFound("comment.equals=" + DEFAULT_COMMENT);
|
||||
// Get all the sepaMandateList where remark equals to DEFAULT_REMARK
|
||||
defaultSepaMandateShouldBeFound("remark.equals=" + DEFAULT_REMARK);
|
||||
|
||||
// Get all the sepaMandateList where comment equals to UPDATED_COMMENT
|
||||
defaultSepaMandateShouldNotBeFound("comment.equals=" + UPDATED_COMMENT);
|
||||
// Get all the sepaMandateList where remark equals to UPDATED_REMARK
|
||||
defaultSepaMandateShouldNotBeFound("remark.equals=" + UPDATED_REMARK);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSepaMandatesByCommentIsInShouldWork() throws Exception {
|
||||
public void getAllSepaMandatesByRemarkIsInShouldWork() throws Exception {
|
||||
// Initialize the database
|
||||
sepaMandateRepository.saveAndFlush(sepaMandate);
|
||||
|
||||
// Get all the sepaMandateList where comment in DEFAULT_COMMENT or UPDATED_COMMENT
|
||||
defaultSepaMandateShouldBeFound("comment.in=" + DEFAULT_COMMENT + "," + UPDATED_COMMENT);
|
||||
// Get all the sepaMandateList where remark in DEFAULT_REMARK or UPDATED_REMARK
|
||||
defaultSepaMandateShouldBeFound("remark.in=" + DEFAULT_REMARK + "," + UPDATED_REMARK);
|
||||
|
||||
// Get all the sepaMandateList where comment equals to UPDATED_COMMENT
|
||||
defaultSepaMandateShouldNotBeFound("comment.in=" + UPDATED_COMMENT);
|
||||
// Get all the sepaMandateList where remark equals to UPDATED_REMARK
|
||||
defaultSepaMandateShouldNotBeFound("remark.in=" + UPDATED_REMARK);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSepaMandatesByCommentIsNullOrNotNull() throws Exception {
|
||||
public void getAllSepaMandatesByRemarkIsNullOrNotNull() throws Exception {
|
||||
// Initialize the database
|
||||
sepaMandateRepository.saveAndFlush(sepaMandate);
|
||||
|
||||
// Get all the sepaMandateList where comment is not null
|
||||
defaultSepaMandateShouldBeFound("comment.specified=true");
|
||||
// Get all the sepaMandateList where remark is not null
|
||||
defaultSepaMandateShouldBeFound("remark.specified=true");
|
||||
|
||||
// Get all the sepaMandateList where comment is null
|
||||
defaultSepaMandateShouldNotBeFound("comment.specified=false");
|
||||
// Get all the sepaMandateList where remark is null
|
||||
defaultSepaMandateShouldNotBeFound("remark.specified=false");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -811,12 +811,12 @@ 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("$.[*].created").value(hasItem(DEFAULT_CREATED.toString())))
|
||||
.andExpect(jsonPath("$.[*].documentDate").value(hasItem(DEFAULT_DOCUMENT_DATE.toString())))
|
||||
.andExpect(jsonPath("$.[*].validFrom").value(hasItem(DEFAULT_VALID_FROM.toString())))
|
||||
.andExpect(jsonPath("$.[*].validTo").value(hasItem(DEFAULT_VALID_TO.toString())))
|
||||
.andExpect(jsonPath("$.[*].validUntil").value(hasItem(DEFAULT_VALID_UNTIL.toString())))
|
||||
.andExpect(jsonPath("$.[*].lastUsed").value(hasItem(DEFAULT_LAST_USED.toString())))
|
||||
.andExpect(jsonPath("$.[*].cancelled").value(hasItem(DEFAULT_CANCELLED.toString())))
|
||||
.andExpect(jsonPath("$.[*].comment").value(hasItem(DEFAULT_COMMENT)));
|
||||
.andExpect(jsonPath("$.[*].cancellationDate").value(hasItem(DEFAULT_CANCELLATION_DATE.toString())))
|
||||
.andExpect(jsonPath("$.[*].remark").value(hasItem(DEFAULT_REMARK)));
|
||||
|
||||
// Check, that the count call also returns 1
|
||||
restSepaMandateMockMvc.perform(get("/api/sepa-mandates/count?sort=id,desc&" + filter))
|
||||
@@ -867,12 +867,12 @@ public class SepaMandateResourceIntTest {
|
||||
.reference(UPDATED_REFERENCE)
|
||||
.iban(UPDATED_IBAN)
|
||||
.bic(UPDATED_BIC)
|
||||
.created(UPDATED_CREATED)
|
||||
.documentDate(UPDATED_DOCUMENT_DATE)
|
||||
.validFrom(UPDATED_VALID_FROM)
|
||||
.validTo(UPDATED_VALID_TO)
|
||||
.validUntil(UPDATED_VALID_UNTIL)
|
||||
.lastUsed(UPDATED_LAST_USED)
|
||||
.cancelled(UPDATED_CANCELLED)
|
||||
.comment(UPDATED_COMMENT);
|
||||
.cancellationDate(UPDATED_CANCELLATION_DATE)
|
||||
.remark(UPDATED_REMARK);
|
||||
SepaMandateDTO sepaMandateDTO = sepaMandateMapper.toDto(updatedSepaMandate);
|
||||
|
||||
restSepaMandateMockMvc.perform(put("/api/sepa-mandates")
|
||||
@@ -887,12 +887,12 @@ public class SepaMandateResourceIntTest {
|
||||
assertThat(testSepaMandate.getReference()).isEqualTo(UPDATED_REFERENCE);
|
||||
assertThat(testSepaMandate.getIban()).isEqualTo(UPDATED_IBAN);
|
||||
assertThat(testSepaMandate.getBic()).isEqualTo(UPDATED_BIC);
|
||||
assertThat(testSepaMandate.getCreated()).isEqualTo(UPDATED_CREATED);
|
||||
assertThat(testSepaMandate.getDocumentDate()).isEqualTo(UPDATED_DOCUMENT_DATE);
|
||||
assertThat(testSepaMandate.getValidFrom()).isEqualTo(UPDATED_VALID_FROM);
|
||||
assertThat(testSepaMandate.getValidTo()).isEqualTo(UPDATED_VALID_TO);
|
||||
assertThat(testSepaMandate.getValidUntil()).isEqualTo(UPDATED_VALID_UNTIL);
|
||||
assertThat(testSepaMandate.getLastUsed()).isEqualTo(UPDATED_LAST_USED);
|
||||
assertThat(testSepaMandate.getCancelled()).isEqualTo(UPDATED_CANCELLED);
|
||||
assertThat(testSepaMandate.getComment()).isEqualTo(UPDATED_COMMENT);
|
||||
assertThat(testSepaMandate.getCancellationDate()).isEqualTo(UPDATED_CANCELLATION_DATE);
|
||||
assertThat(testSepaMandate.getRemark()).isEqualTo(UPDATED_REMARK);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -49,8 +49,11 @@ import org.hostsharing.hsadminng.domain.enumeration.ShareAction;
|
||||
@SpringBootTest(classes = HsadminNgApp.class)
|
||||
public class ShareResourceIntTest {
|
||||
|
||||
private static final LocalDate DEFAULT_DATE = LocalDate.ofEpochDay(0L);
|
||||
private static final LocalDate UPDATED_DATE = LocalDate.now(ZoneId.systemDefault());
|
||||
private static final LocalDate DEFAULT_DOCUMENT_DATE = LocalDate.ofEpochDay(0L);
|
||||
private static final LocalDate UPDATED_DOCUMENT_DATE = LocalDate.now(ZoneId.systemDefault());
|
||||
|
||||
private static final LocalDate DEFAULT_VALUE_DATE = LocalDate.ofEpochDay(0L);
|
||||
private static final LocalDate UPDATED_VALUE_DATE = LocalDate.now(ZoneId.systemDefault());
|
||||
|
||||
private static final ShareAction DEFAULT_ACTION = ShareAction.SUBSCRIPTION;
|
||||
private static final ShareAction UPDATED_ACTION = ShareAction.CANCELLATION;
|
||||
@@ -58,8 +61,8 @@ public class ShareResourceIntTest {
|
||||
private static final Integer DEFAULT_QUANTITY = 1;
|
||||
private static final Integer UPDATED_QUANTITY = 2;
|
||||
|
||||
private static final String DEFAULT_COMMENT = "AAAAAAAAAA";
|
||||
private static final String UPDATED_COMMENT = "BBBBBBBBBB";
|
||||
private static final String DEFAULT_REMARK = "AAAAAAAAAA";
|
||||
private static final String UPDATED_REMARK = "BBBBBBBBBB";
|
||||
|
||||
@Autowired
|
||||
private ShareRepository shareRepository;
|
||||
@@ -112,10 +115,11 @@ public class ShareResourceIntTest {
|
||||
*/
|
||||
public static Share createEntity(EntityManager em) {
|
||||
Share share = new Share()
|
||||
.date(DEFAULT_DATE)
|
||||
.documentDate(DEFAULT_DOCUMENT_DATE)
|
||||
.valueDate(DEFAULT_VALUE_DATE)
|
||||
.action(DEFAULT_ACTION)
|
||||
.quantity(DEFAULT_QUANTITY)
|
||||
.comment(DEFAULT_COMMENT);
|
||||
.remark(DEFAULT_REMARK);
|
||||
// Add required entity
|
||||
Membership membership = MembershipResourceIntTest.createEntity(em);
|
||||
em.persist(membership);
|
||||
@@ -145,10 +149,11 @@ public class ShareResourceIntTest {
|
||||
List<Share> shareList = shareRepository.findAll();
|
||||
assertThat(shareList).hasSize(databaseSizeBeforeCreate + 1);
|
||||
Share testShare = shareList.get(shareList.size() - 1);
|
||||
assertThat(testShare.getDate()).isEqualTo(DEFAULT_DATE);
|
||||
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.getComment()).isEqualTo(DEFAULT_COMMENT);
|
||||
assertThat(testShare.getRemark()).isEqualTo(DEFAULT_REMARK);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -173,10 +178,29 @@ public class ShareResourceIntTest {
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkDateIsRequired() throws Exception {
|
||||
public void checkDocumentDateIsRequired() throws Exception {
|
||||
int databaseSizeBeforeTest = shareRepository.findAll().size();
|
||||
// set the field null
|
||||
share.setDate(null);
|
||||
share.setDocumentDate(null);
|
||||
|
||||
// Create the Share, which fails.
|
||||
ShareDTO shareDTO = shareMapper.toDto(share);
|
||||
|
||||
restShareMockMvc.perform(post("/api/shares")
|
||||
.contentType(TestUtil.APPLICATION_JSON_UTF8)
|
||||
.content(TestUtil.convertObjectToJsonBytes(shareDTO)))
|
||||
.andExpect(status().isBadRequest());
|
||||
|
||||
List<Share> shareList = shareRepository.findAll();
|
||||
assertThat(shareList).hasSize(databaseSizeBeforeTest);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void checkValueDateIsRequired() throws Exception {
|
||||
int databaseSizeBeforeTest = shareRepository.findAll().size();
|
||||
// set the field null
|
||||
share.setValueDate(null);
|
||||
|
||||
// Create the Share, which fails.
|
||||
ShareDTO shareDTO = shareMapper.toDto(share);
|
||||
@@ -239,10 +263,11 @@ public class ShareResourceIntTest {
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
|
||||
.andExpect(jsonPath("$.[*].id").value(hasItem(share.getId().intValue())))
|
||||
.andExpect(jsonPath("$.[*].date").value(hasItem(DEFAULT_DATE.toString())))
|
||||
.andExpect(jsonPath("$.[*].documentDate").value(hasItem(DEFAULT_DOCUMENT_DATE.toString())))
|
||||
.andExpect(jsonPath("$.[*].valueDate").value(hasItem(DEFAULT_VALUE_DATE.toString())))
|
||||
.andExpect(jsonPath("$.[*].action").value(hasItem(DEFAULT_ACTION.toString())))
|
||||
.andExpect(jsonPath("$.[*].quantity").value(hasItem(DEFAULT_QUANTITY)))
|
||||
.andExpect(jsonPath("$.[*].comment").value(hasItem(DEFAULT_COMMENT.toString())));
|
||||
.andExpect(jsonPath("$.[*].remark").value(hasItem(DEFAULT_REMARK.toString())));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -256,75 +281,142 @@ public class ShareResourceIntTest {
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
|
||||
.andExpect(jsonPath("$.id").value(share.getId().intValue()))
|
||||
.andExpect(jsonPath("$.date").value(DEFAULT_DATE.toString()))
|
||||
.andExpect(jsonPath("$.documentDate").value(DEFAULT_DOCUMENT_DATE.toString()))
|
||||
.andExpect(jsonPath("$.valueDate").value(DEFAULT_VALUE_DATE.toString()))
|
||||
.andExpect(jsonPath("$.action").value(DEFAULT_ACTION.toString()))
|
||||
.andExpect(jsonPath("$.quantity").value(DEFAULT_QUANTITY))
|
||||
.andExpect(jsonPath("$.comment").value(DEFAULT_COMMENT.toString()));
|
||||
.andExpect(jsonPath("$.remark").value(DEFAULT_REMARK.toString()));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSharesByDateIsEqualToSomething() throws Exception {
|
||||
public void getAllSharesByDocumentDateIsEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
shareRepository.saveAndFlush(share);
|
||||
|
||||
// Get all the shareList where date equals to DEFAULT_DATE
|
||||
defaultShareShouldBeFound("date.equals=" + DEFAULT_DATE);
|
||||
// Get all the shareList where documentDate equals to DEFAULT_DOCUMENT_DATE
|
||||
defaultShareShouldBeFound("documentDate.equals=" + DEFAULT_DOCUMENT_DATE);
|
||||
|
||||
// Get all the shareList where date equals to UPDATED_DATE
|
||||
defaultShareShouldNotBeFound("date.equals=" + UPDATED_DATE);
|
||||
// Get all the shareList where documentDate equals to UPDATED_DOCUMENT_DATE
|
||||
defaultShareShouldNotBeFound("documentDate.equals=" + UPDATED_DOCUMENT_DATE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSharesByDateIsInShouldWork() throws Exception {
|
||||
public void getAllSharesByDocumentDateIsInShouldWork() throws Exception {
|
||||
// Initialize the database
|
||||
shareRepository.saveAndFlush(share);
|
||||
|
||||
// Get all the shareList where date in DEFAULT_DATE or UPDATED_DATE
|
||||
defaultShareShouldBeFound("date.in=" + DEFAULT_DATE + "," + UPDATED_DATE);
|
||||
// Get all the shareList where documentDate in DEFAULT_DOCUMENT_DATE or UPDATED_DOCUMENT_DATE
|
||||
defaultShareShouldBeFound("documentDate.in=" + DEFAULT_DOCUMENT_DATE + "," + UPDATED_DOCUMENT_DATE);
|
||||
|
||||
// Get all the shareList where date equals to UPDATED_DATE
|
||||
defaultShareShouldNotBeFound("date.in=" + UPDATED_DATE);
|
||||
// Get all the shareList where documentDate equals to UPDATED_DOCUMENT_DATE
|
||||
defaultShareShouldNotBeFound("documentDate.in=" + UPDATED_DOCUMENT_DATE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSharesByDateIsNullOrNotNull() throws Exception {
|
||||
public void getAllSharesByDocumentDateIsNullOrNotNull() throws Exception {
|
||||
// Initialize the database
|
||||
shareRepository.saveAndFlush(share);
|
||||
|
||||
// Get all the shareList where date is not null
|
||||
defaultShareShouldBeFound("date.specified=true");
|
||||
// Get all the shareList where documentDate is not null
|
||||
defaultShareShouldBeFound("documentDate.specified=true");
|
||||
|
||||
// Get all the shareList where date is null
|
||||
defaultShareShouldNotBeFound("date.specified=false");
|
||||
// Get all the shareList where documentDate is null
|
||||
defaultShareShouldNotBeFound("documentDate.specified=false");
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSharesByDateIsGreaterThanOrEqualToSomething() throws Exception {
|
||||
public void getAllSharesByDocumentDateIsGreaterThanOrEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
shareRepository.saveAndFlush(share);
|
||||
|
||||
// Get all the shareList where date greater than or equals to DEFAULT_DATE
|
||||
defaultShareShouldBeFound("date.greaterOrEqualThan=" + DEFAULT_DATE);
|
||||
// Get all the shareList where documentDate greater than or equals to DEFAULT_DOCUMENT_DATE
|
||||
defaultShareShouldBeFound("documentDate.greaterOrEqualThan=" + DEFAULT_DOCUMENT_DATE);
|
||||
|
||||
// Get all the shareList where date greater than or equals to UPDATED_DATE
|
||||
defaultShareShouldNotBeFound("date.greaterOrEqualThan=" + UPDATED_DATE);
|
||||
// Get all the shareList where documentDate greater than or equals to UPDATED_DOCUMENT_DATE
|
||||
defaultShareShouldNotBeFound("documentDate.greaterOrEqualThan=" + UPDATED_DOCUMENT_DATE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSharesByDateIsLessThanSomething() throws Exception {
|
||||
public void getAllSharesByDocumentDateIsLessThanSomething() throws Exception {
|
||||
// Initialize the database
|
||||
shareRepository.saveAndFlush(share);
|
||||
|
||||
// Get all the shareList where date less than or equals to DEFAULT_DATE
|
||||
defaultShareShouldNotBeFound("date.lessThan=" + DEFAULT_DATE);
|
||||
// Get all the shareList where documentDate less than or equals to DEFAULT_DOCUMENT_DATE
|
||||
defaultShareShouldNotBeFound("documentDate.lessThan=" + DEFAULT_DOCUMENT_DATE);
|
||||
|
||||
// Get all the shareList where date less than or equals to UPDATED_DATE
|
||||
defaultShareShouldBeFound("date.lessThan=" + UPDATED_DATE);
|
||||
// Get all the shareList where documentDate less than or equals to UPDATED_DOCUMENT_DATE
|
||||
defaultShareShouldBeFound("documentDate.lessThan=" + UPDATED_DOCUMENT_DATE);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSharesByValueDateIsEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
shareRepository.saveAndFlush(share);
|
||||
|
||||
// Get all the shareList where valueDate equals to DEFAULT_VALUE_DATE
|
||||
defaultShareShouldBeFound("valueDate.equals=" + DEFAULT_VALUE_DATE);
|
||||
|
||||
// Get all the shareList where valueDate equals to UPDATED_VALUE_DATE
|
||||
defaultShareShouldNotBeFound("valueDate.equals=" + UPDATED_VALUE_DATE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSharesByValueDateIsInShouldWork() throws Exception {
|
||||
// Initialize the database
|
||||
shareRepository.saveAndFlush(share);
|
||||
|
||||
// Get all the shareList where valueDate in DEFAULT_VALUE_DATE or UPDATED_VALUE_DATE
|
||||
defaultShareShouldBeFound("valueDate.in=" + DEFAULT_VALUE_DATE + "," + UPDATED_VALUE_DATE);
|
||||
|
||||
// Get all the shareList where valueDate equals to UPDATED_VALUE_DATE
|
||||
defaultShareShouldNotBeFound("valueDate.in=" + UPDATED_VALUE_DATE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSharesByValueDateIsNullOrNotNull() throws Exception {
|
||||
// Initialize the database
|
||||
shareRepository.saveAndFlush(share);
|
||||
|
||||
// Get all the shareList where valueDate is not null
|
||||
defaultShareShouldBeFound("valueDate.specified=true");
|
||||
|
||||
// Get all the shareList where valueDate is null
|
||||
defaultShareShouldNotBeFound("valueDate.specified=false");
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSharesByValueDateIsGreaterThanOrEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
shareRepository.saveAndFlush(share);
|
||||
|
||||
// Get all the shareList where valueDate greater than or equals to DEFAULT_VALUE_DATE
|
||||
defaultShareShouldBeFound("valueDate.greaterOrEqualThan=" + DEFAULT_VALUE_DATE);
|
||||
|
||||
// Get all the shareList where valueDate greater than or equals to UPDATED_VALUE_DATE
|
||||
defaultShareShouldNotBeFound("valueDate.greaterOrEqualThan=" + UPDATED_VALUE_DATE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSharesByValueDateIsLessThanSomething() throws Exception {
|
||||
// Initialize the database
|
||||
shareRepository.saveAndFlush(share);
|
||||
|
||||
// Get all the shareList where valueDate less than or equals to DEFAULT_VALUE_DATE
|
||||
defaultShareShouldNotBeFound("valueDate.lessThan=" + DEFAULT_VALUE_DATE);
|
||||
|
||||
// Get all the shareList where valueDate less than or equals to UPDATED_VALUE_DATE
|
||||
defaultShareShouldBeFound("valueDate.lessThan=" + UPDATED_VALUE_DATE);
|
||||
}
|
||||
|
||||
|
||||
@@ -435,41 +527,41 @@ public class ShareResourceIntTest {
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSharesByCommentIsEqualToSomething() throws Exception {
|
||||
public void getAllSharesByRemarkIsEqualToSomething() throws Exception {
|
||||
// Initialize the database
|
||||
shareRepository.saveAndFlush(share);
|
||||
|
||||
// Get all the shareList where comment equals to DEFAULT_COMMENT
|
||||
defaultShareShouldBeFound("comment.equals=" + DEFAULT_COMMENT);
|
||||
// Get all the shareList where remark equals to DEFAULT_REMARK
|
||||
defaultShareShouldBeFound("remark.equals=" + DEFAULT_REMARK);
|
||||
|
||||
// Get all the shareList where comment equals to UPDATED_COMMENT
|
||||
defaultShareShouldNotBeFound("comment.equals=" + UPDATED_COMMENT);
|
||||
// Get all the shareList where remark equals to UPDATED_REMARK
|
||||
defaultShareShouldNotBeFound("remark.equals=" + UPDATED_REMARK);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSharesByCommentIsInShouldWork() throws Exception {
|
||||
public void getAllSharesByRemarkIsInShouldWork() throws Exception {
|
||||
// Initialize the database
|
||||
shareRepository.saveAndFlush(share);
|
||||
|
||||
// Get all the shareList where comment in DEFAULT_COMMENT or UPDATED_COMMENT
|
||||
defaultShareShouldBeFound("comment.in=" + DEFAULT_COMMENT + "," + UPDATED_COMMENT);
|
||||
// Get all the shareList where remark in DEFAULT_REMARK or UPDATED_REMARK
|
||||
defaultShareShouldBeFound("remark.in=" + DEFAULT_REMARK + "," + UPDATED_REMARK);
|
||||
|
||||
// Get all the shareList where comment equals to UPDATED_COMMENT
|
||||
defaultShareShouldNotBeFound("comment.in=" + UPDATED_COMMENT);
|
||||
// Get all the shareList where remark equals to UPDATED_REMARK
|
||||
defaultShareShouldNotBeFound("remark.in=" + UPDATED_REMARK);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void getAllSharesByCommentIsNullOrNotNull() throws Exception {
|
||||
public void getAllSharesByRemarkIsNullOrNotNull() throws Exception {
|
||||
// Initialize the database
|
||||
shareRepository.saveAndFlush(share);
|
||||
|
||||
// Get all the shareList where comment is not null
|
||||
defaultShareShouldBeFound("comment.specified=true");
|
||||
// Get all the shareList where remark is not null
|
||||
defaultShareShouldBeFound("remark.specified=true");
|
||||
|
||||
// Get all the shareList where comment is null
|
||||
defaultShareShouldNotBeFound("comment.specified=false");
|
||||
// Get all the shareList where remark is null
|
||||
defaultShareShouldNotBeFound("remark.specified=false");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -498,10 +590,11 @@ public class ShareResourceIntTest {
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
|
||||
.andExpect(jsonPath("$.[*].id").value(hasItem(share.getId().intValue())))
|
||||
.andExpect(jsonPath("$.[*].date").value(hasItem(DEFAULT_DATE.toString())))
|
||||
.andExpect(jsonPath("$.[*].documentDate").value(hasItem(DEFAULT_DOCUMENT_DATE.toString())))
|
||||
.andExpect(jsonPath("$.[*].valueDate").value(hasItem(DEFAULT_VALUE_DATE.toString())))
|
||||
.andExpect(jsonPath("$.[*].action").value(hasItem(DEFAULT_ACTION.toString())))
|
||||
.andExpect(jsonPath("$.[*].quantity").value(hasItem(DEFAULT_QUANTITY)))
|
||||
.andExpect(jsonPath("$.[*].comment").value(hasItem(DEFAULT_COMMENT)));
|
||||
.andExpect(jsonPath("$.[*].remark").value(hasItem(DEFAULT_REMARK)));
|
||||
|
||||
// Check, that the count call also returns 1
|
||||
restShareMockMvc.perform(get("/api/shares/count?sort=id,desc&" + filter))
|
||||
@@ -549,10 +642,11 @@ public class ShareResourceIntTest {
|
||||
// Disconnect from session so that the updates on updatedShare are not directly saved in db
|
||||
em.detach(updatedShare);
|
||||
updatedShare
|
||||
.date(UPDATED_DATE)
|
||||
.documentDate(UPDATED_DOCUMENT_DATE)
|
||||
.valueDate(UPDATED_VALUE_DATE)
|
||||
.action(UPDATED_ACTION)
|
||||
.quantity(UPDATED_QUANTITY)
|
||||
.comment(UPDATED_COMMENT);
|
||||
.remark(UPDATED_REMARK);
|
||||
ShareDTO shareDTO = shareMapper.toDto(updatedShare);
|
||||
|
||||
restShareMockMvc.perform(put("/api/shares")
|
||||
@@ -564,10 +658,11 @@ public class ShareResourceIntTest {
|
||||
List<Share> shareList = shareRepository.findAll();
|
||||
assertThat(shareList).hasSize(databaseSizeBeforeUpdate);
|
||||
Share testShare = shareList.get(shareList.size() - 1);
|
||||
assertThat(testShare.getDate()).isEqualTo(UPDATED_DATE);
|
||||
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.getComment()).isEqualTo(UPDATED_COMMENT);
|
||||
assertThat(testShare.getRemark()).isEqualTo(UPDATED_REMARK);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user