mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-17 02:31:14 +01:00
Map properties of repositories
This commit is contained in:
@@ -101,6 +101,19 @@ public class RepositoryRootResourceTest {
|
||||
assertTrue(response.getContentAsString().contains("\"name\":\"repo\""));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldMapProperties() throws URISyntaxException {
|
||||
Repository repository = mockRepository("space", "repo");
|
||||
repository.setProperty("testKey", "testValue");
|
||||
|
||||
MockHttpRequest request = MockHttpRequest.get("/" + RepositoryRootResource.REPOSITORIES_PATH_V2 + "space/repo");
|
||||
MockHttpResponse response = new MockHttpResponse();
|
||||
|
||||
dispatcher.invoke(request, response);
|
||||
|
||||
assertTrue(response.getContentAsString().contains("\"testKey\":\"testValue\""));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldGetAll() throws URISyntaxException {
|
||||
PageResult<Repository> singletonPageResult = createSingletonPageResult(mockRepository("space", "repo"));
|
||||
|
||||
@@ -57,6 +57,16 @@ public class RepositoryToRepositoryDtoMapperTest {
|
||||
assertEquals("none@example.com", dto.getContact());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldMapPropertiesProperty() {
|
||||
Repository repository = createTestRepository();
|
||||
repository.setProperty("testKey", "testValue");
|
||||
|
||||
RepositoryDto dto = mapper.map(repository);
|
||||
|
||||
assertEquals("testValue", dto.getProperties().get("testKey"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@SubjectAware(username = "unpriv")
|
||||
public void shouldCreateLinksForUnprivilegedUser() {
|
||||
|
||||
Reference in New Issue
Block a user