File tree Expand file tree Collapse file tree
Kepware.Api.Test/ApiClient Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,6 +100,9 @@ protected void ConfigureConnectedClient(
100100
101101 _httpMessageHandlerMock . SetupRequest ( HttpMethod . Get , $ "{ TEST_ENDPOINT } /config/v1/doc")
102102 . ReturnsResponse ( HttpStatusCode . OK , statusResponse , "application/json" ) ;
103+
104+ _httpMessageHandlerMock . SetupRequest ( HttpMethod . Get , $ "{ TEST_ENDPOINT } /config/v1/project")
105+ . ReturnsResponse ( HttpStatusCode . OK , "[]" , "application/json" ) ;
103106 }
104107
105108 protected Channel CreateTestChannel ( string name = "TestChannel" , string driver = "Advanced Simulator" )
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ public partial class KepwareApiClient : IKepwareDefaultValueProvider
3333 private const string ENDPOINT_STATUS = "/config/v1/status" ;
3434 private const string ENDPOINT_DOC = "/config/v1/doc" ;
3535 private const string ENDPOINT_ABOUT = "/config/v1/about" ;
36+ private const string ENDPOINT_PROJECT = "/config/v1/project" ;
3637
3738 private readonly ILogger < KepwareApiClient > m_logger ;
3839 private readonly HttpClient m_httpClient ;
@@ -243,7 +244,8 @@ private async Task<bool> TestCredentialsAsync(CancellationToken cancellationToke
243244 bool hasValidCredentials = false ;
244245 try
245246 {
246- var response = await m_httpClient . GetAsync ( ENDPOINT_DOC , cancellationToken ) . ConfigureAwait ( false ) ;
247+
248+ var response = await m_httpClient . GetAsync ( ENDPOINT_PROJECT , cancellationToken ) . ConfigureAwait ( false ) ;
247249 hasValidCredentials = response . IsSuccessStatusCode ;
248250 if ( hasValidCredentials )
249251 {
You can’t perform that action at this time.
0 commit comments