Skip to content

Commit 5dc6d25

Browse files
author
Caitlin Bales (MSFT)
committed
Merge branch 'master' of https://github.com/microsoftgraph/msgraph-sdk-java into odata-type
2 parents ab8f465 + 4a79c12 commit 5dc6d25

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

src/main/java/com/microsoft/graph/core/DefaultClientConfig.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public IHttpProvider getHttpProvider() {
106106
getAuthenticationProvider(),
107107
getExecutors(),
108108
getLogger());
109-
logger.logDebug("Created DefaultHttpProvider");
109+
getLogger().logDebug("Created DefaultHttpProvider");
110110
}
111111
return httpProvider;
112112
}
@@ -120,7 +120,7 @@ public IHttpProvider getHttpProvider() {
120120
public ISerializer getSerializer() {
121121
if (serializer == null) {
122122
serializer = new DefaultSerializer(getLogger());
123-
logger.logDebug("Created DefaultSerializer");
123+
getLogger().logDebug("Created DefaultSerializer");
124124
}
125125
return serializer;
126126
}
@@ -134,7 +134,7 @@ public ISerializer getSerializer() {
134134
public IExecutors getExecutors() {
135135
if (executors == null) {
136136
executors = new DefaultExecutors(getLogger());
137-
logger.logDebug("Created DefaultExecutors");
137+
getLogger().logDebug("Created DefaultExecutors");
138138
}
139139
return executors;
140140
}

src/test/java/com/microsoft/graph/core/DefaultClientConfigTests.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
import com.microsoft.graph.authentication.IAuthenticationProvider;
1212
import com.microsoft.graph.authentication.MockAuthenticationProvider;
13+
import com.microsoft.graph.logger.DefaultLogger;
14+
import com.microsoft.graph.logger.ILogger;
1315

1416
/**
1517
* Test cases for {@see DefaultClientConfig}
@@ -36,5 +38,23 @@ public void testDefaultClientConfig() {
3638
assertNotNull(mClientConfig.getAuthenticationProvider());
3739
assertEquals(mAuthenticationProvider, mClientConfig.getAuthenticationProvider());
3840
}
41+
42+
@Test
43+
public void testOverrideLoggerShouldNotThrow() {
44+
final ILogger logger = new DefaultLogger();
45+
DefaultClientConfig config = new DefaultClientConfig() {
46+
47+
@Override
48+
public ILogger getLogger() {
49+
return logger;
50+
}
51+
52+
};
53+
config.getExecutors();
54+
config.getAuthenticationProvider();
55+
config.getHttpProvider();
56+
config.getSerializer();
57+
config.getLogger();
58+
}
3959

4060
}

0 commit comments

Comments
 (0)