Model customers.
This commit is contained in:
		@@ -1,15 +1,17 @@
 | 
			
		||||
package org.hostsharing.hsadminng.web.rest;
 | 
			
		||||
 | 
			
		||||
import org.hostsharing.hsadminng.HsadminNgApp;
 | 
			
		||||
 | 
			
		||||
import org.hostsharing.hsadminng.domain.Asset;
 | 
			
		||||
import org.hostsharing.hsadminng.domain.Membership;
 | 
			
		||||
import org.hostsharing.hsadminng.domain.enumeration.AssetAction;
 | 
			
		||||
import org.hostsharing.hsadminng.repository.AssetRepository;
 | 
			
		||||
import org.hostsharing.hsadminng.service.AssetQueryService;
 | 
			
		||||
import org.hostsharing.hsadminng.service.AssetService;
 | 
			
		||||
import org.hostsharing.hsadminng.service.dto.AssetDTO;
 | 
			
		||||
import org.hostsharing.hsadminng.service.mapper.AssetMapper;
 | 
			
		||||
import org.hostsharing.hsadminng.web.rest.errors.ExceptionTranslator;
 | 
			
		||||
import org.hostsharing.hsadminng.service.dto.AssetCriteria;
 | 
			
		||||
import org.hostsharing.hsadminng.service.AssetQueryService;
 | 
			
		||||
 | 
			
		||||
import org.junit.Before;
 | 
			
		||||
import org.junit.Test;
 | 
			
		||||
import org.junit.runner.RunWith;
 | 
			
		||||
@@ -31,11 +33,14 @@ import java.time.LocalDate;
 | 
			
		||||
import java.time.ZoneId;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
import static org.hostsharing.hsadminng.web.rest.TestUtil.createFormattingConversionService;
 | 
			
		||||
import static org.assertj.core.api.Assertions.assertThat;
 | 
			
		||||
import static org.hamcrest.Matchers.hasItem;
 | 
			
		||||
import static org.hostsharing.hsadminng.web.rest.TestUtil.createFormattingConversionService;
 | 
			
		||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
 | 
			
		||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
 | 
			
		||||
 | 
			
		||||
import org.hostsharing.hsadminng.domain.enumeration.AssetAction;
 | 
			
		||||
/**
 | 
			
		||||
 * Test class for the AssetResource REST controller.
 | 
			
		||||
 *
 | 
			
		||||
@@ -45,8 +50,11 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
 | 
			
		||||
@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;
 | 
			
		||||
@@ -54,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;
 | 
			
		||||
@@ -108,15 +116,16 @@ 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);
 | 
			
		||||
        em.flush();
 | 
			
		||||
        asset.setMember(membership);
 | 
			
		||||
        asset.setMembership(membership);
 | 
			
		||||
        return asset;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -141,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
 | 
			
		||||
@@ -169,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);
 | 
			
		||||
@@ -235,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
 | 
			
		||||
@@ -252,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);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -404,59 +501,59 @@ 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
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllAssetsByMemberIsEqualToSomething() throws Exception {
 | 
			
		||||
    public void getAllAssetsByMembershipIsEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        Membership member = MembershipResourceIntTest.createEntity(em);
 | 
			
		||||
        em.persist(member);
 | 
			
		||||
        Membership membership = MembershipResourceIntTest.createEntity(em);
 | 
			
		||||
        em.persist(membership);
 | 
			
		||||
        em.flush();
 | 
			
		||||
        asset.setMember(member);
 | 
			
		||||
        asset.setMembership(membership);
 | 
			
		||||
        assetRepository.saveAndFlush(asset);
 | 
			
		||||
        Long memberId = member.getId();
 | 
			
		||||
        Long membershipId = membership.getId();
 | 
			
		||||
 | 
			
		||||
        // Get all the assetList where member equals to memberId
 | 
			
		||||
        defaultAssetShouldBeFound("memberId.equals=" + memberId);
 | 
			
		||||
        // Get all the assetList where membership equals to membershipId
 | 
			
		||||
        defaultAssetShouldBeFound("membershipId.equals=" + membershipId);
 | 
			
		||||
 | 
			
		||||
        // Get all the assetList where member equals to memberId + 1
 | 
			
		||||
        defaultAssetShouldNotBeFound("memberId.equals=" + (memberId + 1));
 | 
			
		||||
        // Get all the assetList where membership equals to membershipId + 1
 | 
			
		||||
        defaultAssetShouldNotBeFound("membershipId.equals=" + (membershipId + 1));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -467,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))
 | 
			
		||||
@@ -518,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")
 | 
			
		||||
@@ -533,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
 | 
			
		||||
 
 | 
			
		||||
@@ -1,15 +1,18 @@
 | 
			
		||||
package org.hostsharing.hsadminng.web.rest;
 | 
			
		||||
 | 
			
		||||
import org.hostsharing.hsadminng.HsadminNgApp;
 | 
			
		||||
 | 
			
		||||
import org.hostsharing.hsadminng.domain.Customer;
 | 
			
		||||
import org.hostsharing.hsadminng.domain.CustomerContact;
 | 
			
		||||
import org.hostsharing.hsadminng.domain.Membership;
 | 
			
		||||
import org.hostsharing.hsadminng.domain.SepaMandate;
 | 
			
		||||
import org.hostsharing.hsadminng.repository.CustomerRepository;
 | 
			
		||||
import org.hostsharing.hsadminng.service.CustomerQueryService;
 | 
			
		||||
import org.hostsharing.hsadminng.service.CustomerService;
 | 
			
		||||
import org.hostsharing.hsadminng.service.dto.CustomerDTO;
 | 
			
		||||
import org.hostsharing.hsadminng.service.mapper.CustomerMapper;
 | 
			
		||||
import org.hostsharing.hsadminng.web.rest.errors.ExceptionTranslator;
 | 
			
		||||
import org.hostsharing.hsadminng.service.dto.CustomerCriteria;
 | 
			
		||||
import org.hostsharing.hsadminng.service.CustomerQueryService;
 | 
			
		||||
 | 
			
		||||
import org.junit.Before;
 | 
			
		||||
import org.junit.Test;
 | 
			
		||||
import org.junit.runner.RunWith;
 | 
			
		||||
@@ -28,9 +31,10 @@ import org.springframework.validation.Validator;
 | 
			
		||||
import javax.persistence.EntityManager;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
import static org.hostsharing.hsadminng.web.rest.TestUtil.createFormattingConversionService;
 | 
			
		||||
import static org.assertj.core.api.Assertions.assertThat;
 | 
			
		||||
import static org.hamcrest.Matchers.hasItem;
 | 
			
		||||
import static org.hostsharing.hsadminng.web.rest.TestUtil.createFormattingConversionService;
 | 
			
		||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
 | 
			
		||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
 | 
			
		||||
 | 
			
		||||
@@ -43,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 = "lzv";
 | 
			
		||||
    private static final String UPDATED_PREFIX = "zf";
 | 
			
		||||
@@ -52,17 +56,20 @@ public class CustomerResourceIntTest {
 | 
			
		||||
    private static final String DEFAULT_NAME = "AAAAAAAAAA";
 | 
			
		||||
    private static final String UPDATED_NAME = "BBBBBBBBBB";
 | 
			
		||||
 | 
			
		||||
    private static final String DEFAULT_CONTRACTUAL_SALUTATION = "AAAAAAAAAA";
 | 
			
		||||
    private static final String UPDATED_CONTRACTUAL_SALUTATION = "BBBBBBBBBB";
 | 
			
		||||
 | 
			
		||||
    private static final String DEFAULT_CONTRACTUAL_ADDRESS = "AAAAAAAAAA";
 | 
			
		||||
    private static final String UPDATED_CONTRACTUAL_ADDRESS = "BBBBBBBBBB";
 | 
			
		||||
 | 
			
		||||
    private static final String DEFAULT_CONTRACTUAL_SALUTATION = "AAAAAAAAAA";
 | 
			
		||||
    private static final String UPDATED_CONTRACTUAL_SALUTATION = "BBBBBBBBBB";
 | 
			
		||||
    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";
 | 
			
		||||
 | 
			
		||||
    private static final String DEFAULT_BILLING_SALUTATION = "AAAAAAAAAA";
 | 
			
		||||
    private static final String UPDATED_BILLING_SALUTATION = "BBBBBBBBBB";
 | 
			
		||||
    private static final String DEFAULT_REMARK = "AAAAAAAAAA";
 | 
			
		||||
    private static final String UPDATED_REMARK = "BBBBBBBBBB";
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private CustomerRepository customerRepository;
 | 
			
		||||
@@ -115,13 +122,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)
 | 
			
		||||
            .contractualAddress(DEFAULT_CONTRACTUAL_ADDRESS)
 | 
			
		||||
            .contractualSalutation(DEFAULT_CONTRACTUAL_SALUTATION)
 | 
			
		||||
            .contractualAddress(DEFAULT_CONTRACTUAL_ADDRESS)
 | 
			
		||||
            .billingSalutation(DEFAULT_BILLING_SALUTATION)
 | 
			
		||||
            .billingAddress(DEFAULT_BILLING_ADDRESS)
 | 
			
		||||
            .billingSalutation(DEFAULT_BILLING_SALUTATION);
 | 
			
		||||
            .remark(DEFAULT_REMARK);
 | 
			
		||||
        return customer;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -146,13 +154,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.getContractualAddress()).isEqualTo(DEFAULT_CONTRACTUAL_ADDRESS);
 | 
			
		||||
        assertThat(testCustomer.getContractualSalutation()).isEqualTo(DEFAULT_CONTRACTUAL_SALUTATION);
 | 
			
		||||
        assertThat(testCustomer.getBillingAddress()).isEqualTo(DEFAULT_BILLING_ADDRESS);
 | 
			
		||||
        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
 | 
			
		||||
@@ -177,10 +186,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);
 | 
			
		||||
@@ -262,13 +271,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("$.[*].contractualAddress").value(hasItem(DEFAULT_CONTRACTUAL_ADDRESS.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("$.[*].billingSalutation").value(hasItem(DEFAULT_BILLING_SALUTATION.toString())));
 | 
			
		||||
            .andExpect(jsonPath("$.[*].remark").value(hasItem(DEFAULT_REMARK.toString())));
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    @Test
 | 
			
		||||
@@ -282,78 +292,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("$.contractualAddress").value(DEFAULT_CONTRACTUAL_ADDRESS.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("$.billingSalutation").value(DEFAULT_BILLING_SALUTATION.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));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -435,45 +446,6 @@ public class CustomerResourceIntTest {
 | 
			
		||||
        defaultCustomerShouldNotBeFound("name.specified=false");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllCustomersByContractualAddressIsEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        customerRepository.saveAndFlush(customer);
 | 
			
		||||
 | 
			
		||||
        // Get all the customerList where contractualAddress equals to DEFAULT_CONTRACTUAL_ADDRESS
 | 
			
		||||
        defaultCustomerShouldBeFound("contractualAddress.equals=" + DEFAULT_CONTRACTUAL_ADDRESS);
 | 
			
		||||
 | 
			
		||||
        // Get all the customerList where contractualAddress equals to UPDATED_CONTRACTUAL_ADDRESS
 | 
			
		||||
        defaultCustomerShouldNotBeFound("contractualAddress.equals=" + UPDATED_CONTRACTUAL_ADDRESS);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllCustomersByContractualAddressIsInShouldWork() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        customerRepository.saveAndFlush(customer);
 | 
			
		||||
 | 
			
		||||
        // 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 contractualAddress equals to UPDATED_CONTRACTUAL_ADDRESS
 | 
			
		||||
        defaultCustomerShouldNotBeFound("contractualAddress.in=" + UPDATED_CONTRACTUAL_ADDRESS);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllCustomersByContractualAddressIsNullOrNotNull() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        customerRepository.saveAndFlush(customer);
 | 
			
		||||
 | 
			
		||||
        // Get all the customerList where contractualAddress is not null
 | 
			
		||||
        defaultCustomerShouldBeFound("contractualAddress.specified=true");
 | 
			
		||||
 | 
			
		||||
        // Get all the customerList where contractualAddress is null
 | 
			
		||||
        defaultCustomerShouldNotBeFound("contractualAddress.specified=false");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllCustomersByContractualSalutationIsEqualToSomething() throws Exception {
 | 
			
		||||
@@ -515,41 +487,41 @@ 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
 | 
			
		||||
@@ -593,22 +565,81 @@ public class CustomerResourceIntTest {
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllCustomersByRoleIsEqualToSomething() throws Exception {
 | 
			
		||||
    public void getAllCustomersByBillingAddressIsEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        CustomerContact role = CustomerContactResourceIntTest.createEntity(em);
 | 
			
		||||
        em.persist(role);
 | 
			
		||||
        em.flush();
 | 
			
		||||
        customer.addRole(role);
 | 
			
		||||
        customerRepository.saveAndFlush(customer);
 | 
			
		||||
        Long roleId = role.getId();
 | 
			
		||||
 | 
			
		||||
        // Get all the customerList where role equals to roleId
 | 
			
		||||
        defaultCustomerShouldBeFound("roleId.equals=" + roleId);
 | 
			
		||||
        // Get all the customerList where billingAddress equals to DEFAULT_BILLING_ADDRESS
 | 
			
		||||
        defaultCustomerShouldBeFound("billingAddress.equals=" + DEFAULT_BILLING_ADDRESS);
 | 
			
		||||
 | 
			
		||||
        // Get all the customerList where role equals to roleId + 1
 | 
			
		||||
        defaultCustomerShouldNotBeFound("roleId.equals=" + (roleId + 1));
 | 
			
		||||
        // Get all the customerList where billingAddress equals to UPDATED_BILLING_ADDRESS
 | 
			
		||||
        defaultCustomerShouldNotBeFound("billingAddress.equals=" + UPDATED_BILLING_ADDRESS);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllCustomersByBillingAddressIsInShouldWork() 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 billingAddress equals to UPDATED_BILLING_ADDRESS
 | 
			
		||||
        defaultCustomerShouldNotBeFound("billingAddress.in=" + UPDATED_BILLING_ADDRESS);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllCustomersByBillingAddressIsNullOrNotNull() 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 billingAddress is null
 | 
			
		||||
        defaultCustomerShouldNotBeFound("billingAddress.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
 | 
			
		||||
    @Transactional
 | 
			
		||||
@@ -628,6 +659,25 @@ public class CustomerResourceIntTest {
 | 
			
		||||
        defaultCustomerShouldNotBeFound("membershipId.equals=" + (membershipId + 1));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllCustomersBySepamandateIsEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        SepaMandate sepamandate = SepaMandateResourceIntTest.createEntity(em);
 | 
			
		||||
        em.persist(sepamandate);
 | 
			
		||||
        em.flush();
 | 
			
		||||
        customer.addSepamandate(sepamandate);
 | 
			
		||||
        customerRepository.saveAndFlush(customer);
 | 
			
		||||
        Long sepamandateId = sepamandate.getId();
 | 
			
		||||
 | 
			
		||||
        // Get all the customerList where sepamandate equals to sepamandateId
 | 
			
		||||
        defaultCustomerShouldBeFound("sepamandateId.equals=" + sepamandateId);
 | 
			
		||||
 | 
			
		||||
        // Get all the customerList where sepamandate equals to sepamandateId + 1
 | 
			
		||||
        defaultCustomerShouldNotBeFound("sepamandateId.equals=" + (sepamandateId + 1));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Executes the search, and checks that the default entity is returned
 | 
			
		||||
     */
 | 
			
		||||
