Skip to content

Commit

Permalink
SonaCloud fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mamartinezmejia committed Dec 3, 2024
1 parent 6a94d5a commit baa8144
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,23 +117,23 @@ public Flux<ClientListDto> fullSearch(
return clientLegacyService
.search(page, size, keyword)
.doOnNext(pair -> {
Long count = pair.getSecond();
Long count = pair.getSecond();

serverResponse
.getHeaders()
.putIfAbsent(
ApplicationConstant.X_TOTAL_COUNT,
List.of(count.toString())
);
serverResponse
.getHeaders()
.putIfAbsent(
ApplicationConstant.X_TOTAL_COUNT,
List.of(count.toString())
);
})
.map(Pair::getFirst)
.doFinally(signalType ->
serverResponse
.getHeaders()
.putIfAbsent(
ApplicationConstant.X_TOTAL_COUNT,
List.of("0")
)
serverResponse
.getHeaders()
.putIfAbsent(
ApplicationConstant.X_TOTAL_COUNT,
List.of("0")
)
);
}

Expand All @@ -154,12 +154,12 @@ public Flux<ClientLookUpDto> findByClientName(@PathVariable String name) {
/**
* Finds a client based on their registration number.
*
* This endpoint retrieves client information by searching for a registration number.
* <p>This endpoint retrieves client information by searching for a registration number.
* If no client is found, an error is returned.
*
* @param registrationNumber the registration number of the client to look up
* @return a {@link Mono} emitting the {@link ClientLookUpDto} if found, or an error
* if no data exists
* if no data exists
*/
@GetMapping(value = "/incorporation/{registrationNumber}")
public Mono<ClientLookUpDto> findByRegistrationNumber(
Expand All @@ -175,7 +175,7 @@ public Mono<ClientLookUpDto> findByRegistrationNumber(
/**
* Searches for an individual client by user ID and last name.
*
* This endpoint fetches an individual client using their user ID and last name.
* <p>This endpoint fetches an individual client using their user ID and last name.
* The request is validated against existing records in the system.
*
* @param userId the unique identifier of the individual to search for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
import reactor.core.publisher.Mono;

/**
* This class is responsible for interacting with the legacy API to fetch client data. It uses the
* WebClient to send HTTP requests to the legacy API and converts the responses into Flux of
* ForestClientDto objects. It provides several methods to search for clients in the legacy system
* using different search criteria.
* <p>
* It is annotated with @Slf4j for logging, @Service to indicate that it's a Spring service bean,
* and @Observed for metrics.
* <p>
* Each method logs the search parameters and the results for debugging purposes.
* This class is responsible for interacting with the legacy API to fetch client data.
* It uses the WebClient to send HTTP requests to the legacy API and converts the responses
* into Flux of ForestClientDto objects. It provides several methods to search for clients
* in the legacy system using different search criteria.
*
* <p>It is annotated with @Slf4j for logging, @Service to indicate that it's a
* Spring service bean, and @Observed for metrics.
*
* <p>Each method logs the search parameters and the results for debugging purposes.
*/
@Slf4j
@Service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@Slf4j
@DisplayName("Integrated Test | FSA Client District Service")
public class ClientDistrictServiceIntegrationTest extends AbstractTestContainerIntegrationTest {
class ClientDistrictServiceIntegrationTest extends AbstractTestContainerIntegrationTest {

@Autowired
private ClientDistrictService service;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import reactor.test.StepVerifier;

@DisplayName("Integrated Test | Client Service")
public class ClientServiceIntegrationTest extends AbstractTestContainerIntegrationTest {
class ClientServiceIntegrationTest extends AbstractTestContainerIntegrationTest {

@Autowired
private ClientService service;
Expand Down

0 comments on commit baa8144

Please sign in to comment.