File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
main/java/com/microsoft/graph/authentication
test/java/com/microsoft/graph/authentication Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public void setCustomHosts(@Nonnull String[] customHosts) {
3333 */
3434 @ Nullable
3535 public String [] getCustomHosts (){
36- return ( String []) this . customHosts .toArray ( );
36+ return customHosts . toArray ( new String [customHosts .size ()] );
3737 }
3838 /**
3939 * Determines whether a request should be authenticated or not based on it's url.
Original file line number Diff line number Diff line change 11package com .microsoft .graph .authentication ;
22
3- import static org .junit .jupiter .api .Assertions .assertFalse ;
4- import static org .junit .jupiter .api .Assertions .assertTrue ;
5-
63import java .net .MalformedURLException ;
74import java .net .URL ;
85import java .util .Arrays ;
118
129import org .junit .jupiter .api .Test ;
1310
11+ import static org .junit .jupiter .api .Assertions .*;
12+
1413public class BaseAuthenticationProviderTest {
1514 final BaseAuthenticationProvider authProvider = new BaseAuthenticationProvider () {
1615
@@ -78,5 +77,7 @@ public void providerAddsTokenToCustomHosts() throws MalformedURLException {
7877
7978 //Assert
8079 assertTrue (result );
80+ assertEquals (authProvider .getCustomHosts ().length , 1 );
81+ assertEquals (authProvider .getCustomHosts ()[0 ], "localhost.com" );
8182 }
8283}
You can’t perform that action at this time.
0 commit comments