Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(FSADT1-1524): updating response content #1212

Merged
merged 7 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package ca.bc.gov.app.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.commons.lang3.StringUtils;
Expand All @@ -22,14 +21,14 @@ public record PredictiveSearchResultDto(

@JsonProperty("name")
public String name() {
if (StringUtils.isNotBlank(this.clientFirstName)) {
return Stream.of(this.clientFirstName, this.clientMiddleName, this.clientName)
.filter(Objects::nonNull)
.map(String::trim)
.collect(Collectors.joining(" "));
} else {
return this.clientName;
}
String finalName = Stream.of(this.clientFirstName, this.clientMiddleName, this.clientName)
.filter(StringUtils::isNotBlank)
.map(String::trim)
.collect(Collectors.joining(" "));

return StringUtils.isNotBlank(this.doingBusinessAs)
? finalName + " (" + this.doingBusinessAs + ")"
: finalName;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Flux<ForestClientEntity> findClientByIncorporationOrName(
c.legal_middle_name as client_middle_name,
cl.city as city,
ctc.description as client_type,
c.client_status_code as status_code,
csc.description as status_code,
(
CASE WHEN c.client_number = :value THEN 112 ELSE 0 END +
CASE WHEN c.CLIENT_ACRONYM = :value THEN 111 ELSE 0 END +
Expand All @@ -85,6 +85,7 @@ Flux<ForestClientEntity> findClientByIncorporationOrName(
LEFT JOIN the.CLIENT_DOING_BUSINESS_AS dba ON c.client_number = dba.client_number
LEFT JOIN the.CLIENT_TYPE_CODE ctc ON c.client_type_code = ctc.client_type_code
LEFT JOIN the.CLIENT_LOCATION cl ON c.client_number = cl.client_number
LEFT JOIN the.CLIENT_STATUS_CODE csc ON c.client_status_code = csc.client_status_code
WHERE
(
c.client_number = :value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,7 @@ void shouldSearchPredicatively(
.consumeWith(System.out::println);
}else{
response.expectStatus().isOk()
.expectBody()
.consumeWith(System.out::println).json("[]");
.expectBody().isEmpty();
}

}
Expand Down
Loading