@@ -636,13 +686,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("$.[*].contractualAddress").value(hasItem(DEFAULT_CONTRACTUAL_ADDRESS)))
 | 
			
		||||
            .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("$.[*].billingSalutation").value(hasItem(DEFAULT_BILLING_SALUTATION)));
 | 
			
		||||
            .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))
 | 
			
		||||
@@ -690,13 +741,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)
 | 
			
		||||
            .contractualAddress(UPDATED_CONTRACTUAL_ADDRESS)
 | 
			
		||||
            .contractualSalutation(UPDATED_CONTRACTUAL_SALUTATION)
 | 
			
		||||
            .contractualAddress(UPDATED_CONTRACTUAL_ADDRESS)
 | 
			
		||||
            .billingSalutation(UPDATED_BILLING_SALUTATION)
 | 
			
		||||
            .billingAddress(UPDATED_BILLING_ADDRESS)
 | 
			
		||||
            .billingSalutation(UPDATED_BILLING_SALUTATION);
 | 
			
		||||
            .remark(UPDATED_REMARK);
 | 
			
		||||
        CustomerDTO customerDTO = customerMapper.toDto(updatedCustomer);
 | 
			
		||||
 | 
			
		||||
        restCustomerMockMvc.perform(put("/api/customers")
 | 
			
		||||
@@ -708,13 +760,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.getContractualAddress()).isEqualTo(UPDATED_CONTRACTUAL_ADDRESS);
 | 
			
		||||
        assertThat(testCustomer.getContractualSalutation()).isEqualTo(UPDATED_CONTRACTUAL_SALUTATION);
 | 
			
		||||
        assertThat(testCustomer.getBillingAddress()).isEqualTo(UPDATED_BILLING_ADDRESS);
 | 
			
		||||
        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
 | 
			
		||||
 
 | 
			
		||||
@@ -1,16 +1,19 @@
 | 
			
		||||
package org.hostsharing.hsadminng.web.rest;
 | 
			
		||||
 | 
			
		||||
import org.hostsharing.hsadminng.HsadminNgApp;
 | 
			
		||||
import org.hostsharing.hsadminng.domain.Asset;
 | 
			
		||||
import org.hostsharing.hsadminng.domain.Customer;
 | 
			
		||||
 | 
			
		||||
import org.hostsharing.hsadminng.domain.Membership;
 | 
			
		||||
import org.hostsharing.hsadminng.domain.Share;
 | 
			
		||||
import org.hostsharing.hsadminng.domain.Asset;
 | 
			
		||||
import org.hostsharing.hsadminng.domain.Customer;
 | 
			
		||||
import org.hostsharing.hsadminng.repository.MembershipRepository;
 | 
			
		||||
import org.hostsharing.hsadminng.service.MembershipQueryService;
 | 
			
		||||
import org.hostsharing.hsadminng.service.MembershipService;
 | 
			
		||||
import org.hostsharing.hsadminng.service.dto.MembershipDTO;
 | 
			
		||||
import org.hostsharing.hsadminng.service.mapper.MembershipMapper;
 | 
			
		||||
import org.hostsharing.hsadminng.web.rest.errors.ExceptionTranslator;
 | 
			
		||||
import org.hostsharing.hsadminng.service.dto.MembershipCriteria;
 | 
			
		||||
import org.hostsharing.hsadminng.service.MembershipQueryService;
 | 
			
		||||
 | 
			
		||||
import org.junit.Before;
 | 
			
		||||
import org.junit.Test;
 | 
			
		||||
import org.junit.runner.RunWith;
 | 
			
		||||
@@ -31,9 +34,10 @@ import java.time.LocalDate;
 | 
			
		||||
import java.time.ZoneId;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
import static org.hostsharing.hsadminng.web.rest.TestUtil.createFormattingConversionService;
 | 
			
		||||
import static org.assertj.core.api.Assertions.assertThat;
 | 
			
		||||
import static org.hamcrest.Matchers.hasItem;
 | 
			
		||||
import static org.hostsharing.hsadminng.web.rest.TestUtil.createFormattingConversionService;
 | 
			
		||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
 | 
			
		||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
 | 
			
		||||
 | 
			
		||||
@@ -46,11 +50,17 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
 | 
			
		||||
@SpringBootTest(classes = HsadminNgApp.class)
 | 
			
		||||
public class MembershipResourceIntTest {
 | 
			
		||||
 | 
			
		||||
    private static final LocalDate DEFAULT_SINCE_DATE = LocalDate.ofEpochDay(0L);
 | 
			
		||||
    private static final LocalDate UPDATED_SINCE_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_UNTIL_DATE = LocalDate.ofEpochDay(0L);
 | 
			
		||||
    private static final LocalDate UPDATED_UNTIL_DATE = 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 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;
 | 
			
