// Path: sonar-connector/src/main/java/com/thepracticaldeveloper/devgame/modules/configuration/dao/SonarServerConfigurationDao.java
// public interface SonarServerConfigurationDao {
// 
//     SonarServerConfiguration getConfiguration();
// 
// }
// 
// Path: sonar-connector/src/main/java/com/thepracticaldeveloper/devgame/modules/configuration/domain/SonarServerConfiguration.java
// public class SonarServerConfiguration {
//     private String url;
//     private String token;
//     private String organization;
// 
//     public SonarServerConfiguration() {
//     }
// 
//     public SonarServerConfiguration(final String url, final String token, final String organization) {
//         this.url = url;
//         this.token = token;
//         this.organization = organization;
//     }
// 
//     public String getUrl() {
//         return url;
//     }
// 
//     public String getToken() {
//         return token;
//     }
// 
//     public String getOrganization() {
//         return organization;
//     }
// 
//     @Override
//     public String toString() {
//         return "SonarServerConfiguration{" +
//                 "url='" + url + '\'' +
//                 ", token='" + token + '\'' +
//                 ", organization='" + organization + '\'' +
//                 '}';
//     }
// }
// 
// Path: sonar-connector/src/main/java/com/thepracticaldeveloper/devgame/modules/configuration/domain/sonar/SonarAuthenticationResponse.java
// public final class SonarAuthenticationResponse {
// 
//     private boolean valid;
// 
//     @JsonCreator
//     public SonarAuthenticationResponse(@JsonProperty(value = "valid") boolean valid) {
//         this.valid = valid;
//     }
// 
//     public boolean isValid() {
//         return valid;
//     }
// 
//     @Override
//     public String toString() {
//         return "SonarAuthenticationResponse{" +
//                 "valid=" + valid +
//                 '}';
//     }
// }
// 
// Path: sonar-connector/src/main/java/com/thepracticaldeveloper/devgame/modules/configuration/domain/sonar/SonarServerStatus.java
// public final class SonarServerStatus {
// 
//     public enum Key {
//         UP,
//         UNAUTHORIZED,
//         CONNECTION_ERROR,
//         UNKNOWN_ERROR
//     }
// 
//     public static final String STATUS_UP = "UP";
// 
//     private final String id;
//     private final String version;
//     private final String status;
//     private final String message;
// 
//     @JsonCreator
//     public SonarServerStatus(@JsonProperty("id") String id, @JsonProperty("version") String version, @JsonProperty("status") String status, @JsonProperty("message") final String message) {
//         this.id = id;
//         this.version = version;
//         this.status = status;
//         this.message = message;
//     }
// 
//     public SonarServerStatus(final Key status, final String message) {
//         this(null, null, status.name(), message);
//     }
// 
//     public SonarServerStatus(final Key status) {
//         this(null, null, status.name(), null);
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public String getVersion() {
//         return version;
//     }
// 
//     public String getStatus() {
//         return status;
//     }
// 
//     public String getMessage() {
//         return message;
//     }
// }


import com.thepracticaldeveloper.devgame.modules.configuration.dao.SonarServerConfigurationDao;
import com.thepracticaldeveloper.devgame.modules.configuration.domain.SonarServerConfiguration;
import com.thepracticaldeveloper.devgame.modules.configuration.domain.sonar.SonarAuthenticationResponse;
import com.thepracticaldeveloper.devgame.modules.configuration.domain.sonar.SonarServerStatus;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.client.ResourceAccessException;
import org.springframework.web.client.RestTemplate;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.when;
package com.thepracticaldeveloper.devgame.modules.configuration.service;



public class SonarServerConfigurationServiceTest {

    @Mock
// Path: sonar-connector/src/main/java/com/thepracticaldeveloper/devgame/modules/configuration/dao/SonarServerConfigurationDao.java
// public interface SonarServerConfigurationDao {
// 
//     SonarServerConfiguration getConfiguration();
// 
// }
// 
// Path: sonar-connector/src/main/java/com/thepracticaldeveloper/devgame/modules/configuration/domain/SonarServerConfiguration.java
// public class SonarServerConfiguration {
//     private String url;
//     private String token;
//     private String organization;
// 
//     public SonarServerConfiguration() {
//     }
// 
//     public SonarServerConfiguration(final String url, final String token, final String organization) {
//         this.url = url;
//         this.token = token;
//         this.organization = organization;
//     }
// 
//     public String getUrl() {
//         return url;
//     }
// 
//     public String getToken() {
//         return token;
//     }
// 
//     public String getOrganization() {
//         return organization;
//     }
// 
//     @Override
//     public String toString() {
//         return "SonarServerConfiguration{" +
//                 "url='" + url + '\'' +
//                 ", token='" + token + '\'' +
//                 ", organization='" + organization + '\'' +
//                 '}';
//     }
// }
// 
// Path: sonar-connector/src/main/java/com/thepracticaldeveloper/devgame/modules/configuration/domain/sonar/SonarAuthenticationResponse.java
// public final class SonarAuthenticationResponse {
// 
//     private boolean valid;
// 
//     @JsonCreator
//     public SonarAuthenticationResponse(@JsonProperty(value = "valid") boolean valid) {
//         this.valid = valid;
//     }
// 
//     public boolean isValid() {
//         return valid;
//     }
// 
//     @Override
//     public String toString() {
//         return "SonarAuthenticationResponse{" +
//                 "valid=" + valid +
//                 '}';
//     }
// }
// 
// Path: sonar-connector/src/main/java/com/thepracticaldeveloper/devgame/modules/configuration/domain/sonar/SonarServerStatus.java
// public final class SonarServerStatus {
// 
//     public enum Key {
//         UP,
//         UNAUTHORIZED,
//         CONNECTION_ERROR,
//         UNKNOWN_ERROR
//     }
// 
//     public static final String STATUS_UP = "UP";
// 
//     private final String id;
//     private final String version;
//     private final String status;
//     private final String message;
// 
//     @JsonCreator
//     public SonarServerStatus(@JsonProperty("id") String id, @JsonProperty("version") String version, @JsonProperty("status") String status, @JsonProperty("message") final String message) {
//         this.id = id;
//         this.version = version;
//         this.status = status;
//         this.message = message;
//     }
// 
//     public SonarServerStatus(final Key status, final String message) {
//         this(null, null, status.name(), message);
//     }
// 
//     public SonarServerStatus(final Key status) {
//         this(null, null, status.name(), null);
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public String getVersion() {
//         return version;
//     }
// 
//     public String getStatus() {
//         return status;
//     }
// 
//     public String getMessage() {
//         return message;
//     }
// }


// Path: sonar-connector/src/test/java/com/thepracticaldeveloper/devgame/modules/configuration/service/SonarServerConfigurationServiceTest.java
import com.thepracticaldeveloper.devgame.modules.configuration.dao.SonarServerConfigurationDao;
import com.thepracticaldeveloper.devgame.modules.configuration.domain.SonarServerConfiguration;
import com.thepracticaldeveloper.devgame.modules.configuration.domain.sonar.SonarAuthenticationResponse;
import com.thepracticaldeveloper.devgame.modules.configuration.domain.sonar.SonarServerStatus;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.client.ResourceAccessException;
import org.springframework.web.client.RestTemplate;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.when;

package com.thepracticaldeveloper.devgame.modules.configuration.service;



public class SonarServerConfigurationServiceTest {

    @Mock
    private SonarServerConfigurationDao sonarServerConfigurationDaoMock;