mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 23:45:44 +01:00
Fixes NPE in HgConfigPackageResource for non-existing packages.
This commit is contained in:
@@ -152,10 +152,11 @@ public class HgConfigPackageResourceTest {
|
||||
|
||||
@Test
|
||||
@SubjectAware(username = "writeOnly")
|
||||
public void shouldHandleMissingPackageId() throws Exception {
|
||||
|
||||
MockHttpResponse response = put(null);
|
||||
assertEquals(HttpServletResponse.SC_METHOD_NOT_ALLOWED, response.getStatus());
|
||||
public void shouldHandlePackagesThatAreNotFound() throws Exception {
|
||||
String packageId = "this-package-does-not-ex";
|
||||
when(hgPackageReader.getPackage(packageId)).thenReturn(null);
|
||||
MockHttpResponse response = put(packageId);
|
||||
assertEquals(HttpServletResponse.SC_NOT_FOUND, response.getStatus());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user