mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 09:46:16 +01:00
Fix peer review issues
This commit is contained in:
@@ -27,12 +27,12 @@ public class HgConfigInIndexResource extends JsonEnricherBase {
|
||||
@Override
|
||||
public void enrich(JsonEnricherContext context) {
|
||||
if (resultHasMediaType(INDEX, context) && ConfigurationPermissions.list().isPermitted()) {
|
||||
String gitConfigUrl = new LinkBuilder(scmPathInfoStore.get().get(), HgConfigResource.class)
|
||||
String hgConfigUrl = new LinkBuilder(scmPathInfoStore.get().get(), HgConfigResource.class)
|
||||
.method("get")
|
||||
.parameters()
|
||||
.href();
|
||||
|
||||
JsonNode hgConfigRefNode = createObject(singletonMap("href", value(gitConfigUrl)));
|
||||
JsonNode hgConfigRefNode = createObject(singletonMap("href", value(hgConfigUrl)));
|
||||
|
||||
addPropertyNode(context.getResponseEntity().get("_links"), "hgConfig", hgConfigRefNode);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import javax.ws.rs.core.MediaType;
|
||||
import java.net.URI;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
||||
@SubjectAware(configuration = "classpath:sonia/scm/configuration/shiro.ini")
|
||||
public class HgConfigInIndexResourceTest {
|
||||
@@ -39,7 +40,6 @@ public class HgConfigInIndexResourceTest {
|
||||
|
||||
hgConfigInIndexResource.enrich(context);
|
||||
|
||||
System.out.println(root);
|
||||
assertEquals("/v2/config/hg", root.get("_links").get("hgConfig").get("href").asText());
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public class HgConfigInIndexResourceTest {
|
||||
|
||||
hgConfigInIndexResource.enrich(context);
|
||||
|
||||
System.out.println(root);
|
||||
assertFalse(root.get("_links").iterator().hasNext());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -59,6 +59,6 @@ public class HgConfigInIndexResourceTest {
|
||||
|
||||
hgConfigInIndexResource.enrich(context);
|
||||
|
||||
System.out.println(root);
|
||||
assertFalse(root.get("_links").iterator().hasNext());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user