Skip to content

Commit

Permalink
refactor: SMS context enable undefined region and default value is ma…
Browse files Browse the repository at this point in the history
…naged by SinchClient
  • Loading branch information
JPPortier committed Feb 28, 2024
1 parent a5aaeaa commit 1f0d3ed
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 18 deletions.
4 changes: 2 additions & 2 deletions client/src/main/com/sinch/sdk/models/SmsContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ public class SmsContext {
private final SMSRegion smsRegion;
private final String smsUrl;

public SmsContext(SMSRegion smsRegion, String smsUrl) {
this.smsRegion = null == smsRegion ? SMSRegion.US : smsRegion;
private SmsContext(SMSRegion smsRegion, String smsUrl) {
this.smsRegion = smsRegion;
this.smsUrl = smsUrl;
}

Expand Down
9 changes: 9 additions & 0 deletions client/src/test/java/com/sinch/sdk/SinchClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ void defaultSmsUrlAvailable() {
assertNotNull(client.getConfiguration().getSmsContext().get().getSmsUrl());
}

@Test
void defaultSmsRegion() {
Configuration configuration =
Configuration.builder().setKeyId("foo").setKeySecret("foo").setProjectId("foo").build();
SinchClient client = new SinchClient(configuration);
System.out.println(client.getConfiguration().getSmsContext().get().getSmsRegion());
assertNotNull(client.getConfiguration().getSmsContext().get().getSmsRegion());
}

@Test
void defaultVerificationUrlAvailable() {
Configuration configuration =
Expand Down
16 changes: 0 additions & 16 deletions client/src/test/java/com/sinch/sdk/models/SmsContextTest.java

This file was deleted.

0 comments on commit 1f0d3ed

Please sign in to comment.