mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
Remove direct dependency to UriInfo
This commit is contained in:
@@ -61,7 +61,7 @@ public class HgConfigInstallationsResourceTest {
|
||||
new HgConfigResource(null, null, null, null,
|
||||
null, resourceProvider));
|
||||
|
||||
when(uriInfoStore.get().getBaseUri()).thenReturn(baseUri);
|
||||
when(uriInfoStore.get().getApiRestUri()).thenReturn(baseUri);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -34,7 +34,7 @@ public class HgConfigInstallationsToDtoMapperTest {
|
||||
|
||||
@Before
|
||||
public void init() {
|
||||
when(uriInfoStore.get().getBaseUri()).thenReturn(baseUri);
|
||||
when(uriInfoStore.get().getApiRestUri()).thenReturn(baseUri);
|
||||
expectedBaseUri = baseUri.resolve(HgConfigResource.HG_CONFIG_PATH_V2 + "/installations/" + expectedPath);
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ public class HgConfigPackageResourceTest {
|
||||
public void prepareEnvironment() {
|
||||
setupResources();
|
||||
|
||||
when(uriInfoStore.get().getBaseUri()).thenReturn(baseUri);
|
||||
when(uriInfoStore.get().getApiRestUri()).thenReturn(baseUri);
|
||||
|
||||
when(hgPackageReader.getPackages().getPackages()).thenReturn(createPackages());
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package sonia.scm.api.v2.resources;
|
||||
|
||||
import de.otto.edison.hal.HalRepresentation;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -13,12 +12,10 @@ import sonia.scm.installer.HgPackages;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static sonia.scm.api.v2.resources.HgConfigTests.assertEqualsPackage;
|
||||
import static sonia.scm.api.v2.resources.HgConfigTests.createPackage;
|
||||
@@ -38,7 +35,7 @@ public class HgConfigPackagesToDtoMapperTest {
|
||||
|
||||
@Before
|
||||
public void init() {
|
||||
when(uriInfoStore.get().getBaseUri()).thenReturn(baseUri);
|
||||
when(uriInfoStore.get().getApiRestUri()).thenReturn(baseUri);
|
||||
expectedBaseUri = baseUri.resolve(HgConfigResource.HG_CONFIG_PATH_V2 + "/packages");
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ public class HgConfigResourceTest {
|
||||
new HgConfigResource(dtoToConfigMapper, configToDtoMapper, repositoryHandler, packagesResource,
|
||||
autoconfigResource, installationsResource);
|
||||
dispatcher.getRegistry().addSingletonResource(gitConfigResource);
|
||||
when(uriInfoStore.get().getBaseUri()).thenReturn(baseUri);
|
||||
when(uriInfoStore.get().getApiRestUri()).thenReturn(baseUri);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -41,7 +41,7 @@ public class HgConfigToHgConfigDtoMapperTest {
|
||||
|
||||
@Before
|
||||
public void init() {
|
||||
when(uriInfoStore.get().getBaseUri()).thenReturn(baseUri);
|
||||
when(uriInfoStore.get().getApiRestUri()).thenReturn(baseUri);
|
||||
expectedBaseUri = baseUri.resolve(HgConfigResource.HG_CONFIG_PATH_V2);
|
||||
subjectThreadState.bind();
|
||||
ThreadContext.bind(subject);
|
||||
|
||||
Reference in New Issue
Block a user