Merged in bugfix/remove_obsolete_repository_fields (pull request #416)

remove obsolete repository fields
This commit is contained in:
Sebastian Sdorra
2020-03-03 15:40:02 +00:00
6 changed files with 11 additions and 36 deletions

View File

@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed
- Enunciate rest documentation
- Obsolete fields in data transfer objects
## 2.0.0-rc4 - 2020-02-14
### Added

View File

@@ -12,9 +12,10 @@ import sonia.scm.util.ValidationUtil;
import javax.validation.constraints.Pattern;
import java.time.Instant;
import java.util.List;
import java.util.Map;
@Getter @Setter @NoArgsConstructor
@Getter
@Setter
@NoArgsConstructor
public class GroupDto extends HalRepresentation {
private Instant creationDate;
@@ -24,7 +25,6 @@ public class GroupDto extends HalRepresentation {
@Pattern(regexp = ValidationUtil.REGEX_NAME)
private String name;
private String type;
private Map<String, String> properties;
private List<String> members;
private boolean external;

View File

@@ -7,16 +7,17 @@ import de.otto.edison.hal.Links;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import sonia.scm.util.ValidationUtil;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.time.Instant;
import java.util.List;
import java.util.Map;
@Getter @Setter @NoArgsConstructor
@Getter
@Setter
@NoArgsConstructor
public class RepositoryDto extends HalRepresentation {
@Email
@@ -30,10 +31,8 @@ public class RepositoryDto extends HalRepresentation {
private String namespace;
@Pattern(regexp = ValidationUtil.REGEX_REPOSITORYNAME)
private String name;
private boolean archived = false;
@NotEmpty
private String type;
protected Map<String, String> properties;
RepositoryDto(Links links, Embedded embedded) {
super(links, embedded);

View File

@@ -7,13 +7,12 @@ import de.otto.edison.hal.Links;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import sonia.scm.util.ValidationUtil;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.time.Instant;
import java.util.Map;
@NoArgsConstructor @Getter @Setter
public class UserDto extends HalRepresentation {
@@ -30,7 +29,6 @@ public class UserDto extends HalRepresentation {
@JsonInclude(JsonInclude.Include.NON_NULL)
private String password;
private String type;
private Map<String, String> properties;
UserDto(Links links, Embedded embedded) {
super(links, embedded);

View File

@@ -138,19 +138,6 @@ public class RepositoryRootResourceTest extends RepositoryTestBase {
assertTrue(response.getContentAsString().contains("\"name\":\"repo\""));
}
@Test
public void shouldMapProperties() throws URISyntaxException, UnsupportedEncodingException {
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, UnsupportedEncodingException {
PageResult<Repository> singletonPageResult = createSingletonPageResult(mockRepository("space", "repo"));

View File

@@ -77,16 +77,6 @@ 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() {