		||||
@@ -103,8 +113,10 @@ public class MembershipResourceIntTest {
 | 
			
		||||
     */
 | 
			
		||||
    public static Membership createEntity(EntityManager em) {
 | 
			
		||||
        Membership membership = new Membership()
 | 
			
		||||
            .sinceDate(DEFAULT_SINCE_DATE)
 | 
			
		||||
            .untilDate(DEFAULT_UNTIL_DATE);
 | 
			
		||||
            .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);
 | 
			
		||||
@@ -134,8 +146,10 @@ public class MembershipResourceIntTest {
 | 
			
		||||
        List<Membership> membershipList = membershipRepository.findAll();
 | 
			
		||||
        assertThat(membershipList).hasSize(databaseSizeBeforeCreate + 1);
 | 
			
		||||
        Membership testMembership = membershipList.get(membershipList.size() - 1);
 | 
			
		||||
        assertThat(testMembership.getSinceDate()).isEqualTo(DEFAULT_SINCE_DATE);
 | 
			
		||||
        assertThat(testMembership.getUntilDate()).isEqualTo(DEFAULT_UNTIL_DATE);
 | 
			
		||||
        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
 | 
			
		||||
@@ -160,10 +174,29 @@ public class MembershipResourceIntTest {
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void checkSinceDateIsRequired() throws Exception {
 | 
			
		||||
    public void checkDocumentDateIsRequired() throws Exception {
 | 
			
		||||
        int databaseSizeBeforeTest = membershipRepository.findAll().size();
 | 
			
		||||
        // set the field null
 | 
			
		||||
        membership.setSinceDate(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);
 | 
			
		||||
@@ -188,8 +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("$.[*].sinceDate").value(hasItem(DEFAULT_SINCE_DATE.toString())))
 | 
			
		||||
            .andExpect(jsonPath("$.[*].untilDate").value(hasItem(DEFAULT_UNTIL_DATE.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
 | 
			
		||||
@@ -203,142 +238,249 @@ public class MembershipResourceIntTest {
 | 
			
		||||
            .andExpect(status().isOk())
 | 
			
		||||
            .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
 | 
			
		||||
            .andExpect(jsonPath("$.id").value(membership.getId().intValue()))
 | 
			
		||||
            .andExpect(jsonPath("$.sinceDate").value(DEFAULT_SINCE_DATE.toString()))
 | 
			
		||||
            .andExpect(jsonPath("$.untilDate").value(DEFAULT_UNTIL_DATE.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 getAllMembershipsBySinceDateIsEqualToSomething() throws Exception {
 | 
			
		||||
    public void getAllMembershipsByDocumentDateIsEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        membershipRepository.saveAndFlush(membership);
 | 
			
		||||
 | 
			
		||||
        // Get all the membershipList where sinceDate equals to DEFAULT_SINCE_DATE
 | 
			
		||||
        defaultMembershipShouldBeFound("sinceDate.equals=" + DEFAULT_SINCE_DATE);
 | 
			
		||||
        // Get all the membershipList where documentDate equals to DEFAULT_DOCUMENT_DATE
 | 
			
		||||
        defaultMembershipShouldBeFound("documentDate.equals=" + DEFAULT_DOCUMENT_DATE);
 | 
			
		||||
 | 
			
		||||
        // Get all the membershipList where sinceDate equals to UPDATED_SINCE_DATE
 | 
			
		||||
        defaultMembershipShouldNotBeFound("sinceDate.equals=" + UPDATED_SINCE_DATE);
 | 
			
		||||
        // Get all the membershipList where documentDate equals to UPDATED_DOCUMENT_DATE
 | 
			
		||||
        defaultMembershipShouldNotBeFound("documentDate.equals=" + UPDATED_DOCUMENT_DATE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllMembershipsBySinceDateIsInShouldWork() throws Exception {
 | 
			
		||||
    public void getAllMembershipsByDocumentDateIsInShouldWork() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        membershipRepository.saveAndFlush(membership);
 | 
			
		||||
 | 
			
		||||
        // Get all the membershipList where sinceDate in DEFAULT_SINCE_DATE or UPDATED_SINCE_DATE
 | 
			
		||||
        defaultMembershipShouldBeFound("sinceDate.in=" + DEFAULT_SINCE_DATE + "," + UPDATED_SINCE_DATE);
 | 
			
		||||
        // 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 sinceDate equals to UPDATED_SINCE_DATE
 | 
			
		||||
        defaultMembershipShouldNotBeFound("sinceDate.in=" + UPDATED_SINCE_DATE);
 | 
			
		||||
        // Get all the membershipList where documentDate equals to UPDATED_DOCUMENT_DATE
 | 
			
		||||
        defaultMembershipShouldNotBeFound("documentDate.in=" + UPDATED_DOCUMENT_DATE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllMembershipsBySinceDateIsNullOrNotNull() throws Exception {
 | 
			
		||||
    public void getAllMembershipsByDocumentDateIsNullOrNotNull() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        membershipRepository.saveAndFlush(membership);
 | 
			
		||||
 | 
			
		||||
        // Get all the membershipList where sinceDate is not null
 | 
			
		||||
        defaultMembershipShouldBeFound("sinceDate.specified=true");
 | 
			
		||||
        // Get all the membershipList where documentDate is not null
 | 
			
		||||
        defaultMembershipShouldBeFound("documentDate.specified=true");
 | 
			
		||||
 | 
			
		||||
        // Get all the membershipList where sinceDate is null
 | 
			
		||||
        defaultMembershipShouldNotBeFound("sinceDate.specified=false");
 | 
			
		||||
        // Get all the membershipList where documentDate is null
 | 
			
		||||
        defaultMembershipShouldNotBeFound("documentDate.specified=false");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllMembershipsBySinceDateIsGreaterThanOrEqualToSomething() throws Exception {
 | 
			
		||||
    public void getAllMembershipsByDocumentDateIsGreaterThanOrEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        membershipRepository.saveAndFlush(membership);
 | 
			
		||||
 | 
			
		||||
        // Get all the membershipList where sinceDate greater than or equals to DEFAULT_SINCE_DATE
 | 
			
		||||
        defaultMembershipShouldBeFound("sinceDate.greaterOrEqualThan=" + DEFAULT_SINCE_DATE);
 | 
			
		||||
        // 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 sinceDate greater than or equals to UPDATED_SINCE_DATE
 | 
			
		||||
        defaultMembershipShouldNotBeFound("sinceDate.greaterOrEqualThan=" + UPDATED_SINCE_DATE);
 | 
			
		||||
        // Get all the membershipList where documentDate greater than or equals to UPDATED_DOCUMENT_DATE
 | 
			
		||||
        defaultMembershipShouldNotBeFound("documentDate.greaterOrEqualThan=" + UPDATED_DOCUMENT_DATE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllMembershipsBySinceDateIsLessThanSomething() throws Exception {
 | 
			
		||||
    public void getAllMembershipsByDocumentDateIsLessThanSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        membershipRepository.saveAndFlush(membership);
 | 
			
		||||
 | 
			
		||||
        // Get all the membershipList where sinceDate less than or equals to DEFAULT_SINCE_DATE
 | 
			
		||||
        defaultMembershipShouldNotBeFound("sinceDate.lessThan=" + DEFAULT_SINCE_DATE);
 | 
			
		||||
        // 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 sinceDate less than or equals to UPDATED_SINCE_DATE
 | 
			
		||||
        defaultMembershipShouldBeFound("sinceDate.lessThan=" + UPDATED_SINCE_DATE);
 | 
			
		||||
        // Get all the membershipList where documentDate less than or equals to UPDATED_DOCUMENT_DATE
 | 
			
		||||
        defaultMembershipShouldBeFound("documentDate.lessThan=" + UPDATED_DOCUMENT_DATE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllMembershipsByUntilDateIsEqualToSomething() throws Exception {
 | 
			
		||||
    public void getAllMembershipsByMemberFromIsEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        membershipRepository.saveAndFlush(membership);
 | 
			
		||||
 | 
			
		||||
        // Get all the membershipList where untilDate equals to DEFAULT_UNTIL_DATE
 | 
			
		||||
        defaultMembershipShouldBeFound("untilDate.equals=" + DEFAULT_UNTIL_DATE);
 | 
			
		||||
        // Get all the membershipList where memberFrom equals to DEFAULT_MEMBER_FROM
 | 
			
		||||
        defaultMembershipShouldBeFound("memberFrom.equals=" + DEFAULT_MEMBER_FROM);
 | 
			
		||||
 | 
			
		||||
        // Get all the membershipList where untilDate equals to UPDATED_UNTIL_DATE
 | 
			
		||||
        defaultMembershipShouldNotBeFound("untilDate.equals=" + UPDATED_UNTIL_DATE);
 | 
			
		||||
        // Get all the membershipList where memberFrom equals to UPDATED_MEMBER_FROM
 | 
			
		||||
        defaultMembershipShouldNotBeFound("memberFrom.equals=" + UPDATED_MEMBER_FROM);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllMembershipsByUntilDateIsInShouldWork() throws Exception {
 | 
			
		||||
    public void getAllMembershipsByMemberFromIsInShouldWork() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        membershipRepository.saveAndFlush(membership);
 | 
			
		||||
 | 
			
		||||
        // Get all the membershipList where untilDate in DEFAULT_UNTIL_DATE or UPDATED_UNTIL_DATE
 | 
			
		||||
        defaultMembershipShouldBeFound("untilDate.in=" + DEFAULT_UNTIL_DATE + "," + UPDATED_UNTIL_DATE);
 | 
			
		||||
        // 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 untilDate equals to UPDATED_UNTIL_DATE
 | 
			
		||||
        defaultMembershipShouldNotBeFound("untilDate.in=" + UPDATED_UNTIL_DATE);
 | 
			
		||||
        // Get all the membershipList where memberFrom equals to UPDATED_MEMBER_FROM
 | 
			
		||||
        defaultMembershipShouldNotBeFound("memberFrom.in=" + UPDATED_MEMBER_FROM);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllMembershipsByUntilDateIsNullOrNotNull() throws Exception {
 | 
			
		||||
    public void getAllMembershipsByMemberFromIsNullOrNotNull() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        membershipRepository.saveAndFlush(membership);
 | 
			
		||||
 | 
			
		||||
        // Get all the membershipList where untilDate is not null
 | 
			
		||||
        defaultMembershipShouldBeFound("untilDate.specified=true");
 | 
			
		||||
        // Get all the membershipList where memberFrom is not null
 | 
			
		||||
        defaultMembershipShouldBeFound("memberFrom.specified=true");
 | 
			
		||||
 | 
			
		||||
        // Get all the membershipList where untilDate is null
 | 
			
		||||
        defaultMembershipShouldNotBeFound("untilDate.specified=false");
 | 
			
		||||
        // Get all the membershipList where memberFrom is null
 | 
			
		||||
        defaultMembershipShouldNotBeFound("memberFrom.specified=false");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllMembershipsByUntilDateIsGreaterThanOrEqualToSomething() throws Exception {
 | 
			
		||||
    public void getAllMembershipsByMemberFromIsGreaterThanOrEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        membershipRepository.saveAndFlush(membership);
 | 
			
		||||
 | 
			
		||||
        // Get all the membershipList where untilDate greater than or equals to DEFAULT_UNTIL_DATE
 | 
			
		||||
        defaultMembershipShouldBeFound("untilDate.greaterOrEqualThan=" + DEFAULT_UNTIL_DATE);
 | 
			
		||||
        // 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 untilDate greater than or equals to UPDATED_UNTIL_DATE
 | 
			
		||||
        defaultMembershipShouldNotBeFound("untilDate.greaterOrEqualThan=" + UPDATED_UNTIL_DATE);
 | 
			
		||||
        // Get all the membershipList where memberFrom greater than or equals to UPDATED_MEMBER_FROM
 | 
			
		||||
        defaultMembershipShouldNotBeFound("memberFrom.greaterOrEqualThan=" + UPDATED_MEMBER_FROM);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllMembershipsByUntilDateIsLessThanSomething() throws Exception {
 | 
			
		||||
    public void getAllMembershipsByMemberFromIsLessThanSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        membershipRepository.saveAndFlush(membership);
 | 
			
		||||
 | 
			
		||||
        // Get all the membershipList where untilDate less than or equals to DEFAULT_UNTIL_DATE
 | 
			
		||||
        defaultMembershipShouldNotBeFound("untilDate.lessThan=" + DEFAULT_UNTIL_DATE);
 | 
			
		||||
        // 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 untilDate less than or equals to UPDATED_UNTIL_DATE
 | 
			
		||||
        defaultMembershipShouldBeFound("untilDate.lessThan=" + UPDATED_UNTIL_DATE);
 | 
			
		||||
        // Get all the membershipList where memberFrom less than or equals to UPDATED_MEMBER_FROM
 | 
			
		||||
        defaultMembershipShouldBeFound("memberFrom.lessThan=" + UPDATED_MEMBER_FROM);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllMembershipsByMemberUntilIsEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        membershipRepository.saveAndFlush(membership);
 | 
			
		||||
 | 
			
		||||
        // Get all the membershipList where memberUntil equals to DEFAULT_MEMBER_UNTIL
 | 
			
		||||
        defaultMembershipShouldBeFound("memberUntil.equals=" + DEFAULT_MEMBER_UNTIL);
 | 
			
		||||
 | 
			
		||||
        // Get all the membershipList where memberUntil equals to UPDATED_MEMBER_UNTIL
 | 
			
		||||
        defaultMembershipShouldNotBeFound("memberUntil.equals=" + UPDATED_MEMBER_UNTIL);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllMembershipsByMemberUntilIsInShouldWork() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        membershipRepository.saveAndFlush(membership);
 | 
			
		||||
 | 
			
		||||
        // Get all the membershipList where memberUntil in DEFAULT_MEMBER_UNTIL or UPDATED_MEMBER_UNTIL
 | 
			
		||||
        defaultMembershipShouldBeFound("memberUntil.in=" + DEFAULT_MEMBER_UNTIL + "," + UPDATED_MEMBER_UNTIL);
 | 
			
		||||
 | 
			
		||||
        // Get all the membershipList where memberUntil equals to UPDATED_MEMBER_UNTIL
 | 
			
		||||
        defaultMembershipShouldNotBeFound("memberUntil.in=" + UPDATED_MEMBER_UNTIL);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllMembershipsByMemberUntilIsNullOrNotNull() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        membershipRepository.saveAndFlush(membership);
 | 
			
		||||
 | 
			
		||||
        // Get all the membershipList where memberUntil is not null
 | 
			
		||||
        defaultMembershipShouldBeFound("memberUntil.specified=true");
 | 
			
		||||
 | 
			
		||||
        // Get all the membershipList where 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
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllMembershipsByShareIsEqualToSomething() throws Exception {
 | 
			
		||||
@@ -403,8 +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("$.[*].sinceDate").value(hasItem(DEFAULT_SINCE_DATE.toString())))
 | 
			
		||||
            .andExpect(jsonPath("$.[*].untilDate").value(hasItem(DEFAULT_UNTIL_DATE.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)));
 | 
			
		||||
 | 
			
		||||
        // Check, that the count call also returns 1
 | 
			
		||||
        restMembershipMockMvc.perform(get("/api/memberships/count?sort=id,desc&" + filter))
 | 
			
		||||
@@ -452,8 +596,10 @@ public class MembershipResourceIntTest {
 | 
			
		||||
        // Disconnect from session so that the updates on updatedMembership are not directly saved in db
 | 
			
		||||
        em.detach(updatedMembership);
 | 
			
		||||
        updatedMembership
 | 
			
		||||
            .sinceDate(UPDATED_SINCE_DATE)
 | 
			
		||||
            .untilDate(UPDATED_UNTIL_DATE);
 | 
			
		||||
            .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")
 | 
			
		||||
@@ -465,8 +611,10 @@ public class MembershipResourceIntTest {
 | 
			
		||||
        List<Membership> membershipList = membershipRepository.findAll();
 | 
			
		||||
        assertThat(membershipList).hasSize(databaseSizeBeforeUpdate);
 | 
			
		||||
        Membership testMembership = membershipList.get(membershipList.size() - 1);
 | 
			
		||||
        assertThat(testMembership.getSinceDate()).isEqualTo(UPDATED_SINCE_DATE);
 | 
			
		||||
        assertThat(testMembership.getUntilDate()).isEqualTo(UPDATED_UNTIL_DATE);
 | 
			
		||||
        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
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,972 @@
 | 
			
		||||
package org.hostsharing.hsadminng.web.rest;
 | 
			
		||||
 | 
			
		||||
import org.hostsharing.hsadminng.HsadminNgApp;
 | 
			
		||||
 | 
			
		||||
import org.hostsharing.hsadminng.domain.SepaMandate;
 | 
			
		||||
import org.hostsharing.hsadminng.domain.Customer;
 | 
			
		||||
import org.hostsharing.hsadminng.repository.SepaMandateRepository;
 | 
			
		||||
import org.hostsharing.hsadminng.service.SepaMandateService;
 | 
			
		||||
import org.hostsharing.hsadminng.service.dto.SepaMandateDTO;
 | 
			
		||||
import org.hostsharing.hsadminng.service.mapper.SepaMandateMapper;
 | 
			
		||||
import org.hostsharing.hsadminng.web.rest.errors.ExceptionTranslator;
 | 
			
		||||
import org.hostsharing.hsadminng.service.dto.SepaMandateCriteria;
 | 
			
		||||
import org.hostsharing.hsadminng.service.SepaMandateQueryService;
 | 
			
		||||
 | 
			
		||||
import org.junit.Before;
 | 
			
		||||
import org.junit.Test;
 | 
			
		||||
import org.junit.runner.RunWith;
 | 
			
		||||
import org.mockito.MockitoAnnotations;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.boot.test.context.SpringBootTest;
 | 
			
		||||
import org.springframework.data.web.PageableHandlerMethodArgumentResolver;
 | 
			
		||||
import org.springframework.http.MediaType;
 | 
			
		||||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
 | 
			
		||||
import org.springframework.test.context.junit4.SpringRunner;
 | 
			
		||||
import org.springframework.test.web.servlet.MockMvc;
 | 
			
		||||
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
 | 
			
		||||
import org.springframework.transaction.annotation.Transactional;
 | 
			
		||||
import org.springframework.validation.Validator;
 | 
			
		||||
 | 
			
		||||
import javax.persistence.EntityManager;
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
import java.time.ZoneId;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
import static org.hostsharing.hsadminng.web.rest.TestUtil.createFormattingConversionService;
 | 
			
		||||
import static org.assertj.core.api.Assertions.assertThat;
 | 
			
		||||
import static org.hamcrest.Matchers.hasItem;
 | 
			
		||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
 | 
			
		||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Test class for the SepaMandateResource REST controller.
 | 
			
		||||
 *
 | 
			
		||||
 * @see SepaMandateResource
 | 
			
		||||
 */
 | 
			
		||||
@RunWith(SpringRunner.class)
 | 
			
		||||
@SpringBootTest(classes = HsadminNgApp.class)
 | 
			
		||||
public class SepaMandateResourceIntTest {
 | 
			
		||||
 | 
			
		||||
    private static final String DEFAULT_REFERENCE = "AAAAAAAAAA";
 | 
			
		||||
    private static final String UPDATED_REFERENCE = "BBBBBBBBBB";
 | 
			
		||||
 | 
			
		||||
    private static final String DEFAULT_IBAN = "AAAAAAAAAA";
 | 
			
		||||
    private static final String UPDATED_IBAN = "BBBBBBBBBB";
 | 
			
		||||
 | 
			
		||||
    private static final String DEFAULT_BIC = "AAAAAAAAAA";
 | 
			
		||||
    private static final String UPDATED_BIC = "BBBBBBBBBB";
 | 
			
		||||
 | 
			
		||||
    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_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_CANCELLATION_DATE = LocalDate.ofEpochDay(0L);
 | 
			
		||||
    private static final LocalDate UPDATED_CANCELLATION_DATE = LocalDate.now(ZoneId.systemDefault());
 | 
			
		||||
 | 
			
		||||
    private static final String DEFAULT_REMARK = "AAAAAAAAAA";
 | 
			
		||||
    private static final String UPDATED_REMARK = "BBBBBBBBBB";
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private SepaMandateRepository sepaMandateRepository;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private SepaMandateMapper sepaMandateMapper;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private SepaMandateService sepaMandateService;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private SepaMandateQueryService sepaMandateQueryService;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private MappingJackson2HttpMessageConverter jacksonMessageConverter;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private PageableHandlerMethodArgumentResolver pageableArgumentResolver;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private ExceptionTranslator exceptionTranslator;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private EntityManager em;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private Validator validator;
 | 
			
		||||
 | 
			
		||||
    private MockMvc restSepaMandateMockMvc;
 | 
			
		||||
 | 
			
		||||
    private SepaMandate sepaMandate;
 | 
			
		||||
 | 
			
		||||
    @Before
 | 
			
		||||
    public void setup() {
 | 
			
		||||
        MockitoAnnotations.initMocks(this);
 | 
			
		||||
        final SepaMandateResource sepaMandateResource = new SepaMandateResource(sepaMandateService, sepaMandateQueryService);
 | 
			
		||||
        this.restSepaMandateMockMvc = MockMvcBuilders.standaloneSetup(sepaMandateResource)
 | 
			
		||||
            .setCustomArgumentResolvers(pageableArgumentResolver)
 | 
			
		||||
            .setControllerAdvice(exceptionTranslator)
 | 
			
		||||
            .setConversionService(createFormattingConversionService())
 | 
			
		||||
            .setMessageConverters(jacksonMessageConverter)
 | 
			
		||||
            .setValidator(validator).build();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Create an entity for this test.
 | 
			
		||||
     *
 | 
			
		||||
     * This is a static method, as tests for other entities might also need it,
 | 
			
		||||
     * if they test an entity which requires the current entity.
 | 
			
		||||
     */
 | 
			
		||||
    public static SepaMandate createEntity(EntityManager em) {
 | 
			
		||||
        SepaMandate sepaMandate = new SepaMandate()
 | 
			
		||||
            .reference(DEFAULT_REFERENCE)
 | 
			
		||||
            .iban(DEFAULT_IBAN)
 | 
			
		||||
            .bic(DEFAULT_BIC)
 | 
			
		||||
            .documentDate(DEFAULT_DOCUMENT_DATE)
 | 
			
		||||
            .validFrom(DEFAULT_VALID_FROM)
 | 
			
		||||
            .validUntil(DEFAULT_VALID_UNTIL)
 | 
			
		||||
            .lastUsed(DEFAULT_LAST_USED)
 | 
			
		||||
            .cancellationDate(DEFAULT_CANCELLATION_DATE)
 | 
			
		||||
            .remark(DEFAULT_REMARK);
 | 
			
		||||
        // Add required entity
 | 
			
		||||
        Customer customer = CustomerResourceIntTest.createEntity(em);
 | 
			
		||||
        em.persist(customer);
 | 
			
		||||
        em.flush();
 | 
			
		||||
        sepaMandate.setCustomer(customer);
 | 
			
		||||
        return sepaMandate;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Before
 | 
			
		||||
    public void initTest() {
 | 
			
		||||
        sepaMandate = createEntity(em);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void createSepaMandate() throws Exception {
 | 
			
		||||
        int databaseSizeBeforeCreate = sepaMandateRepository.findAll().size();
 | 
			
		||||
 | 
			
		||||
        // Create the SepaMandate
 | 
			
		||||
        SepaMandateDTO sepaMandateDTO = sepaMandateMapper.toDto(sepaMandate);
 | 
			
		||||
        restSepaMandateMockMvc.perform(post("/api/sepa-mandates")
 | 
			
		||||
            .contentType(TestUtil.APPLICATION_JSON_UTF8)
 | 
			
		||||
            .content(TestUtil.convertObjectToJsonBytes(sepaMandateDTO)))
 | 
			
		||||
            .andExpect(status().isCreated());
 | 
			
		||||
 | 
			
		||||
        // Validate the SepaMandate in the database
 | 
			
		||||
        List<SepaMandate> sepaMandateList = sepaMandateRepository.findAll();
 | 
			
		||||
        assertThat(sepaMandateList).hasSize(databaseSizeBeforeCreate + 1);
 | 
			
		||||
        SepaMandate testSepaMandate = sepaMandateList.get(sepaMandateList.size() - 1);
 | 
			
		||||
        assertThat(testSepaMandate.getReference()).isEqualTo(DEFAULT_REFERENCE);
 | 
			
		||||
        assertThat(testSepaMandate.getIban()).isEqualTo(DEFAULT_IBAN);
 | 
			
		||||
        assertThat(testSepaMandate.getBic()).isEqualTo(DEFAULT_BIC);
 | 
			
		||||
        assertThat(testSepaMandate.getDocumentDate()).isEqualTo(DEFAULT_DOCUMENT_DATE);
 | 
			
		||||
        assertThat(testSepaMandate.getValidFrom()).isEqualTo(DEFAULT_VALID_FROM);
 | 
			
		||||
        assertThat(testSepaMandate.getValidUntil()).isEqualTo(DEFAULT_VALID_UNTIL);
 | 
			
		||||
        assertThat(testSepaMandate.getLastUsed()).isEqualTo(DEFAULT_LAST_USED);
 | 
			
		||||
        assertThat(testSepaMandate.getCancellationDate()).isEqualTo(DEFAULT_CANCELLATION_DATE);
 | 
			
		||||
        assertThat(testSepaMandate.getRemark()).isEqualTo(DEFAULT_REMARK);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void createSepaMandateWithExistingId() throws Exception {
 | 
			
		||||
        int databaseSizeBeforeCreate = sepaMandateRepository.findAll().size();
 | 
			
		||||
 | 
			
		||||
        // Create the SepaMandate with an existing ID
 | 
			
		||||
        sepaMandate.setId(1L);
 | 
			
		||||
        SepaMandateDTO sepaMandateDTO = sepaMandateMapper.toDto(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // An entity with an existing ID cannot be created, so this API call must fail
 | 
			
		||||
        restSepaMandateMockMvc.perform(post("/api/sepa-mandates")
 | 
			
		||||
            .contentType(TestUtil.APPLICATION_JSON_UTF8)
 | 
			
		||||
            .content(TestUtil.convertObjectToJsonBytes(sepaMandateDTO)))
 | 
			
		||||
            .andExpect(status().isBadRequest());
 | 
			
		||||
 | 
			
		||||
        // Validate the SepaMandate in the database
 | 
			
		||||
        List<SepaMandate> sepaMandateList = sepaMandateRepository.findAll();
 | 
			
		||||
        assertThat(sepaMandateList).hasSize(databaseSizeBeforeCreate);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void checkReferenceIsRequired() throws Exception {
 | 
			
		||||
        int databaseSizeBeforeTest = sepaMandateRepository.findAll().size();
 | 
			
		||||
        // set the field null
 | 
			
		||||
        sepaMandate.setReference(null);
 | 
			
		||||
 | 
			
		||||
        // Create the SepaMandate, which fails.
 | 
			
		||||
        SepaMandateDTO sepaMandateDTO = sepaMandateMapper.toDto(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        restSepaMandateMockMvc.perform(post("/api/sepa-mandates")
 | 
			
		||||
            .contentType(TestUtil.APPLICATION_JSON_UTF8)
 | 
			
		||||
            .content(TestUtil.convertObjectToJsonBytes(sepaMandateDTO)))
 | 
			
		||||
            .andExpect(status().isBadRequest());
 | 
			
		||||
 | 
			
		||||
        List<SepaMandate> sepaMandateList = sepaMandateRepository.findAll();
 | 
			
		||||
        assertThat(sepaMandateList).hasSize(databaseSizeBeforeTest);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void checkDocumentDateIsRequired() throws Exception {
 | 
			
		||||
        int databaseSizeBeforeTest = sepaMandateRepository.findAll().size();
 | 
			
		||||
        // set the field null
 | 
			
		||||
        sepaMandate.setDocumentDate(null);
 | 
			
		||||
 | 
			
		||||
        // Create the SepaMandate, which fails.
 | 
			
		||||
        SepaMandateDTO sepaMandateDTO = sepaMandateMapper.toDto(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        restSepaMandateMockMvc.perform(post("/api/sepa-mandates")
 | 
			
		||||
            .contentType(TestUtil.APPLICATION_JSON_UTF8)
 | 
			
		||||
            .content(TestUtil.convertObjectToJsonBytes(sepaMandateDTO)))
 | 
			
		||||
            .andExpect(status().isBadRequest());
 | 
			
		||||
 | 
			
		||||
        List<SepaMandate> sepaMandateList = sepaMandateRepository.findAll();
 | 
			
		||||
        assertThat(sepaMandateList).hasSize(databaseSizeBeforeTest);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void checkValidFromIsRequired() throws Exception {
 | 
			
		||||
        int databaseSizeBeforeTest = sepaMandateRepository.findAll().size();
 | 
			
		||||
        // set the field null
 | 
			
		||||
        sepaMandate.setValidFrom(null);
 | 
			
		||||
 | 
			
		||||
        // Create the SepaMandate, which fails.
 | 
			
		||||
        SepaMandateDTO sepaMandateDTO = sepaMandateMapper.toDto(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        restSepaMandateMockMvc.perform(post("/api/sepa-mandates")
 | 
			
		||||
            .contentType(TestUtil.APPLICATION_JSON_UTF8)
 | 
			
		||||
            .content(TestUtil.convertObjectToJsonBytes(sepaMandateDTO)))
 | 
			
		||||
            .andExpect(status().isBadRequest());
 | 
			
		||||
 | 
			
		||||
        List<SepaMandate> sepaMandateList = sepaMandateRepository.findAll();
 | 
			
		||||
        assertThat(sepaMandateList).hasSize(databaseSizeBeforeTest);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandates() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList
 | 
			
		||||
        restSepaMandateMockMvc.perform(get("/api/sepa-mandates?sort=id,desc"))
 | 
			
		||||
            .andExpect(status().isOk())
 | 
			
		||||
            .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
 | 
			
		||||
            .andExpect(jsonPath("$.[*].id").value(hasItem(sepaMandate.getId().intValue())))
 | 
			
		||||
            .andExpect(jsonPath("$.[*].reference").value(hasItem(DEFAULT_REFERENCE.toString())))
 | 
			
		||||
            .andExpect(jsonPath("$.[*].iban").value(hasItem(DEFAULT_IBAN.toString())))
 | 
			
		||||
            .andExpect(jsonPath("$.[*].bic").value(hasItem(DEFAULT_BIC.toString())))
 | 
			
		||||
            .andExpect(jsonPath("$.[*].documentDate").value(hasItem(DEFAULT_DOCUMENT_DATE.toString())))
 | 
			
		||||
            .andExpect(jsonPath("$.[*].validFrom").value(hasItem(DEFAULT_VALID_FROM.toString())))
 | 
			
		||||
            .andExpect(jsonPath("$.[*].validUntil").value(hasItem(DEFAULT_VALID_UNTIL.toString())))
 | 
			
		||||
            .andExpect(jsonPath("$.[*].lastUsed").value(hasItem(DEFAULT_LAST_USED.toString())))
 | 
			
		||||
            .andExpect(jsonPath("$.[*].cancellationDate").value(hasItem(DEFAULT_CANCELLATION_DATE.toString())))
 | 
			
		||||
            .andExpect(jsonPath("$.[*].remark").value(hasItem(DEFAULT_REMARK.toString())));
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getSepaMandate() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get the sepaMandate
 | 
			
		||||
        restSepaMandateMockMvc.perform(get("/api/sepa-mandates/{id}", sepaMandate.getId()))
 | 
			
		||||
            .andExpect(status().isOk())
 | 
			
		||||
            .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
 | 
			
		||||
            .andExpect(jsonPath("$.id").value(sepaMandate.getId().intValue()))
 | 
			
		||||
            .andExpect(jsonPath("$.reference").value(DEFAULT_REFERENCE.toString()))
 | 
			
		||||
            .andExpect(jsonPath("$.iban").value(DEFAULT_IBAN.toString()))
 | 
			
		||||
            .andExpect(jsonPath("$.bic").value(DEFAULT_BIC.toString()))
 | 
			
		||||
            .andExpect(jsonPath("$.documentDate").value(DEFAULT_DOCUMENT_DATE.toString()))
 | 
			
		||||
            .andExpect(jsonPath("$.validFrom").value(DEFAULT_VALID_FROM.toString()))
 | 
			
		||||
            .andExpect(jsonPath("$.validUntil").value(DEFAULT_VALID_UNTIL.toString()))
 | 
			
		||||
            .andExpect(jsonPath("$.lastUsed").value(DEFAULT_LAST_USED.toString()))
 | 
			
		||||
            .andExpect(jsonPath("$.cancellationDate").value(DEFAULT_CANCELLATION_DATE.toString()))
 | 
			
		||||
            .andExpect(jsonPath("$.remark").value(DEFAULT_REMARK.toString()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByReferenceIsEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where reference equals to DEFAULT_REFERENCE
 | 
			
		||||
        defaultSepaMandateShouldBeFound("reference.equals=" + DEFAULT_REFERENCE);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where reference equals to UPDATED_REFERENCE
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("reference.equals=" + UPDATED_REFERENCE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByReferenceIsInShouldWork() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where reference in DEFAULT_REFERENCE or UPDATED_REFERENCE
 | 
			
		||||
        defaultSepaMandateShouldBeFound("reference.in=" + DEFAULT_REFERENCE + "," + UPDATED_REFERENCE);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where reference equals to UPDATED_REFERENCE
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("reference.in=" + UPDATED_REFERENCE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByReferenceIsNullOrNotNull() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where reference is not null
 | 
			
		||||
        defaultSepaMandateShouldBeFound("reference.specified=true");
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where reference is null
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("reference.specified=false");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByIbanIsEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where iban equals to DEFAULT_IBAN
 | 
			
		||||
        defaultSepaMandateShouldBeFound("iban.equals=" + DEFAULT_IBAN);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where iban equals to UPDATED_IBAN
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("iban.equals=" + UPDATED_IBAN);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByIbanIsInShouldWork() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where iban in DEFAULT_IBAN or UPDATED_IBAN
 | 
			
		||||
        defaultSepaMandateShouldBeFound("iban.in=" + DEFAULT_IBAN + "," + UPDATED_IBAN);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where iban equals to UPDATED_IBAN
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("iban.in=" + UPDATED_IBAN);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByIbanIsNullOrNotNull() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where iban is not null
 | 
			
		||||
        defaultSepaMandateShouldBeFound("iban.specified=true");
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where iban is null
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("iban.specified=false");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByBicIsEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where bic equals to DEFAULT_BIC
 | 
			
		||||
        defaultSepaMandateShouldBeFound("bic.equals=" + DEFAULT_BIC);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where bic equals to UPDATED_BIC
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("bic.equals=" + UPDATED_BIC);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByBicIsInShouldWork() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where bic in DEFAULT_BIC or UPDATED_BIC
 | 
			
		||||
        defaultSepaMandateShouldBeFound("bic.in=" + DEFAULT_BIC + "," + UPDATED_BIC);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where bic equals to UPDATED_BIC
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("bic.in=" + UPDATED_BIC);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByBicIsNullOrNotNull() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where bic is not null
 | 
			
		||||
        defaultSepaMandateShouldBeFound("bic.specified=true");
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where bic is null
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("bic.specified=false");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByDocumentDateIsEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where documentDate equals to DEFAULT_DOCUMENT_DATE
 | 
			
		||||
        defaultSepaMandateShouldBeFound("documentDate.equals=" + DEFAULT_DOCUMENT_DATE);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where documentDate equals to UPDATED_DOCUMENT_DATE
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("documentDate.equals=" + UPDATED_DOCUMENT_DATE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByDocumentDateIsInShouldWork() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where documentDate in DEFAULT_DOCUMENT_DATE or UPDATED_DOCUMENT_DATE
 | 
			
		||||
        defaultSepaMandateShouldBeFound("documentDate.in=" + DEFAULT_DOCUMENT_DATE + "," + UPDATED_DOCUMENT_DATE);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where documentDate equals to UPDATED_DOCUMENT_DATE
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("documentDate.in=" + UPDATED_DOCUMENT_DATE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByDocumentDateIsNullOrNotNull() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where documentDate is not null
 | 
			
		||||
        defaultSepaMandateShouldBeFound("documentDate.specified=true");
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where documentDate is null
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("documentDate.specified=false");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByDocumentDateIsGreaterThanOrEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where documentDate greater than or equals to DEFAULT_DOCUMENT_DATE
 | 
			
		||||
        defaultSepaMandateShouldBeFound("documentDate.greaterOrEqualThan=" + DEFAULT_DOCUMENT_DATE);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where documentDate greater than or equals to UPDATED_DOCUMENT_DATE
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("documentDate.greaterOrEqualThan=" + UPDATED_DOCUMENT_DATE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByDocumentDateIsLessThanSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where documentDate less than or equals to DEFAULT_DOCUMENT_DATE
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("documentDate.lessThan=" + DEFAULT_DOCUMENT_DATE);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where documentDate less than or equals to UPDATED_DOCUMENT_DATE
 | 
			
		||||
        defaultSepaMandateShouldBeFound("documentDate.lessThan=" + UPDATED_DOCUMENT_DATE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByValidFromIsEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where validFrom equals to DEFAULT_VALID_FROM
 | 
			
		||||
        defaultSepaMandateShouldBeFound("validFrom.equals=" + DEFAULT_VALID_FROM);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where validFrom equals to UPDATED_VALID_FROM
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("validFrom.equals=" + UPDATED_VALID_FROM);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByValidFromIsInShouldWork() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where validFrom in DEFAULT_VALID_FROM or UPDATED_VALID_FROM
 | 
			
		||||
        defaultSepaMandateShouldBeFound("validFrom.in=" + DEFAULT_VALID_FROM + "," + UPDATED_VALID_FROM);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where validFrom equals to UPDATED_VALID_FROM
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("validFrom.in=" + UPDATED_VALID_FROM);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByValidFromIsNullOrNotNull() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where validFrom is not null
 | 
			
		||||
        defaultSepaMandateShouldBeFound("validFrom.specified=true");
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where validFrom is null
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("validFrom.specified=false");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByValidFromIsGreaterThanOrEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where validFrom greater than or equals to DEFAULT_VALID_FROM
 | 
			
		||||
        defaultSepaMandateShouldBeFound("validFrom.greaterOrEqualThan=" + DEFAULT_VALID_FROM);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where validFrom greater than or equals to UPDATED_VALID_FROM
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("validFrom.greaterOrEqualThan=" + UPDATED_VALID_FROM);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByValidFromIsLessThanSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where validFrom less than or equals to DEFAULT_VALID_FROM
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("validFrom.lessThan=" + DEFAULT_VALID_FROM);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where validFrom less than or equals to UPDATED_VALID_FROM
 | 
			
		||||
        defaultSepaMandateShouldBeFound("validFrom.lessThan=" + UPDATED_VALID_FROM);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByValidUntilIsEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where validUntil equals to DEFAULT_VALID_UNTIL
 | 
			
		||||
        defaultSepaMandateShouldBeFound("validUntil.equals=" + DEFAULT_VALID_UNTIL);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where validUntil equals to UPDATED_VALID_UNTIL
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("validUntil.equals=" + UPDATED_VALID_UNTIL);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByValidUntilIsInShouldWork() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where validUntil in DEFAULT_VALID_UNTIL or UPDATED_VALID_UNTIL
 | 
			
		||||
        defaultSepaMandateShouldBeFound("validUntil.in=" + DEFAULT_VALID_UNTIL + "," + UPDATED_VALID_UNTIL);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where validUntil equals to UPDATED_VALID_UNTIL
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("validUntil.in=" + UPDATED_VALID_UNTIL);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByValidUntilIsNullOrNotNull() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where validUntil is not null
 | 
			
		||||
        defaultSepaMandateShouldBeFound("validUntil.specified=true");
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where validUntil is null
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("validUntil.specified=false");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByValidUntilIsGreaterThanOrEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where validUntil greater than or equals to DEFAULT_VALID_UNTIL
 | 
			
		||||
        defaultSepaMandateShouldBeFound("validUntil.greaterOrEqualThan=" + DEFAULT_VALID_UNTIL);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where validUntil greater than or equals to UPDATED_VALID_UNTIL
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("validUntil.greaterOrEqualThan=" + UPDATED_VALID_UNTIL);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByValidUntilIsLessThanSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where validUntil less than or equals to DEFAULT_VALID_UNTIL
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("validUntil.lessThan=" + DEFAULT_VALID_UNTIL);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where validUntil less than or equals to UPDATED_VALID_UNTIL
 | 
			
		||||
        defaultSepaMandateShouldBeFound("validUntil.lessThan=" + UPDATED_VALID_UNTIL);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByLastUsedIsEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where lastUsed equals to DEFAULT_LAST_USED
 | 
			
		||||
        defaultSepaMandateShouldBeFound("lastUsed.equals=" + DEFAULT_LAST_USED);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where lastUsed equals to UPDATED_LAST_USED
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("lastUsed.equals=" + UPDATED_LAST_USED);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByLastUsedIsInShouldWork() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where lastUsed in DEFAULT_LAST_USED or UPDATED_LAST_USED
 | 
			
		||||
        defaultSepaMandateShouldBeFound("lastUsed.in=" + DEFAULT_LAST_USED + "," + UPDATED_LAST_USED);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where lastUsed equals to UPDATED_LAST_USED
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("lastUsed.in=" + UPDATED_LAST_USED);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByLastUsedIsNullOrNotNull() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where lastUsed is not null
 | 
			
		||||
        defaultSepaMandateShouldBeFound("lastUsed.specified=true");
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where lastUsed is null
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("lastUsed.specified=false");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByLastUsedIsGreaterThanOrEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where lastUsed greater than or equals to DEFAULT_LAST_USED
 | 
			
		||||
        defaultSepaMandateShouldBeFound("lastUsed.greaterOrEqualThan=" + DEFAULT_LAST_USED);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where lastUsed greater than or equals to UPDATED_LAST_USED
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("lastUsed.greaterOrEqualThan=" + UPDATED_LAST_USED);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByLastUsedIsLessThanSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where lastUsed less than or equals to DEFAULT_LAST_USED
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("lastUsed.lessThan=" + DEFAULT_LAST_USED);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where lastUsed less than or equals to UPDATED_LAST_USED
 | 
			
		||||
        defaultSepaMandateShouldBeFound("lastUsed.lessThan=" + UPDATED_LAST_USED);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByCancellationDateIsEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where cancellationDate equals to DEFAULT_CANCELLATION_DATE
 | 
			
		||||
        defaultSepaMandateShouldBeFound("cancellationDate.equals=" + DEFAULT_CANCELLATION_DATE);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where cancellationDate equals to UPDATED_CANCELLATION_DATE
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("cancellationDate.equals=" + UPDATED_CANCELLATION_DATE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByCancellationDateIsInShouldWork() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where cancellationDate in DEFAULT_CANCELLATION_DATE or UPDATED_CANCELLATION_DATE
 | 
			
		||||
        defaultSepaMandateShouldBeFound("cancellationDate.in=" + DEFAULT_CANCELLATION_DATE + "," + UPDATED_CANCELLATION_DATE);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where cancellationDate equals to UPDATED_CANCELLATION_DATE
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("cancellationDate.in=" + UPDATED_CANCELLATION_DATE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByCancellationDateIsNullOrNotNull() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where cancellationDate is not null
 | 
			
		||||
        defaultSepaMandateShouldBeFound("cancellationDate.specified=true");
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where cancellationDate is null
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("cancellationDate.specified=false");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByCancellationDateIsGreaterThanOrEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where cancellationDate greater than or equals to DEFAULT_CANCELLATION_DATE
 | 
			
		||||
        defaultSepaMandateShouldBeFound("cancellationDate.greaterOrEqualThan=" + DEFAULT_CANCELLATION_DATE);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where cancellationDate greater than or equals to UPDATED_CANCELLATION_DATE
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("cancellationDate.greaterOrEqualThan=" + UPDATED_CANCELLATION_DATE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByCancellationDateIsLessThanSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where cancellationDate less than or equals to DEFAULT_CANCELLATION_DATE
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("cancellationDate.lessThan=" + DEFAULT_CANCELLATION_DATE);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where cancellationDate less than or equals to UPDATED_CANCELLATION_DATE
 | 
			
		||||
        defaultSepaMandateShouldBeFound("cancellationDate.lessThan=" + UPDATED_CANCELLATION_DATE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByRemarkIsEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where remark equals to DEFAULT_REMARK
 | 
			
		||||
        defaultSepaMandateShouldBeFound("remark.equals=" + DEFAULT_REMARK);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where remark equals to UPDATED_REMARK
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("remark.equals=" + UPDATED_REMARK);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByRemarkIsInShouldWork() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where remark in DEFAULT_REMARK or UPDATED_REMARK
 | 
			
		||||
        defaultSepaMandateShouldBeFound("remark.in=" + DEFAULT_REMARK + "," + UPDATED_REMARK);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where remark equals to UPDATED_REMARK
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("remark.in=" + UPDATED_REMARK);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByRemarkIsNullOrNotNull() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where remark is not null
 | 
			
		||||
        defaultSepaMandateShouldBeFound("remark.specified=true");
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where remark is null
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("remark.specified=false");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSepaMandatesByCustomerIsEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        Customer customer = CustomerResourceIntTest.createEntity(em);
 | 
			
		||||
        em.persist(customer);
 | 
			
		||||
        em.flush();
 | 
			
		||||
        sepaMandate.setCustomer(customer);
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
        Long customerId = customer.getId();
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where customer equals to customerId
 | 
			
		||||
        defaultSepaMandateShouldBeFound("customerId.equals=" + customerId);
 | 
			
		||||
 | 
			
		||||
        // Get all the sepaMandateList where customer equals to customerId + 1
 | 
			
		||||
        defaultSepaMandateShouldNotBeFound("customerId.equals=" + (customerId + 1));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Executes the search, and checks that the default entity is returned
 | 
			
		||||
     */
 | 
			
		||||
    private void defaultSepaMandateShouldBeFound(String filter) throws Exception {
 | 
			
		||||
        restSepaMandateMockMvc.perform(get("/api/sepa-mandates?sort=id,desc&" + filter))
 | 
			
		||||
            .andExpect(status().isOk())
 | 
			
		||||
            .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
 | 
			
		||||
            .andExpect(jsonPath("$.[*].id").value(hasItem(sepaMandate.getId().intValue())))
 | 
			
		||||
            .andExpect(jsonPath("$.[*].reference").value(hasItem(DEFAULT_REFERENCE)))
 | 
			
		||||
            .andExpect(jsonPath("$.[*].iban").value(hasItem(DEFAULT_IBAN)))
 | 
			
		||||
            .andExpect(jsonPath("$.[*].bic").value(hasItem(DEFAULT_BIC)))
 | 
			
		||||
            .andExpect(jsonPath("$.[*].documentDate").value(hasItem(DEFAULT_DOCUMENT_DATE.toString())))
 | 
			
		||||
            .andExpect(jsonPath("$.[*].validFrom").value(hasItem(DEFAULT_VALID_FROM.toString())))
 | 
			
		||||
            .andExpect(jsonPath("$.[*].validUntil").value(hasItem(DEFAULT_VALID_UNTIL.toString())))
 | 
			
		||||
            .andExpect(jsonPath("$.[*].lastUsed").value(hasItem(DEFAULT_LAST_USED.toString())))
 | 
			
		||||
            .andExpect(jsonPath("$.[*].cancellationDate").value(hasItem(DEFAULT_CANCELLATION_DATE.toString())))
 | 
			
		||||
            .andExpect(jsonPath("$.[*].remark").value(hasItem(DEFAULT_REMARK)));
 | 
			
		||||
 | 
			
		||||
        // Check, that the count call also returns 1
 | 
			
		||||
        restSepaMandateMockMvc.perform(get("/api/sepa-mandates/count?sort=id,desc&" + filter))
 | 
			
		||||
            .andExpect(status().isOk())
 | 
			
		||||
            .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
 | 
			
		||||
            .andExpect(content().string("1"));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Executes the search, and checks that the default entity is not returned
 | 
			
		||||
     */
 | 
			
		||||
    private void defaultSepaMandateShouldNotBeFound(String filter) throws Exception {
 | 
			
		||||
        restSepaMandateMockMvc.perform(get("/api/sepa-mandates?sort=id,desc&" + filter))
 | 
			
		||||
            .andExpect(status().isOk())
 | 
			
		||||
            .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
 | 
			
		||||
            .andExpect(jsonPath("$").isArray())
 | 
			
		||||
            .andExpect(jsonPath("$").isEmpty());
 | 
			
		||||
 | 
			
		||||
        // Check, that the count call also returns 0
 | 
			
		||||
        restSepaMandateMockMvc.perform(get("/api/sepa-mandates/count?sort=id,desc&" + filter))
 | 
			
		||||
            .andExpect(status().isOk())
 | 
			
		||||
            .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
 | 
			
		||||
            .andExpect(content().string("0"));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getNonExistingSepaMandate() throws Exception {
 | 
			
		||||
        // Get the sepaMandate
 | 
			
		||||
        restSepaMandateMockMvc.perform(get("/api/sepa-mandates/{id}", Long.MAX_VALUE))
 | 
			
		||||
            .andExpect(status().isNotFound());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void updateSepaMandate() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        int databaseSizeBeforeUpdate = sepaMandateRepository.findAll().size();
 | 
			
		||||
 | 
			
		||||
        // Update the sepaMandate
 | 
			
		||||
        SepaMandate updatedSepaMandate = sepaMandateRepository.findById(sepaMandate.getId()).get();
 | 
			
		||||
        // Disconnect from session so that the updates on updatedSepaMandate are not directly saved in db
 | 
			
		||||
        em.detach(updatedSepaMandate);
 | 
			
		||||
        updatedSepaMandate
 | 
			
		||||
            .reference(UPDATED_REFERENCE)
 | 
			
		||||
            .iban(UPDATED_IBAN)
 | 
			
		||||
            .bic(UPDATED_BIC)
 | 
			
		||||
            .documentDate(UPDATED_DOCUMENT_DATE)
 | 
			
		||||
            .validFrom(UPDATED_VALID_FROM)
 | 
			
		||||
            .validUntil(UPDATED_VALID_UNTIL)
 | 
			
		||||
            .lastUsed(UPDATED_LAST_USED)
 | 
			
		||||
            .cancellationDate(UPDATED_CANCELLATION_DATE)
 | 
			
		||||
            .remark(UPDATED_REMARK);
 | 
			
		||||
        SepaMandateDTO sepaMandateDTO = sepaMandateMapper.toDto(updatedSepaMandate);
 | 
			
		||||
 | 
			
		||||
        restSepaMandateMockMvc.perform(put("/api/sepa-mandates")
 | 
			
		||||
            .contentType(TestUtil.APPLICATION_JSON_UTF8)
 | 
			
		||||
            .content(TestUtil.convertObjectToJsonBytes(sepaMandateDTO)))
 | 
			
		||||
            .andExpect(status().isOk());
 | 
			
		||||
 | 
			
		||||
        // Validate the SepaMandate in the database
 | 
			
		||||
        List<SepaMandate> sepaMandateList = sepaMandateRepository.findAll();
 | 
			
		||||
        assertThat(sepaMandateList).hasSize(databaseSizeBeforeUpdate);
 | 
			
		||||
        SepaMandate testSepaMandate = sepaMandateList.get(sepaMandateList.size() - 1);
 | 
			
		||||
        assertThat(testSepaMandate.getReference()).isEqualTo(UPDATED_REFERENCE);
 | 
			
		||||
        assertThat(testSepaMandate.getIban()).isEqualTo(UPDATED_IBAN);
 | 
			
		||||
        assertThat(testSepaMandate.getBic()).isEqualTo(UPDATED_BIC);
 | 
			
		||||
        assertThat(testSepaMandate.getDocumentDate()).isEqualTo(UPDATED_DOCUMENT_DATE);
 | 
			
		||||
        assertThat(testSepaMandate.getValidFrom()).isEqualTo(UPDATED_VALID_FROM);
 | 
			
		||||
        assertThat(testSepaMandate.getValidUntil()).isEqualTo(UPDATED_VALID_UNTIL);
 | 
			
		||||
        assertThat(testSepaMandate.getLastUsed()).isEqualTo(UPDATED_LAST_USED);
 | 
			
		||||
        assertThat(testSepaMandate.getCancellationDate()).isEqualTo(UPDATED_CANCELLATION_DATE);
 | 
			
		||||
        assertThat(testSepaMandate.getRemark()).isEqualTo(UPDATED_REMARK);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void updateNonExistingSepaMandate() throws Exception {
 | 
			
		||||
        int databaseSizeBeforeUpdate = sepaMandateRepository.findAll().size();
 | 
			
		||||
 | 
			
		||||
        // Create the SepaMandate
 | 
			
		||||
        SepaMandateDTO sepaMandateDTO = sepaMandateMapper.toDto(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        // If the entity doesn't have an ID, it will throw BadRequestAlertException
 | 
			
		||||
        restSepaMandateMockMvc.perform(put("/api/sepa-mandates")
 | 
			
		||||
            .contentType(TestUtil.APPLICATION_JSON_UTF8)
 | 
			
		||||
            .content(TestUtil.convertObjectToJsonBytes(sepaMandateDTO)))
 | 
			
		||||
            .andExpect(status().isBadRequest());
 | 
			
		||||
 | 
			
		||||
        // Validate the SepaMandate in the database
 | 
			
		||||
        List<SepaMandate> sepaMandateList = sepaMandateRepository.findAll();
 | 
			
		||||
        assertThat(sepaMandateList).hasSize(databaseSizeBeforeUpdate);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void deleteSepaMandate() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        sepaMandateRepository.saveAndFlush(sepaMandate);
 | 
			
		||||
 | 
			
		||||
        int databaseSizeBeforeDelete = sepaMandateRepository.findAll().size();
 | 
			
		||||
 | 
			
		||||
        // Delete the sepaMandate
 | 
			
		||||
        restSepaMandateMockMvc.perform(delete("/api/sepa-mandates/{id}", sepaMandate.getId())
 | 
			
		||||
            .accept(TestUtil.APPLICATION_JSON_UTF8))
 | 
			
		||||
            .andExpect(status().isOk());
 | 
			
		||||
 | 
			
		||||
        // Validate the database is empty
 | 
			
		||||
        List<SepaMandate> sepaMandateList = sepaMandateRepository.findAll();
 | 
			
		||||
        assertThat(sepaMandateList).hasSize(databaseSizeBeforeDelete - 1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void equalsVerifier() throws Exception {
 | 
			
		||||
        TestUtil.equalsVerifier(SepaMandate.class);
 | 
			
		||||
        SepaMandate sepaMandate1 = new SepaMandate();
 | 
			
		||||
        sepaMandate1.setId(1L);
 | 
			
		||||
        SepaMandate sepaMandate2 = new SepaMandate();
 | 
			
		||||
        sepaMandate2.setId(sepaMandate1.getId());
 | 
			
		||||
        assertThat(sepaMandate1).isEqualTo(sepaMandate2);
 | 
			
		||||
        sepaMandate2.setId(2L);
 | 
			
		||||
        assertThat(sepaMandate1).isNotEqualTo(sepaMandate2);
 | 
			
		||||
        sepaMandate1.setId(null);
 | 
			
		||||
        assertThat(sepaMandate1).isNotEqualTo(sepaMandate2);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void dtoEqualsVerifier() throws Exception {
 | 
			
		||||
        TestUtil.equalsVerifier(SepaMandateDTO.class);
 | 
			
		||||
        SepaMandateDTO sepaMandateDTO1 = new SepaMandateDTO();
 | 
			
		||||
        sepaMandateDTO1.setId(1L);
 | 
			
		||||
        SepaMandateDTO sepaMandateDTO2 = new SepaMandateDTO();
 | 
			
		||||
        assertThat(sepaMandateDTO1).isNotEqualTo(sepaMandateDTO2);
 | 
			
		||||
        sepaMandateDTO2.setId(sepaMandateDTO1.getId());
 | 
			
		||||
        assertThat(sepaMandateDTO1).isEqualTo(sepaMandateDTO2);
 | 
			
		||||
        sepaMandateDTO2.setId(2L);
 | 
			
		||||
        assertThat(sepaMandateDTO1).isNotEqualTo(sepaMandateDTO2);
 | 
			
		||||
        sepaMandateDTO1.setId(null);
 | 
			
		||||
        assertThat(sepaMandateDTO1).isNotEqualTo(sepaMandateDTO2);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void testEntityFromId() {
 | 
			
		||||
        assertThat(sepaMandateMapper.fromId(42L).getId()).isEqualTo(42);
 | 
			
		||||
        assertThat(sepaMandateMapper.fromId(null)).isNull();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,15 +1,17 @@
 | 
			
		||||
package org.hostsharing.hsadminng.web.rest;
 | 
			
		||||
 | 
			
		||||
import org.hostsharing.hsadminng.HsadminNgApp;
 | 
			
		||||
import org.hostsharing.hsadminng.domain.Membership;
 | 
			
		||||
 | 
			
		||||
import org.hostsharing.hsadminng.domain.Share;
 | 
			
		||||
import org.hostsharing.hsadminng.domain.enumeration.ShareAction;
 | 
			
		||||
import org.hostsharing.hsadminng.domain.Membership;
 | 
			
		||||
import org.hostsharing.hsadminng.repository.ShareRepository;
 | 
			
		||||
import org.hostsharing.hsadminng.service.ShareQueryService;
 | 
			
		||||
import org.hostsharing.hsadminng.service.ShareService;
 | 
			
		||||
import org.hostsharing.hsadminng.service.dto.ShareDTO;
 | 
			
		||||
import org.hostsharing.hsadminng.service.mapper.ShareMapper;
 | 
			
		||||
import org.hostsharing.hsadminng.web.rest.errors.ExceptionTranslator;
 | 
			
		||||
import org.hostsharing.hsadminng.service.dto.ShareCriteria;
 | 
			
		||||
import org.hostsharing.hsadminng.service.ShareQueryService;
 | 
			
		||||
 | 
			
		||||
import org.junit.Before;
 | 
			
		||||
import org.junit.Test;
 | 
			
		||||
import org.junit.runner.RunWith;
 | 
			
		||||
@@ -30,11 +32,14 @@ import java.time.LocalDate;
 | 
			
		||||
import java.time.ZoneId;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
import static org.hostsharing.hsadminng.web.rest.TestUtil.createFormattingConversionService;
 | 
			
		||||
import static org.assertj.core.api.Assertions.assertThat;
 | 
			
		||||
import static org.hamcrest.Matchers.hasItem;
 | 
			
		||||
import static org.hostsharing.hsadminng.web.rest.TestUtil.createFormattingConversionService;
 | 
			
		||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
 | 
			
		||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
 | 
			
		||||
 | 
			
		||||
import org.hostsharing.hsadminng.domain.enumeration.ShareAction;
 | 
			
		||||
/**
 | 
			
		||||
 * Test class for the ShareResource REST controller.
 | 
			
		||||
 *
 | 
			
		||||
@@ -44,8 +49,11 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
 | 
			
		||||
@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;
 | 
			
		||||
@@ -53,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;
 | 
			
		||||
@@ -107,15 +115,16 @@ 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);
 | 
			
		||||
        em.flush();
 | 
			
		||||
        share.setMember(membership);
 | 
			
		||||
        share.setMembership(membership);
 | 
			
		||||
        return share;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -140,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
 | 
			
		||||
@@ -168,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);
 | 
			
		||||
@@ -234,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
 | 
			
		||||
@@ -251,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);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -430,59 +527,59 @@ 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
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void getAllSharesByMemberIsEqualToSomething() throws Exception {
 | 
			
		||||
    public void getAllSharesByMembershipIsEqualToSomething() throws Exception {
 | 
			
		||||
        // Initialize the database
 | 
			
		||||
        Membership member = MembershipResourceIntTest.createEntity(em);
 | 
			
		||||
        em.persist(member);
 | 
			
		||||
        Membership membership = MembershipResourceIntTest.createEntity(em);
 | 
			
		||||
        em.persist(membership);
 | 
			
		||||
        em.flush();
 | 
			
		||||
        share.setMember(member);
 | 
			
		||||
        share.setMembership(membership);
 | 
			
		||||
        shareRepository.saveAndFlush(share);
 | 
			
		||||
        Long memberId = member.getId();
 | 
			
		||||
        Long membershipId = membership.getId();
 | 
			
		||||
 | 
			
		||||
        // Get all the shareList where member equals to memberId
 | 
			
		||||
        defaultShareShouldBeFound("memberId.equals=" + memberId);
 | 
			
		||||
        // Get all the shareList where membership equals to membershipId
 | 
			
		||||
        defaultShareShouldBeFound("membershipId.equals=" + membershipId);
 | 
			
		||||
 | 
			
		||||
        // Get all the shareList where member equals to memberId + 1
 | 
			
		||||
        defaultShareShouldNotBeFound("memberId.equals=" + (memberId + 1));
 | 
			
		||||
        // Get all the shareList where membership equals to membershipId + 1
 | 
			
		||||
        defaultShareShouldNotBeFound("membershipId.equals=" + (membershipId + 1));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -493,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))
 | 
			
		||||
@@ -544,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")
 | 
			
		||||
@@ -559,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
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/* tslint:disable max-line-length */
 | 
			
		||||
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
 | 
			
		||||
import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
 | 
			
		||||
import { HttpResponse } from '@angular/common/http';
 | 
			
		||||
import { of } from 'rxjs';
 | 
			
		||||
import { Observable, of } from 'rxjs';
 | 
			
		||||
 | 
			
		||||
import { HsadminNgTestModule } from '../../../test.module';
 | 
			
		||||
import { AssetUpdateComponent } from 'app/entities/asset/asset-update.component';
 | 
			
		||||
 
 | 
			
		||||
@@ -25,14 +25,15 @@ describe('Service Tests', () => {
 | 
			
		||||
            httpMock = injector.get(HttpTestingController);
 | 
			
		||||
            currentDate = moment();
 | 
			
		||||
 | 
			
		||||
            elemDefault = new Asset(0, currentDate, AssetAction.PAYMENT, 0, 'AAAAAAA');
 | 
			
		||||
            elemDefault = new Asset(0, currentDate, currentDate, AssetAction.PAYMENT, 0, 'AAAAAAA');
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        describe('Service methods', async () => {
 | 
			
		||||
            it('should find an element', async () => {
 | 
			
		||||
                const returnedFromService = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        date: currentDate.format(DATE_FORMAT)
 | 
			
		||||
                        documentDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        valueDate: currentDate.format(DATE_FORMAT)
 | 
			
		||||
                    },
 | 
			
		||||
                    elemDefault
 | 
			
		||||
                );
 | 
			
		||||
@@ -49,13 +50,15 @@ describe('Service Tests', () => {
 | 
			
		||||
                const returnedFromService = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        id: 0,
 | 
			
		||||
                        date: currentDate.format(DATE_FORMAT)
 | 
			
		||||
                        documentDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        valueDate: currentDate.format(DATE_FORMAT)
 | 
			
		||||
                    },
 | 
			
		||||
                    elemDefault
 | 
			
		||||
                );
 | 
			
		||||
                const expected = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        date: currentDate
 | 
			
		||||
                        documentDate: currentDate,
 | 
			
		||||
                        valueDate: currentDate
 | 
			
		||||
                    },
 | 
			
		||||
                    returnedFromService
 | 
			
		||||
                );
 | 
			
		||||
@@ -70,17 +73,19 @@ describe('Service Tests', () => {
 | 
			
		||||
            it('should update a Asset', async () => {
 | 
			
		||||
                const returnedFromService = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        date: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        documentDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        valueDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        action: 'BBBBBB',
 | 
			
		||||
                        amount: 1,
 | 
			
		||||
                        comment: 'BBBBBB'
 | 
			
		||||
                        remark: 'BBBBBB'
 | 
			
		||||
                    },
 | 
			
		||||
                    elemDefault
 | 
			
		||||
                );
 | 
			
		||||
 | 
			
		||||
                const expected = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        date: currentDate
 | 
			
		||||
                        documentDate: currentDate,
 | 
			
		||||
                        valueDate: currentDate
 | 
			
		||||
                    },
 | 
			
		||||
                    returnedFromService
 | 
			
		||||
                );
 | 
			
		||||
@@ -95,16 +100,18 @@ describe('Service Tests', () => {
 | 
			
		||||
            it('should return a list of Asset', async () => {
 | 
			
		||||
                const returnedFromService = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        date: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        documentDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        valueDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        action: 'BBBBBB',
 | 
			
		||||
                        amount: 1,
 | 
			
		||||
                        comment: 'BBBBBB'
 | 
			
		||||
                        remark: 'BBBBBB'
 | 
			
		||||
                    },
 | 
			
		||||
                    elemDefault
 | 
			
		||||
                );
 | 
			
		||||
                const expected = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        date: currentDate
 | 
			
		||||
                        documentDate: currentDate,
 | 
			
		||||
                        valueDate: currentDate
 | 
			
		||||
                    },
 | 
			
		||||
                    returnedFromService
 | 
			
		||||
                );
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/* tslint:disable max-line-length */
 | 
			
		||||
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
 | 
			
		||||
import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
 | 
			
		||||
import { HttpResponse } from '@angular/common/http';
 | 
			
		||||
import { of } from 'rxjs';
 | 
			
		||||
import { Observable, of } from 'rxjs';
 | 
			
		||||
 | 
			
		||||
import { HsadminNgTestModule } from '../../../test.module';
 | 
			
		||||
import { CustomerUpdateComponent } from 'app/entities/customer/customer-update.component';
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,11 @@
 | 
			
		||||
/* tslint:disable max-line-length */
 | 
			
		||||
import { getTestBed, TestBed } from '@angular/core/testing';
 | 
			
		||||
import { TestBed, getTestBed } from '@angular/core/testing';
 | 
			
		||||
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
 | 
			
		||||
import { map, take } from 'rxjs/operators';
 | 
			
		||||
import { HttpClient, HttpResponse } from '@angular/common/http';
 | 
			
		||||
import { of } from 'rxjs';
 | 
			
		||||
import { take, map } from 'rxjs/operators';
 | 
			
		||||
import { CustomerService } from 'app/entities/customer/customer.service';
 | 
			
		||||
import { Customer, ICustomer } from 'app/shared/model/customer.model';
 | 
			
		||||
import { ICustomer, Customer } from 'app/shared/model/customer.model';
 | 
			
		||||
 | 
			
		||||
describe('Service Tests', () => {
 | 
			
		||||
    describe('Customer Service', () => {
 | 
			
		||||
@@ -19,7 +21,7 @@ describe('Service Tests', () => {
 | 
			
		||||
            service = injector.get(CustomerService);
 | 
			
		||||
            httpMock = injector.get(HttpTestingController);
 | 
			
		||||
 | 
			
		||||
            elemDefault = new Customer(0, 0, 'AAAAAAA', 'AAAAAAA', 'AAAAAAA', 'AAAAAAA', 'AAAAAAA', 'AAAAAAA');
 | 
			
		||||
            elemDefault = new Customer(0, 0, 'AAAAAAA', 'AAAAAAA', 'AAAAAAA', 'AAAAAAA', 'AAAAAAA', 'AAAAAAA', 'AAAAAAA');
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        describe('Service methods', async () => {
 | 
			
		||||
@@ -53,13 +55,14 @@ describe('Service Tests', () => {
 | 
			
		||||
            it('should update a Customer', async () => {
 | 
			
		||||
                const returnedFromService = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        number: 1,
 | 
			
		||||
                        reference: 1,
 | 
			
		||||
                        prefix: 'BBBBBB',
 | 
			
		||||
                        name: 'BBBBBB',
 | 
			
		||||
                        contractualAddress: 'BBBBBB',
 | 
			
		||||
                        contractualSalutation: 'BBBBBB',
 | 
			
		||||
                        contractualAddress: 'BBBBBB',
 | 
			
		||||
                        billingSalutation: 'BBBBBB',
 | 
			
		||||
                        billingAddress: 'BBBBBB',
 | 
			
		||||
                        billingSalutation: 'BBBBBB'
 | 
			
		||||
                        remark: 'BBBBBB'
 | 
			
		||||
                    },
 | 
			
		||||
                    elemDefault
 | 
			
		||||
                );
 | 
			
		||||
@@ -76,13 +79,14 @@ describe('Service Tests', () => {
 | 
			
		||||
            it('should return a list of Customer', async () => {
 | 
			
		||||
                const returnedFromService = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        number: 1,
 | 
			
		||||
                        reference: 1,
 | 
			
		||||
                        prefix: 'BBBBBB',
 | 
			
		||||
                        name: 'BBBBBB',
 | 
			
		||||
                        contractualAddress: 'BBBBBB',
 | 
			
		||||
                        contractualSalutation: 'BBBBBB',
 | 
			
		||||
                        contractualAddress: 'BBBBBB',
 | 
			
		||||
                        billingSalutation: 'BBBBBB',
 | 
			
		||||
                        billingAddress: 'BBBBBB',
 | 
			
		||||
                        billingSalutation: 'BBBBBB'
 | 
			
		||||
                        remark: 'BBBBBB'
 | 
			
		||||
                    },
 | 
			
		||||
                    elemDefault
 | 
			
		||||
                );
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/* tslint:disable max-line-length */
 | 
			
		||||
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
 | 
			
		||||
import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
 | 
			
		||||
import { HttpResponse } from '@angular/common/http';
 | 
			
		||||
import { of } from 'rxjs';
 | 
			
		||||
import { Observable, of } from 'rxjs';
 | 
			
		||||
 | 
			
		||||
import { HsadminNgTestModule } from '../../../test.module';
 | 
			
		||||
import { MembershipUpdateComponent } from 'app/entities/membership/membership-update.component';
 | 
			
		||||
 
 | 
			
		||||
@@ -25,15 +25,16 @@ describe('Service Tests', () => {
 | 
			
		||||
            httpMock = injector.get(HttpTestingController);
 | 
			
		||||
            currentDate = moment();
 | 
			
		||||
 | 
			
		||||
            elemDefault = new Membership(0, currentDate, currentDate);
 | 
			
		||||
            elemDefault = new Membership(0, currentDate, currentDate, currentDate, 'AAAAAAA');
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        describe('Service methods', async () => {
 | 
			
		||||
            it('should find an element', async () => {
 | 
			
		||||
                const returnedFromService = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        sinceDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        untilDate: currentDate.format(DATE_FORMAT)
 | 
			
		||||
                        documentDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        memberFrom: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        memberUntil: currentDate.format(DATE_FORMAT)
 | 
			
		||||
                    },
 | 
			
		||||
                    elemDefault
 | 
			
		||||
                );
 | 
			
		||||
@@ -50,15 +51,17 @@ describe('Service Tests', () => {
 | 
			
		||||
                const returnedFromService = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        id: 0,
 | 
			
		||||
                        sinceDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        untilDate: currentDate.format(DATE_FORMAT)
 | 
			
		||||
                        documentDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        memberFrom: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        memberUntil: currentDate.format(DATE_FORMAT)
 | 
			
		||||
                    },
 | 
			
		||||
                    elemDefault
 | 
			
		||||
                );
 | 
			
		||||
                const expected = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        sinceDate: currentDate,
 | 
			
		||||
                        untilDate: currentDate
 | 
			
		||||
                        documentDate: currentDate,
 | 
			
		||||
                        memberFrom: currentDate,
 | 
			
		||||
                        memberUntil: currentDate
 | 
			
		||||
                    },
 | 
			
		||||
                    returnedFromService
 | 
			
		||||
                );
 | 
			
		||||
@@ -73,16 +76,19 @@ describe('Service Tests', () => {
 | 
			
		||||
            it('should update a Membership', async () => {
 | 
			
		||||
                const returnedFromService = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        sinceDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        untilDate: currentDate.format(DATE_FORMAT)
 | 
			
		||||
                        documentDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        memberFrom: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        memberUntil: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        remark: 'BBBBBB'
 | 
			
		||||
                    },
 | 
			
		||||
                    elemDefault
 | 
			
		||||
                );
 | 
			
		||||
 | 
			
		||||
                const expected = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        sinceDate: currentDate,
 | 
			
		||||
                        untilDate: currentDate
 | 
			
		||||
                        documentDate: currentDate,
 | 
			
		||||
                        memberFrom: currentDate,
 | 
			
		||||
                        memberUntil: currentDate
 | 
			
		||||
                    },
 | 
			
		||||
                    returnedFromService
 | 
			
		||||
                );
 | 
			
		||||
@@ -97,15 +103,18 @@ describe('Service Tests', () => {
 | 
			
		||||
            it('should return a list of Membership', async () => {
 | 
			
		||||
                const returnedFromService = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        sinceDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        untilDate: currentDate.format(DATE_FORMAT)
 | 
			
		||||
                        documentDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        memberFrom: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        memberUntil: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        remark: 'BBBBBB'
 | 
			
		||||
                    },
 | 
			
		||||
                    elemDefault
 | 
			
		||||
                );
 | 
			
		||||
                const expected = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        sinceDate: currentDate,
 | 
			
		||||
                        untilDate: currentDate
 | 
			
		||||
                        documentDate: currentDate,
 | 
			
		||||
                        memberFrom: currentDate,
 | 
			
		||||
                        memberUntil: currentDate
 | 
			
		||||
                    },
 | 
			
		||||
                    returnedFromService
 | 
			
		||||
                );
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,52 @@
 | 
			
		||||
/* tslint:disable max-line-length */
 | 
			
		||||
import { ComponentFixture, TestBed, inject, fakeAsync, tick } from '@angular/core/testing';
 | 
			
		||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 | 
			
		||||
import { Observable, of } from 'rxjs';
 | 
			
		||||
import { JhiEventManager } from 'ng-jhipster';
 | 
			
		||||
 | 
			
		||||
import { HsadminNgTestModule } from '../../../test.module';
 | 
			
		||||
import { SepaMandateDeleteDialogComponent } from 'app/entities/sepa-mandate/sepa-mandate-delete-dialog.component';
 | 
			
		||||
import { SepaMandateService } from 'app/entities/sepa-mandate/sepa-mandate.service';
 | 
			
		||||
 | 
			
		||||
describe('Component Tests', () => {
 | 
			
		||||
    describe('SepaMandate Management Delete Component', () => {
 | 
			
		||||
        let comp: SepaMandateDeleteDialogComponent;
 | 
			
		||||
        let fixture: ComponentFixture<SepaMandateDeleteDialogComponent>;
 | 
			
		||||
        let service: SepaMandateService;
 | 
			
		||||
        let mockEventManager: any;
 | 
			
		||||
        let mockActiveModal: any;
 | 
			
		||||
 | 
			
		||||
        beforeEach(() => {
 | 
			
		||||
            TestBed.configureTestingModule({
 | 
			
		||||
                imports: [HsadminNgTestModule],
 | 
			
		||||
                declarations: [SepaMandateDeleteDialogComponent]
 | 
			
		||||
            })
 | 
			
		||||
                .overrideTemplate(SepaMandateDeleteDialogComponent, '')
 | 
			
		||||
                .compileComponents();
 | 
			
		||||
            fixture = TestBed.createComponent(SepaMandateDeleteDialogComponent);
 | 
			
		||||
            comp = fixture.componentInstance;
 | 
			
		||||
            service = fixture.debugElement.injector.get(SepaMandateService);
 | 
			
		||||
            mockEventManager = fixture.debugElement.injector.get(JhiEventManager);
 | 
			
		||||
            mockActiveModal = fixture.debugElement.injector.get(NgbActiveModal);
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        describe('confirmDelete', () => {
 | 
			
		||||
            it('Should call delete service on confirmDelete', inject(
 | 
			
		||||
                [],
 | 
			
		||||
                fakeAsync(() => {
 | 
			
		||||
                    // GIVEN
 | 
			
		||||
                    spyOn(service, 'delete').and.returnValue(of({}));
 | 
			
		||||
 | 
			
		||||
                    // WHEN
 | 
			
		||||
                    comp.confirmDelete(123);
 | 
			
		||||
                    tick();
 | 
			
		||||
 | 
			
		||||
                    // THEN
 | 
			
		||||
                    expect(service.delete).toHaveBeenCalledWith(123);
 | 
			
		||||
                    expect(mockActiveModal.dismissSpy).toHaveBeenCalled();
 | 
			
		||||
                    expect(mockEventManager.broadcastSpy).toHaveBeenCalled();
 | 
			
		||||
                })
 | 
			
		||||
            ));
 | 
			
		||||
        });
 | 
			
		||||
    });
 | 
			
		||||
});
 | 
			
		||||
@@ -0,0 +1,40 @@
 | 
			
		||||
/* tslint:disable max-line-length */
 | 
			
		||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
 | 
			
		||||
import { ActivatedRoute } from '@angular/router';
 | 
			
		||||
import { of } from 'rxjs';
 | 
			
		||||
 | 
			
		||||
import { HsadminNgTestModule } from '../../../test.module';
 | 
			
		||||
import { SepaMandateDetailComponent } from 'app/entities/sepa-mandate/sepa-mandate-detail.component';
 | 
			
		||||
import { SepaMandate } from 'app/shared/model/sepa-mandate.model';
 | 
			
		||||
 | 
			
		||||
describe('Component Tests', () => {
 | 
			
		||||
    describe('SepaMandate Management Detail Component', () => {
 | 
			
		||||
        let comp: SepaMandateDetailComponent;
 | 
			
		||||
        let fixture: ComponentFixture<SepaMandateDetailComponent>;
 | 
			
		||||
        const route = ({ data: of({ sepaMandate: new SepaMandate(123) }) } as any) as ActivatedRoute;
 | 
			
		||||
 | 
			
		||||
        beforeEach(() => {
 | 
			
		||||
            TestBed.configureTestingModule({
 | 
			
		||||
                imports: [HsadminNgTestModule],
 | 
			
		||||
                declarations: [SepaMandateDetailComponent],
 | 
			
		||||
                providers: [{ provide: ActivatedRoute, useValue: route }]
 | 
			
		||||
            })
 | 
			
		||||
                .overrideTemplate(SepaMandateDetailComponent, '')
 | 
			
		||||
                .compileComponents();
 | 
			
		||||
            fixture = TestBed.createComponent(SepaMandateDetailComponent);
 | 
			
		||||
            comp = fixture.componentInstance;
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        describe('OnInit', () => {
 | 
			
		||||
            it('Should call load all on init', () => {
 | 
			
		||||
                // GIVEN
 | 
			
		||||
 | 
			
		||||
                // WHEN
 | 
			
		||||
                comp.ngOnInit();
 | 
			
		||||
 | 
			
		||||
                // THEN
 | 
			
		||||
                expect(comp.sepaMandate).toEqual(jasmine.objectContaining({ id: 123 }));
 | 
			
		||||
            });
 | 
			
		||||
        });
 | 
			
		||||
    });
 | 
			
		||||
});
 | 
			
		||||
@@ -0,0 +1,60 @@
 | 
			
		||||
/* tslint:disable max-line-length */
 | 
			
		||||
import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
 | 
			
		||||
import { HttpResponse } from '@angular/common/http';
 | 
			
		||||
import { Observable, of } from 'rxjs';
 | 
			
		||||
 | 
			
		||||
import { HsadminNgTestModule } from '../../../test.module';
 | 
			
		||||
import { SepaMandateUpdateComponent } from 'app/entities/sepa-mandate/sepa-mandate-update.component';
 | 
			
		||||
import { SepaMandateService } from 'app/entities/sepa-mandate/sepa-mandate.service';
 | 
			
		||||
import { SepaMandate } from 'app/shared/model/sepa-mandate.model';
 | 
			
		||||
 | 
			
		||||
describe('Component Tests', () => {
 | 
			
		||||
    describe('SepaMandate Management Update Component', () => {
 | 
			
		||||
        let comp: SepaMandateUpdateComponent;
 | 
			
		||||
        let fixture: ComponentFixture<SepaMandateUpdateComponent>;
 | 
			
		||||
        let service: SepaMandateService;
 | 
			
		||||
 | 
			
		||||
        beforeEach(() => {
 | 
			
		||||
            TestBed.configureTestingModule({
 | 
			
		||||
                imports: [HsadminNgTestModule],
 | 
			
		||||
                declarations: [SepaMandateUpdateComponent]
 | 
			
		||||
            })
 | 
			
		||||
                .overrideTemplate(SepaMandateUpdateComponent, '')
 | 
			
		||||
                .compileComponents();
 | 
			
		||||
 | 
			
		||||
            fixture = TestBed.createComponent(SepaMandateUpdateComponent);
 | 
			
		||||
            comp = fixture.componentInstance;
 | 
			
		||||
            service = fixture.debugElement.injector.get(SepaMandateService);
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        describe('save', () => {
 | 
			
		||||
            it('Should call update service on save for existing entity', fakeAsync(() => {
 | 
			
		||||
                // GIVEN
 | 
			
		||||
                const entity = new SepaMandate(123);
 | 
			
		||||
                spyOn(service, 'update').and.returnValue(of(new HttpResponse({ body: entity })));
 | 
			
		||||
                comp.sepaMandate = entity;
 | 
			
		||||
                // WHEN
 | 
			
		||||
                comp.save();
 | 
			
		||||
                tick(); // simulate async
 | 
			
		||||
 | 
			
		||||
                // THEN
 | 
			
		||||
                expect(service.update).toHaveBeenCalledWith(entity);
 | 
			
		||||
                expect(comp.isSaving).toEqual(false);
 | 
			
		||||
            }));
 | 
			
		||||
 | 
			
		||||
            it('Should call create service on save for new entity', fakeAsync(() => {
 | 
			
		||||
                // GIVEN
 | 
			
		||||
                const entity = new SepaMandate();
 | 
			
		||||
                spyOn(service, 'create').and.returnValue(of(new HttpResponse({ body: entity })));
 | 
			
		||||
                comp.sepaMandate = entity;
 | 
			
		||||
                // WHEN
 | 
			
		||||
                comp.save();
 | 
			
		||||
                tick(); // simulate async
 | 
			
		||||
 | 
			
		||||
                // THEN
 | 
			
		||||
                expect(service.create).toHaveBeenCalledWith(entity);
 | 
			
		||||
                expect(comp.isSaving).toEqual(false);
 | 
			
		||||
            }));
 | 
			
		||||
        });
 | 
			
		||||
    });
 | 
			
		||||
});
 | 
			
		||||
@@ -0,0 +1,128 @@
 | 
			
		||||
/* tslint:disable max-line-length */
 | 
			
		||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
 | 
			
		||||
import { Observable, of } from 'rxjs';
 | 
			
		||||
import { HttpHeaders, HttpResponse } from '@angular/common/http';
 | 
			
		||||
import { ActivatedRoute, Data } from '@angular/router';
 | 
			
		||||
 | 
			
		||||
import { HsadminNgTestModule } from '../../../test.module';
 | 
			
		||||
import { SepaMandateComponent } from 'app/entities/sepa-mandate/sepa-mandate.component';
 | 
			
		||||
import { SepaMandateService } from 'app/entities/sepa-mandate/sepa-mandate.service';
 | 
			
		||||
import { SepaMandate } from 'app/shared/model/sepa-mandate.model';
 | 
			
		||||
 | 
			
		||||
describe('Component Tests', () => {
 | 
			
		||||
    describe('SepaMandate Management Component', () => {
 | 
			
		||||
        let comp: SepaMandateComponent;
 | 
			
		||||
        let fixture: ComponentFixture<SepaMandateComponent>;
 | 
			
		||||
        let service: SepaMandateService;
 | 
			
		||||
 | 
			
		||||
        beforeEach(() => {
 | 
			
		||||
            TestBed.configureTestingModule({
 | 
			
		||||
                imports: [HsadminNgTestModule],
 | 
			
		||||
                declarations: [SepaMandateComponent],
 | 
			
		||||
                providers: [
 | 
			
		||||
                    {
 | 
			
		||||
                        provide: ActivatedRoute,
 | 
			
		||||
                        useValue: {
 | 
			
		||||
                            data: {
 | 
			
		||||
                                subscribe: (fn: (value: Data) => void) =>
 | 
			
		||||
                                    fn({
 | 
			
		||||
                                        pagingParams: {
 | 
			
		||||
                                            predicate: 'id',
 | 
			
		||||
                                            reverse: false,
 | 
			
		||||
                                            page: 0
 | 
			
		||||
                                        }
 | 
			
		||||
                                    })
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                ]
 | 
			
		||||
            })
 | 
			
		||||
                .overrideTemplate(SepaMandateComponent, '')
 | 
			
		||||
                .compileComponents();
 | 
			
		||||
 | 
			
		||||
            fixture = TestBed.createComponent(SepaMandateComponent);
 | 
			
		||||
            comp = fixture.componentInstance;
 | 
			
		||||
            service = fixture.debugElement.injector.get(SepaMandateService);
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        it('Should call load all on init', () => {
 | 
			
		||||
            // GIVEN
 | 
			
		||||
            const headers = new HttpHeaders().append('link', 'link;link');
 | 
			
		||||
            spyOn(service, 'query').and.returnValue(
 | 
			
		||||
                of(
 | 
			
		||||
                    new HttpResponse({
 | 
			
		||||
                        body: [new SepaMandate(123)],
 | 
			
		||||
                        headers
 | 
			
		||||
                    })
 | 
			
		||||
                )
 | 
			
		||||
            );
 | 
			
		||||
 | 
			
		||||
            // WHEN
 | 
			
		||||
            comp.ngOnInit();
 | 
			
		||||
 | 
			
		||||
            // THEN
 | 
			
		||||
            expect(service.query).toHaveBeenCalled();
 | 
			
		||||
            expect(comp.sepaMandates[0]).toEqual(jasmine.objectContaining({ id: 123 }));
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        it('should load a page', () => {
 | 
			
		||||
            // GIVEN
 | 
			
		||||
            const headers = new HttpHeaders().append('link', 'link;link');
 | 
			
		||||
            spyOn(service, 'query').and.returnValue(
 | 
			
		||||
                of(
 | 
			
		||||
                    new HttpResponse({
 | 
			
		||||
                        body: [new SepaMandate(123)],
 | 
			
		||||
                        headers
 | 
			
		||||
                    })
 | 
			
		||||
                )
 | 
			
		||||
            );
 | 
			
		||||
 | 
			
		||||
            // WHEN
 | 
			
		||||
            comp.loadPage(1);
 | 
			
		||||
 | 
			
		||||
            // THEN
 | 
			
		||||
            expect(service.query).toHaveBeenCalled();
 | 
			
		||||
            expect(comp.sepaMandates[0]).toEqual(jasmine.objectContaining({ id: 123 }));
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        it('should re-initialize the page', () => {
 | 
			
		||||
            // GIVEN
 | 
			
		||||
            const headers = new HttpHeaders().append('link', 'link;link');
 | 
			
		||||
            spyOn(service, 'query').and.returnValue(
 | 
			
		||||
                of(
 | 
			
		||||
                    new HttpResponse({
 | 
			
		||||
                        body: [new SepaMandate(123)],
 | 
			
		||||
                        headers
 | 
			
		||||
                    })
 | 
			
		||||
                )
 | 
			
		||||
            );
 | 
			
		||||
 | 
			
		||||
            // WHEN
 | 
			
		||||
            comp.loadPage(1);
 | 
			
		||||
            comp.reset();
 | 
			
		||||
 | 
			
		||||
            // THEN
 | 
			
		||||
            expect(comp.page).toEqual(0);
 | 
			
		||||
            expect(service.query).toHaveBeenCalledTimes(2);
 | 
			
		||||
            expect(comp.sepaMandates[0]).toEqual(jasmine.objectContaining({ id: 123 }));
 | 
			
		||||
        });
 | 
			
		||||
        it('should calculate the sort attribute for an id', () => {
 | 
			
		||||
            // WHEN
 | 
			
		||||
            const result = comp.sort();
 | 
			
		||||
 | 
			
		||||
            // THEN
 | 
			
		||||
            expect(result).toEqual(['id,asc']);
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        it('should calculate the sort attribute for a non-id attribute', () => {
 | 
			
		||||
            // GIVEN
 | 
			
		||||
            comp.predicate = 'name';
 | 
			
		||||
 | 
			
		||||
            // WHEN
 | 
			
		||||
            const result = comp.sort();
 | 
			
		||||
 | 
			
		||||
            // THEN
 | 
			
		||||
            expect(result).toEqual(['name,asc', 'id']);
 | 
			
		||||
        });
 | 
			
		||||
    });
 | 
			
		||||
});
 | 
			
		||||
@@ -0,0 +1,176 @@
 | 
			
		||||
/* tslint:disable max-line-length */
 | 
			
		||||
import { TestBed, getTestBed } from '@angular/core/testing';
 | 
			
		||||
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
 | 
			
		||||
import { HttpClient, HttpResponse } from '@angular/common/http';
 | 
			
		||||
import { of } from 'rxjs';
 | 
			
		||||
import { take, map } from 'rxjs/operators';
 | 
			
		||||
import * as moment from 'moment';
 | 
			
		||||
import { DATE_FORMAT } from 'app/shared/constants/input.constants';
 | 
			
		||||
import { SepaMandateService } from 'app/entities/sepa-mandate/sepa-mandate.service';
 | 
			
		||||
import { ISepaMandate, SepaMandate } from 'app/shared/model/sepa-mandate.model';
 | 
			
		||||
 | 
			
		||||
describe('Service Tests', () => {
 | 
			
		||||
    describe('SepaMandate Service', () => {
 | 
			
		||||
        let injector: TestBed;
 | 
			
		||||
        let service: SepaMandateService;
 | 
			
		||||
        let httpMock: HttpTestingController;
 | 
			
		||||
        let elemDefault: ISepaMandate;
 | 
			
		||||
        let currentDate: moment.Moment;
 | 
			
		||||
        beforeEach(() => {
 | 
			
		||||
            TestBed.configureTestingModule({
 | 
			
		||||
                imports: [HttpClientTestingModule]
 | 
			
		||||
            });
 | 
			
		||||
            injector = getTestBed();
 | 
			
		||||
            service = injector.get(SepaMandateService);
 | 
			
		||||
            httpMock = injector.get(HttpTestingController);
 | 
			
		||||
            currentDate = moment();
 | 
			
		||||
 | 
			
		||||
            elemDefault = new SepaMandate(
 | 
			
		||||
                0,
 | 
			
		||||
                'AAAAAAA',
 | 
			
		||||
                'AAAAAAA',
 | 
			
		||||
                'AAAAAAA',
 | 
			
		||||
                currentDate,
 | 
			
		||||
                currentDate,
 | 
			
		||||
                currentDate,
 | 
			
		||||
                currentDate,
 | 
			
		||||
                currentDate,
 | 
			
		||||
                'AAAAAAA'
 | 
			
		||||
            );
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        describe('Service methods', async () => {
 | 
			
		||||
            it('should find an element', async () => {
 | 
			
		||||
                const returnedFromService = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        documentDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        validFrom: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        validUntil: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        lastUsed: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        cancellationDate: currentDate.format(DATE_FORMAT)
 | 
			
		||||
                    },
 | 
			
		||||
                    elemDefault
 | 
			
		||||
                );
 | 
			
		||||
                service
 | 
			
		||||
                    .find(123)
 | 
			
		||||
                    .pipe(take(1))
 | 
			
		||||
                    .subscribe(resp => expect(resp).toMatchObject({ body: elemDefault }));
 | 
			
		||||
 | 
			
		||||
                const req = httpMock.expectOne({ method: 'GET' });
 | 
			
		||||
                req.flush(JSON.stringify(returnedFromService));
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it('should create a SepaMandate', async () => {
 | 
			
		||||
                const returnedFromService = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        id: 0,
 | 
			
		||||
                        documentDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        validFrom: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        validUntil: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        lastUsed: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        cancellationDate: currentDate.format(DATE_FORMAT)
 | 
			
		||||
                    },
 | 
			
		||||
                    elemDefault
 | 
			
		||||
                );
 | 
			
		||||
                const expected = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        documentDate: currentDate,
 | 
			
		||||
                        validFrom: currentDate,
 | 
			
		||||
                        validUntil: currentDate,
 | 
			
		||||
                        lastUsed: currentDate,
 | 
			
		||||
                        cancellationDate: currentDate
 | 
			
		||||
                    },
 | 
			
		||||
                    returnedFromService
 | 
			
		||||
                );
 | 
			
		||||
                service
 | 
			
		||||
                    .create(new SepaMandate(null))
 | 
			
		||||
                    .pipe(take(1))
 | 
			
		||||
                    .subscribe(resp => expect(resp).toMatchObject({ body: expected }));
 | 
			
		||||
                const req = httpMock.expectOne({ method: 'POST' });
 | 
			
		||||
                req.flush(JSON.stringify(returnedFromService));
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it('should update a SepaMandate', async () => {
 | 
			
		||||
                const returnedFromService = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        reference: 'BBBBBB',
 | 
			
		||||
                        iban: 'BBBBBB',
 | 
			
		||||
                        bic: 'BBBBBB',
 | 
			
		||||
                        documentDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        validFrom: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        validUntil: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        lastUsed: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        cancellationDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        remark: 'BBBBBB'
 | 
			
		||||
                    },
 | 
			
		||||
                    elemDefault
 | 
			
		||||
                );
 | 
			
		||||
 | 
			
		||||
                const expected = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        documentDate: currentDate,
 | 
			
		||||
                        validFrom: currentDate,
 | 
			
		||||
                        validUntil: currentDate,
 | 
			
		||||
                        lastUsed: currentDate,
 | 
			
		||||
                        cancellationDate: currentDate
 | 
			
		||||
                    },
 | 
			
		||||
                    returnedFromService
 | 
			
		||||
                );
 | 
			
		||||
                service
 | 
			
		||||
                    .update(expected)
 | 
			
		||||
                    .pipe(take(1))
 | 
			
		||||
                    .subscribe(resp => expect(resp).toMatchObject({ body: expected }));
 | 
			
		||||
                const req = httpMock.expectOne({ method: 'PUT' });
 | 
			
		||||
                req.flush(JSON.stringify(returnedFromService));
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it('should return a list of SepaMandate', async () => {
 | 
			
		||||
                const returnedFromService = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        reference: 'BBBBBB',
 | 
			
		||||
                        iban: 'BBBBBB',
 | 
			
		||||
                        bic: 'BBBBBB',
 | 
			
		||||
                        documentDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        validFrom: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        validUntil: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        lastUsed: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        cancellationDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        remark: 'BBBBBB'
 | 
			
		||||
                    },
 | 
			
		||||
                    elemDefault
 | 
			
		||||
                );
 | 
			
		||||
                const expected = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        documentDate: currentDate,
 | 
			
		||||
                        validFrom: currentDate,
 | 
			
		||||
                        validUntil: currentDate,
 | 
			
		||||
                        lastUsed: currentDate,
 | 
			
		||||
                        cancellationDate: currentDate
 | 
			
		||||
                    },
 | 
			
		||||
                    returnedFromService
 | 
			
		||||
                );
 | 
			
		||||
                service
 | 
			
		||||
                    .query(expected)
 | 
			
		||||
                    .pipe(
 | 
			
		||||
                        take(1),
 | 
			
		||||
                        map(resp => resp.body)
 | 
			
		||||
                    )
 | 
			
		||||
                    .subscribe(body => expect(body).toContainEqual(expected));
 | 
			
		||||
                const req = httpMock.expectOne({ method: 'GET' });
 | 
			
		||||
                req.flush(JSON.stringify([returnedFromService]));
 | 
			
		||||
                httpMock.verify();
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it('should delete a SepaMandate', async () => {
 | 
			
		||||
                const rxPromise = service.delete(123).subscribe(resp => expect(resp.ok));
 | 
			
		||||
 | 
			
		||||
                const req = httpMock.expectOne({ method: 'DELETE' });
 | 
			
		||||
                req.flush({ status: 200 });
 | 
			
		||||
            });
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        afterEach(() => {
 | 
			
		||||
            httpMock.verify();
 | 
			
		||||
        });
 | 
			
		||||
    });
 | 
			
		||||
});
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/* tslint:disable max-line-length */
 | 
			
		||||
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
 | 
			
		||||
import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
 | 
			
		||||
import { HttpResponse } from '@angular/common/http';
 | 
			
		||||
import { of } from 'rxjs';
 | 
			
		||||
import { Observable, of } from 'rxjs';
 | 
			
		||||
 | 
			
		||||
import { HsadminNgTestModule } from '../../../test.module';
 | 
			
		||||
import { ShareUpdateComponent } from 'app/entities/share/share-update.component';
 | 
			
		||||
 
 | 
			
		||||
@@ -25,14 +25,15 @@ describe('Service Tests', () => {
 | 
			
		||||
            httpMock = injector.get(HttpTestingController);
 | 
			
		||||
            currentDate = moment();
 | 
			
		||||
 | 
			
		||||
            elemDefault = new Share(0, currentDate, ShareAction.SUBSCRIPTION, 0, 'AAAAAAA');
 | 
			
		||||
            elemDefault = new Share(0, currentDate, currentDate, ShareAction.SUBSCRIPTION, 0, 'AAAAAAA');
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        describe('Service methods', async () => {
 | 
			
		||||
            it('should find an element', async () => {
 | 
			
		||||
                const returnedFromService = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        date: currentDate.format(DATE_FORMAT)
 | 
			
		||||
                        documentDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        valueDate: currentDate.format(DATE_FORMAT)
 | 
			
		||||
                    },
 | 
			
		||||
                    elemDefault
 | 
			
		||||
                );
 | 
			
		||||
@@ -49,13 +50,15 @@ describe('Service Tests', () => {
 | 
			
		||||
                const returnedFromService = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        id: 0,
 | 
			
		||||
                        date: currentDate.format(DATE_FORMAT)
 | 
			
		||||
                        documentDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        valueDate: currentDate.format(DATE_FORMAT)
 | 
			
		||||
                    },
 | 
			
		||||
                    elemDefault
 | 
			
		||||
                );
 | 
			
		||||
                const expected = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        date: currentDate
 | 
			
		||||
                        documentDate: currentDate,
 | 
			
		||||
                        valueDate: currentDate
 | 
			
		||||
                    },
 | 
			
		||||
                    returnedFromService
 | 
			
		||||
                );
 | 
			
		||||
@@ -70,17 +73,19 @@ describe('Service Tests', () => {
 | 
			
		||||
            it('should update a Share', async () => {
 | 
			
		||||
                const returnedFromService = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        date: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        documentDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        valueDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        action: 'BBBBBB',
 | 
			
		||||
                        quantity: 1,
 | 
			
		||||
                        comment: 'BBBBBB'
 | 
			
		||||
                        remark: 'BBBBBB'
 | 
			
		||||
                    },
 | 
			
		||||
                    elemDefault
 | 
			
		||||
                );
 | 
			
		||||
 | 
			
		||||
                const expected = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        date: currentDate
 | 
			
		||||
                        documentDate: currentDate,
 | 
			
		||||
                        valueDate: currentDate
 | 
			
		||||
                    },
 | 
			
		||||
                    returnedFromService
 | 
			
		||||
                );
 | 
			
		||||
@@ -95,16 +100,18 @@ describe('Service Tests', () => {
 | 
			
		||||
            it('should return a list of Share', async () => {
 | 
			
		||||
                const returnedFromService = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        date: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        documentDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        valueDate: currentDate.format(DATE_FORMAT),
 | 
			
		||||
                        action: 'BBBBBB',
 | 
			
		||||
                        quantity: 1,
 | 
			
		||||
                        comment: 'BBBBBB'
 | 
			
		||||
                        remark: 'BBBBBB'
 | 
			
		||||
                    },
 | 
			
		||||
                    elemDefault
 | 
			
		||||
                );
 | 
			
		||||
                const expected = Object.assign(
 | 
			
		||||
                    {
 | 
			
		||||
                        date: currentDate
 | 
			
		||||
                        documentDate: currentDate,
 | 
			
		||||
                        valueDate: currentDate
 | 
			
		||||
                    },
 | 
			
		||||
                    returnedFromService
 | 
			
		||||
                );
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user