Skip to content
Snippets Groups Projects
Unverified Commit 12005dff authored by Martin Weise's avatar Martin Weise
Browse files

Fixed the test

parent c6281b54
Branches
No related tags found
5 merge requests!231CI: Remove build for log-service,!228Better error message handling in the frontend,!223Release of version 1.4.0,!191Fixed the DataCite issue of minting new dois,!189Resolve "Split Keycloak database from metadata database"
......@@ -3,9 +3,10 @@ package at.tuwien.api.user;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import lombok.extern.jackson.Jacksonized;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
@Getter
@Setter
......@@ -16,14 +17,17 @@ import lombok.extern.jackson.Jacksonized;
@ToString
public class UserAttributesDto {
@NotNull
@JsonIgnore
@org.springframework.data.annotation.Transient
@JsonProperty("theme_dark")
@Schema(example = "false")
private Boolean themeDark;
@Field(name = "orcid", type = FieldType.Keyword)
@Schema(example = "https://orcid.org/0000-0002-1825-0097")
private String orcid;
@Field(name = "affiliation", type = FieldType.Keyword)
@Schema(example = "Brown University")
private String affiliation;
......
......@@ -51,6 +51,7 @@ public class UserDto {
private String lastname;
@NotNull
@Field(name = "attributes", includeInParent = true, type = FieldType.Nested)
private UserAttributesDto attributes;
@NotNull
......
......@@ -29,7 +29,6 @@ import java.util.Map;
import static org.junit.jupiter.api.Assertions.*;
@Log4j2
@Testcontainers
@SpringBootTest
......@@ -272,15 +271,10 @@ public class IndexConfigComponentTest extends BaseUnitTest {
assertEquals("keyword", types.get("id"));
assertEquals("keyword", types.get("username"));
assertEquals("keyword", types.get("name"));
assertEquals("keyword", types.get("orcid"));
assertEquals("keyword", types.get("firstname"));
assertEquals("keyword", types.get("lastname"));
assertNull(types.get("attributes"));
assertNull(types.get("containers"));
assertNull(types.get("databases"));
assertNull(types.get("identifiers"));
assertEquals("nested", types.get("attributes"));
assertNull(types.get("email"));
assertNull(types.get("email_verified"));
}
private Map<String, String> getTypes(String indexName, GetMappingsResponse data) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment