Skip to content

Commit

Permalink
MOSIP-37784 Fixed name issue (#1360)
Browse files Browse the repository at this point in the history
* MOSIP-37784 Fixed name issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-37784 Fixed name issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-37784 Fixed test case failure

Signed-off-by: kameshsr <[email protected]>

* MOSIP-37784 Fixed claims issue

Signed-off-by: kameshsr <[email protected]>

---------

Signed-off-by: kameshsr <[email protected]>
  • Loading branch information
kameshsr authored Nov 25, 2024
1 parent 6fcf987 commit e135299
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
\echo 'Upgrade Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION'
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
\echo 'Upgrade Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION'
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
import io.mosip.resident.validator.RequestValidator;
import reactor.util.function.Tuple2;
import reactor.util.function.Tuples;
import io.mosip.resident.constant.RegistrationConstants;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.time.LocalDate;
Expand Down Expand Up @@ -148,17 +148,17 @@ public IdentityDTO getIdentity(String id, boolean fetchFace, String langCode) th
return identityDTO;
}

public String getFullName(Map<String, Object> identity, String langCode) throws ResidentServiceCheckedException, IOException {
if(nameValueList==null){
nameValueList= getNameValueFromIdentityMapping();
public String getFullName(Map<String, Object> identity, String langCode)
throws ResidentServiceCheckedException, IOException {
if (nameValueList == null) {
nameValueList = getNameValueFromIdentityMapping();
}
StringBuilder nameValue = new StringBuilder();
for (String nameString : nameValueList) {
nameValue.append(getValueFromIdentityMapping(nameString, identity, langCode));
}
return String.valueOf(nameValue);
return nameValueList.stream()
.map(nameString -> getValueFromIdentityMapping(nameString, identity, langCode))
.collect(Collectors.joining(RegistrationConstants.SPACE));
}


private String getValueFromIdentityMapping(String nameString, Map<String, Object> identity, String langCode) {
if (nameString == null || identity == null || langCode == null) {
return ""; // Return early if any input is null
Expand Down Expand Up @@ -206,6 +206,7 @@ public List<String> getNameValueFromIdentityMapping() throws ResidentServiceChec
}
return nameValueList;
}


@Override
public Map<String, Object> getIdentityAttributes(String id, String schemaType) throws ResidentServiceCheckedException, IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

import java.io.IOException;
import java.util.Map;

import io.mosip.resident.exception.ResidentServiceCheckedException;
import io.mosip.resident.util.Utility;
import org.junit.Before;
import org.junit.Test;
Expand Down Expand Up @@ -92,7 +94,7 @@ public class IdAuthControllerTest {
private RequestWrapper<IdAuthRequestDto> requestWrapper;

@Before
public void setUp() {
public void setUp() throws ResidentServiceCheckedException, IOException {
MockitoAnnotations.initMocks(this);
this.mockMvc = MockMvcBuilders.standaloneSetup(idAuthController).build();
requestWrapper = new RequestWrapper<IdAuthRequestDto>();
Expand Down

0 comments on commit e135299

Please sign in to comment.