Skip to content

Commit 1564393

Browse files
authored
Merge pull request #2671 from objectcomputing/bugfix-2664/non-required-website
Make the website optional for volunteer organizations.
2 parents 05ae92c + 6796b7d commit 1564393

File tree

4 files changed

+3
-16
lines changed

4 files changed

+3
-16
lines changed

server/src/main/java/com/objectcomputing/checkins/services/volunteering/VolunteeringOrganization.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public class VolunteeringOrganization {
4444
private String description;
4545

4646
@Column(name = "website")
47-
@NotBlank
4847
@Schema(description = "website for the volunteering organization")
4948
private String website;
5049

@@ -59,4 +58,4 @@ public VolunteeringOrganization(String name, String description, String website)
5958
public VolunteeringOrganization(String name, String description, String website, boolean active) {
6059
this(null, name, description, website, active);
6160
}
62-
}
61+
}

server/src/main/java/com/objectcomputing/checkins/services/volunteering/VolunteeringOrganizationDTO.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@ public class VolunteeringOrganizationDTO {
2121
@Schema(description = "description of the volunteering organization")
2222
private String description;
2323

24-
@NotBlank
2524
@Schema(description = "website for the volunteering organization")
2625
private String website;
2726

2827
@Schema(description = "whether the Volunteering Organization is active")
2928
private Boolean active;
3029

31-
public VolunteeringOrganizationDTO(@NotBlank String name, @NotBlank String description, @NotBlank String website) {
30+
public VolunteeringOrganizationDTO(@NotBlank String name, @NotBlank String description, String website) {
3231
this(name, description, website, true);
3332
}
3433
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE volunteering_organization ALTER COLUMN website DROP NOT NULL

server/src/test/java/com/objectcomputing/checkins/services/volunteering/VolunteeringOrganizationControllerTest.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,4 @@ void testCreateOrganizationWithoutDescription() {
148148
String body = e.getResponse().getBody(String.class).get();
149149
assertTrue(body.contains("organization.description: must not be blank"), body + " should contain 'organization.description: must not be blank'");
150150
}
151-
152-
@Test
153-
void testCreateOrganizationWithoutWebsite() {
154-
MemberProfile memberProfile = createADefaultMemberProfile();
155-
String adminAuth = auth(memberProfile.getWorkEmail(), ADMIN_ROLE);
156-
VolunteeringOrganizationDTO org = new VolunteeringOrganizationDTO("name", "description", null);
157-
158-
HttpClientResponseException e = assertThrows(HttpClientResponseException.class, () -> organizationClient.createOrganization(adminAuth, org));
159-
assertEquals(HttpStatus.BAD_REQUEST, e.getStatus());
160-
String body = e.getResponse().getBody(String.class).get();
161-
assertTrue(body.contains("organization.website: must not be blank"), body + " should contain 'organization.website: must not be blank'");
162-
}
163151
}

0 commit comments

Comments
 (0)