Skip to content

Commit

Permalink
Add username to developer model
Browse files Browse the repository at this point in the history
  • Loading branch information
mnhock committed May 8, 2023
1 parent 180eec7 commit e8b694d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<naikan-test.version>0.0.2</naikan-test.version>
<commons-io.version>2.11.0</commons-io.version>
<jackson-datatype-jsr310.version>2.15.0</jackson-datatype-jsr310.version>
<json-schema-validator.version>1.0.81</json-schema-validator.version>
Expand All @@ -41,7 +42,6 @@
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
<maven-enforcer-plugin.version>3.3.0</maven-enforcer-plugin.version>
<jreleaser-maven-plugin.version>1.6.0</jreleaser-maven-plugin.version>
<naikan-test.version>0.0.1</naikan-test.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -147,7 +147,7 @@
<requireJavaVersion>
<version>20</version>
</requireJavaVersion>
</rules>
</rules>
</configuration>
</execution>
<execution>
Expand Down
15 changes: 11 additions & 4 deletions src/main/java/com/enofex/naikan/model/Developer.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.enofex.naikan.model;

public record Developer(String name, String title, String department, String email, String phone,
String organization, String organizationUrl, String timezone,
public record Developer(String name, String username, String title, String department, String email,
String phone, String organization, String organizationUrl, String timezone,
String description, Roles roles) {

public Developer {
Expand All @@ -15,6 +15,7 @@ public static Builder builder() {
public static final class Builder {

private String name;
private String username;
private String department;
private String title;
private String email;
Expand All @@ -33,6 +34,11 @@ public Builder name(String name) {
return this;
}

public Builder username(String username) {
this.username = username;
return this;
}

public Builder title(String title) {
this.title = title;
return this;
Expand Down Expand Up @@ -79,8 +85,9 @@ public Builder roles(Roles roles) {
}

public Developer build() {
return new Developer(this.name, this.title, this.department, this.email, this.phone,
this.organization, this.organizationUrl, this.timezone, this.description, this.roles);
return new Developer(this.name, this.username, this.title, this.department, this.email,
this.phone, this.organization, this.organizationUrl, this.timezone, this.description,
this.roles);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ void shouldDeserializeValidModel() throws DeserializerException {

() -> assertEquals(1, bom.developers().all().size()),
() -> assertEquals("Trev Cooksey", bom.developers().all().get(0).name()),
() -> assertEquals("cytrev", bom.developers().all().get(0).username()),
() -> assertEquals("Principal Software Engineer", bom.developers().all().get(0).title()),
() -> assertEquals("Naikan Software Engineering",
bom.developers().all().get(0).department()),
Expand Down

0 comments on commit e8b694d

Please sign in to comment.