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

OZG-4797 [refactor] rename method

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