File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
main/java/com/twilio/type
test/java/com/twilio/type Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 4
4
5
5
public class Client implements Endpoint {
6
6
7
+ public static final String PREFIX = "client:" ;
8
+
7
9
private final String client ;
8
10
9
11
public Client (String client ) {
12
+ if (!client .toLowerCase ().startsWith (PREFIX )) {
13
+ client = PREFIX + client ;
14
+ }
15
+
10
16
this .client = client ;
11
17
}
12
18
Original file line number Diff line number Diff line change
1
+ package com .twilio .type ;
2
+
3
+ import org .junit .Assert ;
4
+ import org .junit .Test ;
5
+
6
+ public class ClientTest {
7
+
8
+ @ Test
9
+ public void testGetEndpoint () {
10
+ Assert .assertEquals ("client:me" , new Client ("me" ).getEndpoint ());
11
+ Assert .assertEquals ("client:YOU" , new Client ("YOU" ).getEndpoint ());
12
+ Assert .assertEquals ("CLIENT:HIM" , new Client ("CLIENT:HIM" ).getEndpoint ());
13
+ Assert .assertEquals ("cLiEnT:her" , new Client ("cLiEnT:her" ).getEndpoint ());
14
+ }
15
+ }
You can’t perform that action at this time.
0 commit comments