Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void testCreateBatchesForManyRecipients() {
List<String> firstEmailGroup = recipients.subList(0, MailJetSender.MAILJET_RECIPIENT_LIMIT);
for (int i = 0; i < MailJetSender.MAILJET_RECIPIENT_LIMIT; i++) {
Object email = firstBatch.getJSONObject(i).get("Email");
assertTrue(email instanceof String);
assertInstanceOf(String.class, email);
assertTrue(firstEmailGroup.contains(email));
}

Expand All @@ -53,7 +53,7 @@ void testCreateBatchesForManyRecipients() {
List<String> secondEmailGroup = recipients.subList(MailJetSender.MAILJET_RECIPIENT_LIMIT, numRecipients);
for (int i = 0; i < 10; i++) {
Object email = secondBatch.getJSONObject(i).get("Email");
assertTrue(email instanceof String);
assertInstanceOf(String.class, email);
assertTrue(secondEmailGroup.contains(email));
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.objectcomputing.checkins.services.action_item;


import com.fasterxml.jackson.databind.JsonNode;
import com.objectcomputing.checkins.services.TestContainersSuite;
import com.objectcomputing.checkins.services.checkins.CheckIn;
Expand All @@ -10,28 +9,31 @@
import com.objectcomputing.checkins.services.fixture.RoleFixture;
import com.objectcomputing.checkins.services.memberprofile.MemberProfile;
import com.objectcomputing.checkins.services.role.Role;

import io.micronaut.core.type.Argument;
import io.micronaut.http.HttpRequest;
import io.micronaut.http.HttpResponse;
import io.micronaut.http.HttpStatus;
import io.micronaut.http.client.HttpClient;
import io.micronaut.http.client.annotation.Client;
import io.micronaut.http.client.exceptions.HttpClientResponseException;

import jakarta.inject.Inject;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import jakarta.inject.Inject;
import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;

import static com.objectcomputing.checkins.services.role.RoleType.Constants.*;
import static org.junit.Assert.assertNotNull;
import static com.objectcomputing.checkins.services.role.RoleType.Constants.ADMIN_ROLE;
import static com.objectcomputing.checkins.services.role.RoleType.Constants.MEMBER_ROLE;
import static com.objectcomputing.checkins.services.role.RoleType.Constants.PDL_ROLE;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;


class ActionItemControllerTest extends TestContainersSuite implements MemberProfileFixture, RoleFixture, CheckInFixture, ActionItemFixture {

@Inject
Expand All @@ -42,6 +44,7 @@ class ActionItemControllerTest extends TestContainersSuite implements MemberProf
void createRolesAndPermissions() {
createAndAssignRoles();
}

@Test
void testCreateAnActionItemByAdmin() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,25 @@
import io.micronaut.http.client.HttpClient;
import io.micronaut.http.client.annotation.Client;
import io.micronaut.http.client.exceptions.HttpClientResponseException;

import jakarta.inject.Inject;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import jakarta.inject.Inject;

import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;

import static com.objectcomputing.checkins.services.role.RoleType.Constants.*;
import static org.junit.Assert.assertNotNull;
import static com.objectcomputing.checkins.services.role.RoleType.Constants.ADMIN_ROLE;
import static com.objectcomputing.checkins.services.role.RoleType.Constants.MEMBER_ROLE;
import static com.objectcomputing.checkins.services.role.RoleType.Constants.PDL_ROLE;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;


public class AgendaItemControllerTest extends TestContainersSuite implements MemberProfileFixture, CheckInFixture, AgendaItemFixture, RoleFixture {
class AgendaItemControllerTest extends TestContainersSuite implements MemberProfileFixture, CheckInFixture, AgendaItemFixture, RoleFixture {

@Inject
@Client("/services/agenda-items")
Expand All @@ -40,6 +43,7 @@ public class AgendaItemControllerTest extends TestContainersSuite implements Mem
void createRolesAndPermissions() {
createAndAssignRoles();
}

@Test
void testCreateAgendaItemByAdmin() {
MemberProfile memberProfileOfPDL = createADefaultMemberProfile();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,24 @@
import io.micronaut.http.client.HttpClient;
import io.micronaut.http.client.annotation.Client;
import io.micronaut.http.client.exceptions.HttpClientResponseException;

import jakarta.inject.Inject;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import jakarta.inject.Inject;
import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;

import static com.objectcomputing.checkins.services.role.RoleType.Constants.ADMIN_ROLE;
import static com.objectcomputing.checkins.services.role.RoleType.Constants.PDL_ROLE;
import static org.junit.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;


public class CheckinNoteControllerTest extends TestContainersSuite implements MemberProfileFixture, CheckInFixture, CheckInNoteFixture, RoleFixture {
class CheckinNoteControllerTest extends TestContainersSuite implements MemberProfileFixture, CheckInFixture, CheckInNoteFixture, RoleFixture {

@Inject
@Client("/services/checkin-notes")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.objectcomputing.checkins.services.TestContainersSuite;
import com.objectcomputing.checkins.services.checkins.CheckIn;
import com.objectcomputing.checkins.services.fixture.*;
import com.objectcomputing.checkins.services.fixture.CheckInDocumentFixture;
import com.objectcomputing.checkins.services.fixture.CheckInFixture;
import com.objectcomputing.checkins.services.fixture.MemberProfileFixture;
import com.objectcomputing.checkins.services.fixture.RepositoryFixture;
import com.objectcomputing.checkins.services.fixture.RoleFixture;
import com.objectcomputing.checkins.services.memberprofile.MemberProfile;
import com.objectcomputing.checkins.services.role.Role;
import io.micronaut.core.type.Argument;
Expand All @@ -14,20 +18,22 @@
import io.micronaut.http.client.HttpClient;
import io.micronaut.http.client.annotation.Client;
import io.micronaut.http.client.exceptions.HttpClientResponseException;

import jakarta.inject.Inject;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
import jakarta.inject.Inject;
import java.util.*;
import java.util.stream.Collectors;

import static org.junit.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;


public class CheckinDocumentControllerTest extends TestContainersSuite implements RepositoryFixture, MemberProfileFixture,
class CheckinDocumentControllerTest extends TestContainersSuite implements RepositoryFixture, MemberProfileFixture,
RoleFixture, CheckInFixture, CheckInDocumentFixture {

@Inject
Expand All @@ -38,6 +44,7 @@ public class CheckinDocumentControllerTest extends TestContainersSuite implement
void createRolesAndPermissions() {
createAndAssignRoles();
}

@Test
void testCreateACheckinDocument() {
MemberProfile memberProfile = createADefaultMemberProfile();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
import java.util.stream.Collectors;

import static com.objectcomputing.checkins.services.role.RoleType.Constants.*;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;

public class CheckInControllerTest extends TestContainersSuite implements MemberProfileFixture, CheckInFixture, RoleFixture {
class CheckInControllerTest extends TestContainersSuite implements MemberProfileFixture, CheckInFixture, RoleFixture {

@Inject
@Client("/services/check-ins")
Expand All @@ -39,8 +39,9 @@ public class CheckInControllerTest extends TestContainersSuite implements Member
void createRolesAndPermissions() {
createAndAssignRoles();
}

@Test
public void testCreateACheckInByAdmin() {
void testCreateACheckInByAdmin() {
MemberProfile memberProfileOfPDL = createADefaultMemberProfile();
MemberProfile memberProfileOfUser = createADefaultMemberProfileForPdl(memberProfileOfPDL);
Role role = assignAdminRole(memberProfileOfUser);
Expand All @@ -64,7 +65,7 @@ public void testCreateACheckInByAdmin() {
}

@Test
public void testCreateACheckInByMember() {
void testCreateACheckInByMember() {
MemberProfile memberProfileOfPDL = createADefaultMemberProfile();
MemberProfile memberProfileOfUser = createADefaultMemberProfileForPdl(memberProfileOfPDL);
Role role = assignMemberRole(memberProfileOfUser);
Expand All @@ -88,7 +89,7 @@ public void testCreateACheckInByMember() {
}

@Test
public void testCreateACheckInByPDL() {
void testCreateACheckInByPDL() {
MemberProfile memberProfileOfPDL = createADefaultMemberProfile();
MemberProfile memberProfileOfUser = createADefaultMemberProfileForPdl(memberProfileOfPDL);
Role role = assignPdlRole(memberProfileOfPDL);
Expand All @@ -112,7 +113,7 @@ public void testCreateACheckInByPDL() {
}

@Test
public void testCreateACheckInByUnrelatedUser() {
void testCreateACheckInByUnrelatedUser() {
MemberProfile memberProfileOfPDL = createADefaultMemberProfile();
MemberProfile memberProfileOfUser = createADefaultMemberProfileForPdl(memberProfileOfPDL);
MemberProfile memberProfileOfMrNobody = createAnUnrelatedUser();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@

import static com.objectcomputing.checkins.services.role.RoleType.Constants.ADMIN_ROLE;
import static com.objectcomputing.checkins.services.role.RoleType.Constants.MEMBER_ROLE;
import static org.junit.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;

public class EmployeeHoursControllerTest extends TestContainersSuite implements MemberProfileFixture, RoleFixture, EmployeeHoursFixture {
class EmployeeHoursControllerTest extends TestContainersSuite implements MemberProfileFixture, RoleFixture, EmployeeHoursFixture {

@Inject
@Client("/services/employee/hours")
Expand Down Expand Up @@ -136,7 +136,7 @@ void testFindAllRecordsWithNonAdminRole() {
}

@Test
public void testGetByIdNotFound() {
void testGetByIdNotFound() {

final HttpRequest<Object> request = HttpRequest.
GET(String.format("/%s", UUID.randomUUID().toString())).basicAuth(ADMIN_ROLE,ADMIN_ROLE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,20 @@
import org.junit.jupiter.api.Test;

import java.time.LocalDate;
import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;

import static com.objectcomputing.checkins.services.role.RoleType.Constants.ADMIN_ROLE;
import static com.objectcomputing.checkins.services.role.RoleType.Constants.MEMBER_ROLE;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;

public class MemberSkillControllerTest extends TestContainersSuite implements MemberProfileFixture, SkillFixture, MemberSkillFixture {
class MemberSkillControllerTest extends TestContainersSuite implements MemberProfileFixture, SkillFixture, MemberSkillFixture {

@Inject
@Client("/services/member-skills")
Expand Down Expand Up @@ -81,8 +86,8 @@ void testCreateAMemberSkillWithNullableFieldsNull() {
assertEquals(memberSkill, response.body());
assertEquals(HttpStatus.CREATED, response.getStatus());
assertEquals(String.format("%s/%s", request.getPath(), memberSkill.getId()), response.getHeaders().get("location"));
assertEquals(memberSkill.getSkilllevel(), null);
assertEquals(memberSkill.getLastuseddate(), null);
assertNull(memberSkill.getSkilllevel());
assertNull(memberSkill.getLastuseddate());
}

@Test
Expand Down Expand Up @@ -316,7 +321,7 @@ void testFindMemberSkillsBySkillId() {
}

@Test
public void testPUTUpdateMemberSkill() {
void testPUTUpdateMemberSkill() {

MemberProfile memberProfile = createADefaultMemberProfile();
Skill skill = createADefaultSkill();
Expand All @@ -335,7 +340,7 @@ public void testPUTUpdateMemberSkill() {
}

@Test
public void testPUTUpdateNullMemberSkill() {
void testPUTUpdateNullMemberSkill() {

final HttpRequest<String> request = HttpRequest.PUT("", "").basicAuth(MEMBER_ROLE, MEMBER_ROLE);
HttpClientResponseException responseException = assertThrows(HttpClientResponseException.class,
Expand All @@ -352,7 +357,7 @@ public void testPUTUpdateNullMemberSkill() {
}

@Test
public void testPUTUpdateNonexistentMemberSkill() {
void testPUTUpdateNonexistentMemberSkill() {

MemberProfile memberProfile = createADefaultMemberProfile();
Skill skill = createADefaultSkill();
Expand Down
Loading