From 29801037647a634035088d3cd141eef283886b09 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Mon, 29 Apr 2019 15:18:45 +0200 Subject: [PATCH] run createSepaMandate test now as FINANCIAL_CONTACT of related customer --- .../web/rest/SepaMandateResourceIntTest.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/test/java/org/hostsharing/hsadminng/web/rest/SepaMandateResourceIntTest.java b/src/test/java/org/hostsharing/hsadminng/web/rest/SepaMandateResourceIntTest.java index 0414ce68..a54f7a1d 100644 --- a/src/test/java/org/hostsharing/hsadminng/web/rest/SepaMandateResourceIntTest.java +++ b/src/test/java/org/hostsharing/hsadminng/web/rest/SepaMandateResourceIntTest.java @@ -8,6 +8,7 @@ import org.hostsharing.hsadminng.service.SepaMandateQueryService; import org.hostsharing.hsadminng.service.SepaMandateService; import org.hostsharing.hsadminng.service.accessfilter.MockSecurityContext; import org.hostsharing.hsadminng.service.accessfilter.Role; +import org.hostsharing.hsadminng.service.dto.CustomerDTO; import org.hostsharing.hsadminng.service.dto.SepaMandateDTO; import org.hostsharing.hsadminng.service.mapper.SepaMandateMapper; import org.hostsharing.hsadminng.web.rest.errors.ExceptionTranslator; @@ -179,6 +180,12 @@ public class SepaMandateResourceIntTest { // Create the SepaMandate SepaMandateDTO sepaMandateDTO = sepaMandateMapper.toDto(sepaMandate); sepaMandateDTO.setCustomerPrefix(null); + sepaMandateDTO.setRemark(null); + sepaMandateDTO.setRevokationDocumentDate(null); + sepaMandateDTO.setLastUsedDate(null); + MockSecurityContext.givenAuthenticatedUser(); + MockSecurityContext.givenUserHavingRole(CustomerDTO.class, sepaMandateDTO.getCustomerId(), Role.FINANCIAL_CONTACT); + restSepaMandateMockMvc.perform(post("/api/sepa-mandates") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(sepaMandateDTO))) @@ -192,11 +199,11 @@ public class SepaMandateResourceIntTest { assertThat(testSepaMandate.getIban()).isEqualTo(DEFAULT_IBAN); assertThat(testSepaMandate.getBic()).isEqualTo(DEFAULT_BIC); assertThat(testSepaMandate.getGrantingDocumentDate()).isEqualTo(DEFAULT_GRANTING_DOCUMENT_DATE); - assertThat(testSepaMandate.getRevokationDocumentDate()).isEqualTo(DEFAULT_REVOKATION_DOCUMENT_DATE); + assertThat(testSepaMandate.getRevokationDocumentDate()).isNull(); assertThat(testSepaMandate.getValidFromDate()).isEqualTo(DEFAULT_VALID_FROM_DATE); assertThat(testSepaMandate.getValidUntilDate()).isEqualTo(DEFAULT_VALID_UNTIL_DATE); - assertThat(testSepaMandate.getLastUsedDate()).isEqualTo(DEFAULT_LAST_USED_DATE); - assertThat(testSepaMandate.getRemark()).isEqualTo(DEFAULT_REMARK); + assertThat(testSepaMandate.getLastUsedDate()).isNull(); + assertThat(testSepaMandate.getRemark()).isNull(); } @Test