diff --git a/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/api/v2/resources/GitConfigResourceTest.java b/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/api/v2/resources/GitConfigResourceTest.java index 2389f4abd7..feed89aa8f 100644 --- a/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/api/v2/resources/GitConfigResourceTest.java +++ b/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/api/v2/resources/GitConfigResourceTest.java @@ -87,6 +87,17 @@ public class GitConfigResourceTest { assertTrue(responseString.contains("\"update\":{\"href\":\"/v2/config/git")); } + @Test + @SubjectAware(username = "readWrite") + public void shouldGetGitConfigEvenWhenItsEmpty() throws URISyntaxException, IOException { + when(repositoryHandler.getConfig()).thenReturn(null); + + MockHttpResponse response = get(); + String responseString = response.getContentAsString(); + + assertTrue(responseString.contains("\"disabled\":false")); + } + @Test @SubjectAware(username = "readOnly") public void shouldGetGitConfigWithoutUpdateLink() throws URISyntaxException {