From e8b694dd005c793b606452252da075c21f31e127 Mon Sep 17 00:00:00 2001 From: mnhock Date: Mon, 8 May 2023 20:45:01 +0200 Subject: [PATCH] Add username to developer model --- pom.xml | 4 ++-- .../java/com/enofex/naikan/model/Developer.java | 15 +++++++++++---- .../deserializer/json/JsonDeserializerTest.java | 1 + 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index d21cf3e..25f9c37 100644 --- a/pom.xml +++ b/pom.xml @@ -28,6 +28,7 @@ UTF-8 UTF-8 + 0.0.2 2.11.0 2.15.0 1.0.81 @@ -41,7 +42,6 @@ 3.2.1 3.3.0 1.6.0 - 0.0.1 @@ -147,7 +147,7 @@ 20 - + diff --git a/src/main/java/com/enofex/naikan/model/Developer.java b/src/main/java/com/enofex/naikan/model/Developer.java index f4ec558..df47930 100644 --- a/src/main/java/com/enofex/naikan/model/Developer.java +++ b/src/main/java/com/enofex/naikan/model/Developer.java @@ -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 { @@ -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; @@ -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; @@ -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); } } } diff --git a/src/test/java/com/enofex/naikan/model/deserializer/json/JsonDeserializerTest.java b/src/test/java/com/enofex/naikan/model/deserializer/json/JsonDeserializerTest.java index 836e183..b1a35ee 100644 --- a/src/test/java/com/enofex/naikan/model/deserializer/json/JsonDeserializerTest.java +++ b/src/test/java/com/enofex/naikan/model/deserializer/json/JsonDeserializerTest.java @@ -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()),