Skip to content

Commit

Permalink
refactor: Rename 'VerificationStatusService.get' functions to dedicat…
Browse files Browse the repository at this point in the history
…ed function names
  • Loading branch information
JPPortier committed Mar 12, 2024
1 parent 810a144 commit ad08384
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public interface VerificationStatusService {
* @return Verification report response
* @since 1.0
*/
VerificationReport get(NumberIdentity identity, VerificationMethodType method);
VerificationReport getByIdentity(NumberIdentity identity, VerificationMethodType method);

/**
* Queries the verification result by sending the verification ID. With this query you can get the
Expand All @@ -38,7 +38,7 @@ public interface VerificationStatusService {
* @return Verification report response
* @since 1.0
*/
VerificationReport get(VerificationId id);
VerificationReport getById(VerificationId id);

/**
* Queries the verification result by sending the verification Reference. With this query you can
Expand All @@ -48,5 +48,5 @@ public interface VerificationStatusService {
* @return Verification report response
* @since 1.0
*/
VerificationReport get(VerificationReference reference);
VerificationReport getByReference(VerificationReference reference);
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ protected QueryVerificationsApi getApi() {
return this.api;
}

public VerificationReport get(NumberIdentity identity, VerificationMethodType method) {
public VerificationReport getByIdentity(NumberIdentity identity, VerificationMethodType method) {

return VerificationsDtoConverter.convert(
getApi().verificationStatusByIdentity("number", identity.getEndpoint(), method.value()));
}

public VerificationReport get(VerificationId id) {
public VerificationReport getById(VerificationId id) {

return VerificationsDtoConverter.convert(getApi().verificationStatusById(id.getId()));
}

public VerificationReport get(VerificationReference reference) {
public VerificationReport getByReference(VerificationReference reference) {

return VerificationsDtoConverter.convert(
getApi().verificationStatusByReference(reference.getReference()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void getByIdentity() throws ApiException {
.thenReturn(VerificationReportDtoTest.expectedVerificationCalloutDto);

VerificationReport response =
service.get(
service.getByIdentity(
NumberIdentity.builder().setEndpoint("endpoint string").build(),
VerificationMethodType.SMS);

Expand All @@ -63,7 +63,7 @@ void getById() throws ApiException {
when(api.verificationStatusById(eq("the id")))
.thenReturn(VerificationReportDtoTest.expectedVerificationCalloutDto);

VerificationReport response = service.get(VerificationId.valueOf("the id"));
VerificationReport response = service.getById(VerificationId.valueOf("the id"));

Assertions.assertThat(response)
.usingRecursiveComparison()
Expand All @@ -76,7 +76,8 @@ void getByReference() throws ApiException {
when(api.verificationStatusByReference(eq("the reference")))
.thenReturn(VerificationReportDtoTest.expectedVerificationCalloutDto);

VerificationReport response = service.get(VerificationReference.valueOf("the reference"));
VerificationReport response =
service.getByReference(VerificationReference.valueOf("the reference"));

Assertions.assertThat(response)
.usingRecursiveComparison()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void run() {

LOGGER.info("Get status by id for : " + id);

VerificationReport response = client.verification().verificationStatus().get(id);
VerificationReport response = client.verification().verificationStatus().getById(id);
LOGGER.info("Response :" + response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public void run() {

VerificationMethodType method = VerificationMethodType.SMS;

VerificationReport response = client.verification().verificationStatus().get(identity, method);
VerificationReport response =
client.verification().verificationStatus().getByIdentity(identity, method);
LOGGER.info("Response :" + response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public void run() {

LOGGER.info("Get status by reference for: '" + reference + "'");

VerificationReport response = client.verification().verificationStatus().get(reference);
VerificationReport response =
client.verification().verificationStatus().getByReference(reference);
LOGGER.info("Response :" + response);
}
}

0 comments on commit ad08384

Please sign in to comment.