Skip to content
Snippets Groups Projects
Commit 8b041b1e authored by OZGCloud's avatar OZGCloud
Browse files

Revert "OZG-4797 [refactor] rename method"

This reverts commit fc9fb5c8.
parent a56e2ed9
Branches
Tags
No related merge requests found
Showing
with 16 additions and 13 deletions
...@@ -25,11 +25,11 @@ public class ServiceKontoBuildHelper { ...@@ -25,11 +25,11 @@ public class ServiceKontoBuildHelper {
public static final String REST_RESPONSE_NAME_MEMBER_SCOPE = "memberscope"; public static final String REST_RESPONSE_NAME_MEMBER_SCOPE = "memberscope";
public static final String REST_RESPONSE_NAME_MEMBER_SCOPE_MAILBOX_TYPE = "mailboxtype"; public static final String REST_RESPONSE_NAME_MEMBER_SCOPE_MAILBOX_TYPE = "mailboxtype";
public ServiceKonto buildOsiServiceKonto(String postfachId) { public ServiceKonto buildServiceKonto(String postfachId) {
return buildDefault(postfachId); return buildDefault(postfachId);
} }
public ServiceKonto buildOsiServiceKonto(String postfachId, FormData formData) { public ServiceKonto buildServiceKonto(String postfachId, FormData formData) {
return Optional.ofNullable(getRestResponseNames(formData)) return Optional.ofNullable(getRestResponseNames(formData))
.filter(names -> !names.isEmpty()) .filter(names -> !names.isEmpty())
.map(restResponseNames -> buildWithRestResponseNames(postfachId, restResponseNames)) .map(restResponseNames -> buildWithRestResponseNames(postfachId, restResponseNames))
......
...@@ -74,7 +74,7 @@ class AfmHeaderMapper implements AfmEngineBasedMapper { ...@@ -74,7 +74,7 @@ class AfmHeaderMapper implements AfmEngineBasedMapper {
.build(); .build();
Optional.ofNullable(getNameId(formData)) Optional.ofNullable(getNameId(formData))
.map(nameId -> serviceKontoBuildHelper.buildOsiServiceKonto(nameId, formData)) .map(nameId -> serviceKontoBuildHelper.buildServiceKonto(nameId, formData))
.ifPresent(formHeaderBuilder::setServiceKonto); .ifPresent(formHeaderBuilder::setServiceKonto);
return formHeaderBuilder; return formHeaderBuilder;
......
...@@ -66,7 +66,7 @@ class FormSolutionsHeaderMapper implements FormSolutionsEngineBasedMapper { ...@@ -66,7 +66,7 @@ class FormSolutionsHeaderMapper implements FormSolutionsEngineBasedMapper {
.requestId(getRequestId(formData)) .requestId(getRequestId(formData))
.formEngineName(FORM_ENGINE_NAME); .formEngineName(FORM_ENGINE_NAME);
Optional.ofNullable(getPostkorbhandle(formData)).map(serviceKontoBuildHelper::buildOsiServiceKonto).ifPresent(formHeaderBuilder::serviceKonto); Optional.ofNullable(getPostkorbhandle(formData)).map(serviceKontoBuildHelper::buildServiceKonto).ifPresent(formHeaderBuilder::serviceKonto);
return formHeaderBuilder.build(); return formHeaderBuilder.build();
} }
......
...@@ -87,7 +87,7 @@ public class DFoerdermittelFormBasedMapper implements FormBasedMapper { ...@@ -87,7 +87,7 @@ public class DFoerdermittelFormBasedMapper implements FormBasedMapper {
} }
private ServiceKonto createServiceKonto(String postfachId) { private ServiceKonto createServiceKonto(String postfachId) {
return serviceKontoHelper.buildOsiServiceKonto(postfachId); return serviceKontoHelper.buildServiceKonto(postfachId);
} }
FormData parseFachnachricht(FormData formData, IncomingFile fachnachrichtFile) { FormData parseFachnachricht(FormData formData, IncomingFile fachnachrichtFile) {
......
...@@ -18,6 +18,7 @@ import de.ozgcloud.eingang.common.formdata.PostfachAddressTestFactory; ...@@ -18,6 +18,7 @@ import de.ozgcloud.eingang.common.formdata.PostfachAddressTestFactory;
import de.ozgcloud.eingang.common.formdata.ServiceKonto; import de.ozgcloud.eingang.common.formdata.ServiceKonto;
import de.ozgcloud.eingang.common.formdata.StringBasedIdentifier; import de.ozgcloud.eingang.common.formdata.StringBasedIdentifier;
import de.ozgcloud.eingang.common.formdata.ServiceKonto.PostfachAddress; import de.ozgcloud.eingang.common.formdata.ServiceKonto.PostfachAddress;
import de.ozgcloud.eingang.semantik.enginebased.ServiceKontoBuildHelper;
import de.ozgcloud.eingang.semantik.enginebased.afm.AfmHeaderTestFactory; import de.ozgcloud.eingang.semantik.enginebased.afm.AfmHeaderTestFactory;
class ServiceKontoBuildHelperTest { class ServiceKontoBuildHelperTest {
...@@ -66,7 +67,7 @@ class ServiceKontoBuildHelperTest { ...@@ -66,7 +67,7 @@ class ServiceKontoBuildHelperTest {
} }
private ServiceKonto getServiceKonto(FormData formData) { private ServiceKonto getServiceKonto(FormData formData) {
return helper.buildOsiServiceKonto(AfmHeaderTestFactory.POSTFACH_NAME_ID, formData); return helper.buildServiceKonto(AfmHeaderTestFactory.POSTFACH_NAME_ID, formData);
} }
@DisplayName("postfach addresses") @DisplayName("postfach addresses")
...@@ -135,7 +136,7 @@ class ServiceKontoBuildHelperTest { ...@@ -135,7 +136,7 @@ class ServiceKontoBuildHelperTest {
} }
private ServiceKonto buildServiceKonto(FormData formData) { private ServiceKonto buildServiceKonto(FormData formData) {
return helper.buildOsiServiceKonto(AfmHeaderTestFactory.POSTFACH_NAME_ID, formData); return helper.buildServiceKonto(AfmHeaderTestFactory.POSTFACH_NAME_ID, formData);
} }
} }
} }
......
...@@ -37,6 +37,7 @@ import org.mockito.Spy; ...@@ -37,6 +37,7 @@ import org.mockito.Spy;
import de.ozgcloud.eingang.common.formdata.FormData; import de.ozgcloud.eingang.common.formdata.FormData;
import de.ozgcloud.eingang.common.formdata.FormDataUtils; import de.ozgcloud.eingang.common.formdata.FormDataUtils;
import de.ozgcloud.eingang.semantik.enginebased.ServiceKontoBuildHelper; import de.ozgcloud.eingang.semantik.enginebased.ServiceKontoBuildHelper;
import de.ozgcloud.eingang.semantik.enginebased.afm.AfmHeaderMapper;
class AfmHeaderMapperTest { class AfmHeaderMapperTest {
...@@ -110,14 +111,14 @@ class AfmHeaderMapperTest { ...@@ -110,14 +111,14 @@ class AfmHeaderMapperTest {
void shouldCallBuildServiceKontoIfPresent() { void shouldCallBuildServiceKontoIfPresent() {
parseFormData(); parseFormData();
verify(serviceKontoBuildHelper).buildOsiServiceKonto(any(), eq(FORM_DATA)); verify(serviceKontoBuildHelper).buildServiceKonto(any(), eq(FORM_DATA));
} }
@Test @Test
void shouldNotCallBuildServiceKontoIfNotExists() { void shouldNotCallBuildServiceKontoIfNotExists() {
mapper.parseFormData(FormDataUtils.from(FORM_DATA).remove(AfmHeaderMapper.POSTFACH_NAME_ID).build()); mapper.parseFormData(FormDataUtils.from(FORM_DATA).remove(AfmHeaderMapper.POSTFACH_NAME_ID).build());
verify(serviceKontoBuildHelper, never()).buildOsiServiceKonto(any(), any()); verify(serviceKontoBuildHelper, never()).buildServiceKonto(any(), any());
} }
} }
......
...@@ -39,6 +39,7 @@ import de.ozgcloud.eingang.common.formdata.FormData; ...@@ -39,6 +39,7 @@ import de.ozgcloud.eingang.common.formdata.FormData;
import de.ozgcloud.eingang.common.formdata.FormDataUtils; import de.ozgcloud.eingang.common.formdata.FormDataUtils;
import de.ozgcloud.eingang.common.formdata.FormHeader; import de.ozgcloud.eingang.common.formdata.FormHeader;
import de.ozgcloud.eingang.semantik.enginebased.ServiceKontoBuildHelper; import de.ozgcloud.eingang.semantik.enginebased.ServiceKontoBuildHelper;
import de.ozgcloud.eingang.semantik.enginebased.formsolutions.FormSolutionsHeaderMapper;
class FormSolutionsHeaderMapperTest { class FormSolutionsHeaderMapperTest {
...@@ -119,7 +120,7 @@ class FormSolutionsHeaderMapperTest { ...@@ -119,7 +120,7 @@ class FormSolutionsHeaderMapperTest {
void shouldCallServiceKontoBuildHelper() { void shouldCallServiceKontoBuildHelper() {
buildFormHeader(); buildFormHeader();
verify(serviceKontoBuildHelper).buildOsiServiceKonto(any()); verify(serviceKontoBuildHelper).buildServiceKonto(any());
} }
@Test @Test
...@@ -128,7 +129,7 @@ class FormSolutionsHeaderMapperTest { ...@@ -128,7 +129,7 @@ class FormSolutionsHeaderMapperTest {
mapper.buildFormHeader(formDataWithoutPostkorbHandle); mapper.buildFormHeader(formDataWithoutPostkorbHandle);
verify(serviceKontoBuildHelper, never()).buildOsiServiceKonto(any()); verify(serviceKontoBuildHelper, never()).buildServiceKonto(any());
} }
} }
......
...@@ -166,7 +166,7 @@ class DFoerdermittelFormBasedMapperTest { ...@@ -166,7 +166,7 @@ class DFoerdermittelFormBasedMapperTest {
@BeforeEach @BeforeEach
void init() { void init() {
when(serviceKontoHelper.buildOsiServiceKonto(any())).thenReturn(ServiceKontoTestFactory.create()); when(serviceKontoHelper.buildServiceKonto(any())).thenReturn(ServiceKontoTestFactory.create());
} }
@Test @Test
...@@ -183,7 +183,7 @@ class DFoerdermittelFormBasedMapperTest { ...@@ -183,7 +183,7 @@ class DFoerdermittelFormBasedMapperTest {
void shouldRemovePrefix() { void shouldRemovePrefix() {
mapper.addServiceKonto(DFoerdermittelFormDataTestFactory.create(), DFoerdermittelFormDataTestFactory.createFachnachrichtMap()); mapper.addServiceKonto(DFoerdermittelFormDataTestFactory.create(), DFoerdermittelFormDataTestFactory.createFachnachrichtMap());
verify(serviceKontoHelper).buildOsiServiceKonto(DFoerdermittelFormDataTestFactory.POSTFACH_ID); verify(serviceKontoHelper).buildServiceKonto(DFoerdermittelFormDataTestFactory.POSTFACH_ID);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment