@@ -4,12 +4,6 @@ sonarqube { | |||
} | |||
} | |||
configurations { | |||
tests | |||
testCompile.extendsFrom tests | |||
} | |||
dependencies { | |||
// please keep the list grouped by configuration and ordered by name | |||
@@ -28,7 +22,6 @@ dependencies { | |||
compileOnly 'com.google.code.findbugs:jsr305' | |||
compileOnly 'javax.servlet:javax.servlet-api' | |||
testCompile 'com.google.code.findbugs:jsr305' | |||
testCompile 'com.tngtech.java:junit-dataprovider' | |||
testCompile 'javax.servlet:javax.servlet-api' | |||
testCompile 'org.apache.logging.log4j:log4j-api' | |||
@@ -38,14 +31,11 @@ dependencies { | |||
testCompile testFixtures(project(':server:sonar-server-common')) | |||
testCompile project(':sonar-testing-harness') | |||
testCompileOnly 'com.google.code.findbugs:jsr305' | |||
runtime 'io.jsonwebtoken:jjwt-jackson' | |||
} | |||
task testJar(type: Jar) { | |||
classifier = 'tests' | |||
from sourceSets.test.output | |||
} | |||
testFixturesApi 'junit:junit' | |||
artifacts { | |||
tests testJar | |||
testFixturesCompileOnly 'com.google.code.findbugs:jsr305' | |||
} |
@@ -26,6 +26,7 @@ import java.util.Optional; | |||
import org.sonar.db.user.GroupDto; | |||
import org.sonar.db.user.UserDto; | |||
import org.sonar.server.user.AbstractUserSession; | |||
import org.sonar.server.user.UserSession; | |||
import static com.google.common.base.Preconditions.checkArgument; | |||
import static java.util.Arrays.asList; | |||
@@ -39,8 +40,8 @@ public class MockUserSession extends AbstractMockUserSession<MockUserSession> { | |||
private Integer userId; | |||
private String name; | |||
private List<GroupDto> groups = new ArrayList<>(); | |||
private IdentityProvider identityProvider; | |||
private ExternalIdentity externalIdentity; | |||
private UserSession.IdentityProvider identityProvider; | |||
private UserSession.ExternalIdentity externalIdentity; | |||
public MockUserSession(String login) { | |||
super(MockUserSession.class); | |||
@@ -59,7 +60,7 @@ public class MockUserSession extends AbstractMockUserSession<MockUserSession> { | |||
setUuid(userDto.getUuid()); | |||
setUserId(userDto.getId()); | |||
setName(userDto.getName()); | |||
AbstractUserSession.Identity identity = computeIdentity(userDto); | |||
AbstractUserSession.Identity identity = AbstractUserSession.computeIdentity(userDto); | |||
this.identityProvider = identity.getIdentityProvider(); | |||
this.externalIdentity = identity.getExternalIdentity(); | |||
} | |||
@@ -124,11 +125,11 @@ public class MockUserSession extends AbstractMockUserSession<MockUserSession> { | |||
} | |||
@Override | |||
public Optional<IdentityProvider> getIdentityProvider() { | |||
public Optional<UserSession.IdentityProvider> getIdentityProvider() { | |||
return Optional.ofNullable(identityProvider); | |||
} | |||
public void setExternalIdentity(IdentityProvider identityProvider, ExternalIdentity externalIdentity) { | |||
public void setExternalIdentity(UserSession.IdentityProvider identityProvider, UserSession.ExternalIdentity externalIdentity) { | |||
checkArgument(identityProvider != SONARQUBE); | |||
this.identityProvider = identityProvider; | |||
this.externalIdentity = requireNonNull(externalIdentity); | |||
@@ -140,7 +141,7 @@ public class MockUserSession extends AbstractMockUserSession<MockUserSession> { | |||
} | |||
@Override | |||
public Optional<ExternalIdentity> getExternalIdentity() { | |||
public Optional<UserSession.ExternalIdentity> getExternalIdentity() { | |||
return Optional.ofNullable(externalIdentity); | |||
} | |||
@@ -71,7 +71,7 @@ dependencies { | |||
testCompile 'org.mockito:mockito-core' | |||
testCompile 'org.subethamail:subethasmtp' | |||
testCompile testFixtures(project(':server:sonar-server-common')) | |||
testCompile project(path: ":server:sonar-webserver-auth", configuration: "tests") | |||
testCompile testFixtures(project(':server:sonar-webserver-auth')) | |||
testCompile project(path: ":server:sonar-webserver-es", configuration: "tests") | |||
testCompile testFixtures(project(':server:sonar-webserver-ws')) | |||
testCompile project(':sonar-testing-harness') |
@@ -27,7 +27,7 @@ dependencies { | |||
testCompile 'com.google.code.findbugs:jsr305' | |||
testCompile 'com.tngtech.java:junit-dataprovider' | |||
testCompile 'org.mockito:mockito-core' | |||
testCompile project(path: ":server:sonar-webserver-auth", configuration: "tests") | |||
testCompile testFixtures(project(':server:sonar-webserver-auth')) | |||
testCompile testFixtures(project(':server:sonar-server-common')) | |||
testCompile project(':sonar-testing-harness') | |||
} |
@@ -34,7 +34,7 @@ dependencies { | |||
testCompile 'javax.servlet:javax.servlet-api' | |||
testCompile 'org.mockito:mockito-core' | |||
testCompile testFixtures(project(':server:sonar-server-common')) | |||
testCompile project(path: ":server:sonar-webserver-auth", configuration: "tests") | |||
testCompile testFixtures(project(':server:sonar-webserver-auth')) | |||
testCompile project(path: ":server:sonar-webserver-es", configuration: "tests") | |||
testCompile testFixtures(project(':server:sonar-webserver-ws')) | |||
testCompile project(':sonar-testing-harness') |
@@ -27,7 +27,7 @@ dependencies { | |||
testCompile 'org.eclipse.jetty:jetty-server' | |||
testCompile 'org.eclipse.jetty:jetty-servlet' | |||
testCompile testFixtures(project(':server:sonar-server-common')) | |||
testCompile project(path: ":server:sonar-webserver-auth", configuration: "tests") | |||
testCompile testFixtures(project(':server:sonar-webserver-auth')) | |||
testCompile project(path: ":server:sonar-webserver-es", configuration: "tests") | |||
testCompile project(':sonar-testing-harness') | |||
} |