Skip to content

Commit

Permalink
fix: a few more smelly public methods
Browse files Browse the repository at this point in the history
  • Loading branch information
trev-dev committed Sep 14, 2023
1 parent bf76d20 commit f247dbe
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void testGetNotes_GivenInvalidExchangeId_ExpectReturns404NotFound() throws Excep
// test get notes with valid exchangeid returns notes
@Test
@Transactional
public void testGetNotes_GivenValidExchangeId_ExpectReturns200OkWithNotes() throws Exception {
void testGetNotes_GivenValidExchangeId_ExpectReturns200OkWithNotes() throws Exception {
ObjectMapper objectMapper1 = new ObjectMapper();
SecureExchangeEntity entity = this.secureExchangeRequestRepository.save(exchangeMapper.toModel(this.getSecureExchangeEntityFromJsonString()));
SecureExchangeNoteEntity note = noteMapper.toModel(objectMapper1.readValue(
Expand Down Expand Up @@ -140,7 +140,7 @@ void testGetNotes_GivenValidExchangeIdWithNoNotes_ExpectReturns204NoContent() th

@Test
@Transactional
public void testDeleteNotes_GivenValidExchangeId_ExpectReturns204NoContentWithoutNotes() throws Exception {
void testDeleteNotes_GivenValidExchangeId_ExpectReturns204NoContentWithoutNotes() throws Exception {
ObjectMapper objectMapper1 = new ObjectMapper();
SecureExchangeEntity entity = this.secureExchangeRequestRepository.save(exchangeMapper.toModel(this.getSecureExchangeEntityFromJsonString()));
SecureExchangeNoteEntity note = noteMapper.toModel(objectMapper1.readValue(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void testAddSecureExchangeStudents_BothIdentifiersShouldReturnStatusBadRequest()

@Test
@Transactional
public void testDeleteSecureExchangeStudents_ShouldReturnStatusNoContent_AndShouldDeleteFromExchange() throws Exception {
void testDeleteSecureExchangeStudents_ShouldReturnStatusNoContent_AndShouldDeleteFromExchange() throws Exception {
SecureExchangeEntity entity = createSecureExchangeEntityWithStudents(Arrays.asList(LEGIT_STUDENT_ID));
final String sid = entity.getSecureExchangeID().toString();
List<SecureExchangeStudentEntity> students = new ArrayList<>();
Expand All @@ -160,7 +160,7 @@ public void testDeleteSecureExchangeStudents_ShouldReturnStatusNoContent_AndShou

@Test
@Transactional
public void testGetStudentsFromExchange_shouldReceiveStatusOK_withListOfStudents() throws Exception {
void testGetStudentsFromExchange_shouldReceiveStatusOK_withListOfStudents() throws Exception {
final SecureExchangeEntity entity = createSecureExchangeEntityWithStudents(Arrays.asList(LEGIT_STUDENT_ID, UUID.randomUUID().toString()));
final String sid = entity.getSecureExchangeID().toString();
this.mockMvc.perform(get(URL.BASE_URL_SECURE_EXCHANGE + "/" + URL.SECURE_EXCHANGE_ID_STUDENTS, sid)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,24 +171,24 @@ public void findPrimaryEdxActivationCodeOnlyReturnsPrimaryEdxActivationCodeForSc
});
}

@Test()
public void findPrimaryEdxActivationCodeOnlyReturnsPrimaryEdxActivationCodeForDistrict() {
@Test
void findPrimaryEdxActivationCodeOnlyReturnsPrimaryEdxActivationCodeForDistrict() {
assertThrows(EntityNotFoundException.class, () -> {
EdxActivationCodeEntity secondaryEdxActivationCode = this.edxActivationCodeRepository.save(this.createEdxActivationCodeEntity(UUID.randomUUID().toString(), false, true, UUID.randomUUID(), 0, null, UUID.randomUUID()));
EdxActivationCodeEntity found = this.service.findPrimaryEdxActivationCode(InstituteTypeCode.DISTRICT, secondaryEdxActivationCode.getDistrictID().toString());
assertThat(found.getEdxActivationCodeId()).isNotNull().isNotEqualTo(secondaryEdxActivationCode.getEdxActivationCodeId());
});
}

@Test()
public void findPrimaryEdxActivationCodeCannotFindNonExistingEdxActivationCodeForSchool() {
@Test
void findPrimaryEdxActivationCodeCannotFindNonExistingEdxActivationCodeForSchool() {
assertThrows(EntityNotFoundException.class, () -> {
this.service.findPrimaryEdxActivationCode(InstituteTypeCode.SCHOOL, UUID.randomUUID().toString());
});
}

@Test()
public void findPrimaryEdxActivationCodeCannotFindNonExistingEdxActivationCodeForDistrict() {
@Test
void findPrimaryEdxActivationCodeCannotFindNonExistingEdxActivationCodeForDistrict() {
assertThrows(EntityNotFoundException.class, () -> {
this.service.findPrimaryEdxActivationCode(InstituteTypeCode.DISTRICT, UUID.randomUUID().toString());
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SecureExchangeNoteServiceGetDeleteTests extends BaseSecureExchangeAPITest

@Test
@Transactional
public void testDeleteNoteFromExchange() {
void testDeleteNoteFromExchange() {
SecureExchangeEntity entity = this.secureExchangeRequestRepository.save(
addNoteToSecureExchangeEntity(createSecureExchange())
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void tearDown() {

@Test
@Transactional
public void createSecureExchange() {
void createSecureExchange() {
var ministryTeam = this.ministryOwnershipTeamRepository.save(getMinistryOwnershipEntity("Test Team", "TEST_TEAM"));
var secureExchange = new SecureExchangeBuilder()
.withoutSecureExchangeID().build();
Expand All @@ -74,7 +74,7 @@ public void createSecureExchange() {

@Test
@Transactional
public void createSecureExchangeWithDocuments() {
void createSecureExchangeWithDocuments() {
var ministryTeam = this.ministryOwnershipTeamRepository.save(getMinistryOwnershipEntity("Test Team", "TEST_TEAM"));
var secureExchange = new SecureExchangeBuilder()
.withoutSecureExchangeID().build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class SecureExchangeStudentServiceAddTests extends BaseSecureExchangeAPITest {

@Test
@Transactional
public void testAddStudentToExchange() throws Exception {
void testAddStudentToExchange() throws Exception {
SecureExchangeEntity entity = this.secureExchangeRequestRepository.save(createSecureExchange());
SecureExchange secureExchange = createSecureExchangeFromEntityWithStudent(LEGIT_STUDENT_ID, entity);
doReturn(secureExchange).when(secureExchangeStudentServiceMock).addStudentToExchange(any(UUID.class), any(SecureExchangeStudent.class));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class SecureExchangeStudentServiceGetDeleteTests extends BaseSecureExchangeAPITe

@Test
@Transactional
public void testDeleteStudentFromExchange() {
void testDeleteStudentFromExchange() {
SecureExchangeEntity entity = this.secureExchangeRequestRepository.save(
addStudentToSecureExchangeEntity(createSecureExchange(), UUID.fromString(LEGIT_STUDENT_ID))
);
Expand All @@ -57,7 +57,7 @@ public void testDeleteStudentFromExchange() {

@Test
@Transactional
public void testGetStudentIDsFromExchange(){
void testGetStudentIDsFromExchange(){
SecureExchangeEntity entity = addStudentToSecureExchangeEntity(createSecureExchange(), UUID.fromString(LEGIT_STUDENT_ID));
addStudentToSecureExchangeEntity(entity, UUID.randomUUID());
entity = this.secureExchangeRequestRepository.save(entity);
Expand Down

0 comments on commit f247dbe

Please sign in to comment.