Git Plugin Config: Adds test for empty config

This commit is contained in:
Johannes Schnatterer
2018-08-01 16:29:37 +02:00
parent aed70d3544
commit 94582554ca

View File

@@ -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 {