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

Fixed the test

parent c6281b54
No related branches found
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; ...@@ -3,9 +3,10 @@ package at.tuwien.api.user;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.*; import lombok.*;
import lombok.extern.jackson.Jacksonized; import lombok.extern.jackson.Jacksonized;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
@Getter @Getter
@Setter @Setter
...@@ -16,14 +17,17 @@ import lombok.extern.jackson.Jacksonized; ...@@ -16,14 +17,17 @@ import lombok.extern.jackson.Jacksonized;
@ToString @ToString
public class UserAttributesDto { public class UserAttributesDto {
@NotNull @JsonIgnore
@org.springframework.data.annotation.Transient
@JsonProperty("theme_dark") @JsonProperty("theme_dark")
@Schema(example = "false") @Schema(example = "false")
private Boolean themeDark; private Boolean themeDark;
@Field(name = "orcid", type = FieldType.Keyword)
@Schema(example = "https://orcid.org/0000-0002-1825-0097") @Schema(example = "https://orcid.org/0000-0002-1825-0097")
private String orcid; private String orcid;
@Field(name = "affiliation", type = FieldType.Keyword)
@Schema(example = "Brown University") @Schema(example = "Brown University")
private String affiliation; private String affiliation;
......
...@@ -51,6 +51,7 @@ public class UserDto { ...@@ -51,6 +51,7 @@ public class UserDto {
private String lastname; private String lastname;
@NotNull @NotNull
@Field(name = "attributes", includeInParent = true, type = FieldType.Nested)
private UserAttributesDto attributes; private UserAttributesDto attributes;
@NotNull @NotNull
......
...@@ -29,7 +29,6 @@ import java.util.Map; ...@@ -29,7 +29,6 @@ import java.util.Map;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;
@Log4j2 @Log4j2
@Testcontainers @Testcontainers
@SpringBootTest @SpringBootTest
...@@ -272,15 +271,10 @@ public class IndexConfigComponentTest extends BaseUnitTest { ...@@ -272,15 +271,10 @@ public class IndexConfigComponentTest extends BaseUnitTest {
assertEquals("keyword", types.get("id")); assertEquals("keyword", types.get("id"));
assertEquals("keyword", types.get("username")); assertEquals("keyword", types.get("username"));
assertEquals("keyword", types.get("name")); assertEquals("keyword", types.get("name"));
assertEquals("keyword", types.get("orcid"));
assertEquals("keyword", types.get("firstname")); assertEquals("keyword", types.get("firstname"));
assertEquals("keyword", types.get("lastname")); assertEquals("keyword", types.get("lastname"));
assertNull(types.get("attributes")); assertEquals("nested", types.get("attributes"));
assertNull(types.get("containers"));
assertNull(types.get("databases"));
assertNull(types.get("identifiers"));
assertNull(types.get("email")); assertNull(types.get("email"));
assertNull(types.get("email_verified"));
} }
private Map<String, String> getTypes(String indexName, GetMappingsResponse data) { 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