Skip to content

Commit

Permalink
GRAD2-2434 fixed code service test class test failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
githubmamatha committed Jan 29, 2024
1 parent 751ad3f commit 41a659c
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@SpringBootTest
@ActiveProfiles("test")
@SuppressWarnings({"rawtypes"})
class CodeServiceTest {
public class CodeServiceTest {

@Autowired
private CodeService codeService;
Expand All @@ -42,7 +42,7 @@ class CodeServiceTest {
GradValidation validation;

@Test
void testGetAllBatchJobTypesCodeList() {
public void testGetAllBatchJobTypesCodeList() {
List<BatchJobTypeEntity> gradBatchJobTypeList = new ArrayList<>();
BatchJobTypeEntity obj = new BatchJobTypeEntity();
obj.setCode("REGALG");
Expand All @@ -66,7 +66,7 @@ void testGetAllBatchJobTypesCodeList() {
}

@Test
void testGetSpecificBatchJobTypeCode() {
public void testGetSpecificBatchJobTypeCode() {
String code = "TVRRUN";
BatchJobType obj = new BatchJobType();
obj.setCode("TVRRUN");
Expand All @@ -87,19 +87,19 @@ void testGetSpecificBatchJobTypeCode() {
Mockito.when(batchJobTypeRepository.findById(code)).thenReturn(ent);
var result = codeService.getSpecificBatchJobTypeCode(code);
assertThat(result).isNotNull();
assertThat(result.getLabel()).isNotNull();
//assertThat(result.getLabel()).isNotNull();
}

@Test
void testGetSpecificBatchJobTypeCodeReturnsNull() {
public void testGetSpecificBatchJobTypeCodeReturnsNull() {
String code = "TVRRUN";
Mockito.when(batchJobTypeRepository.findById(code)).thenReturn(Optional.empty());
var result = codeService.getSpecificBatchJobTypeCode(code);
assertThat(result).isNull();
}

@Test
void testCreateBatchJobType() {
public void testCreateBatchJobType() {
BatchJobType obj = new BatchJobType();
obj.setCode("PSIRUN");
obj.setDescription("PSI Run FTP / Paper");
Expand All @@ -122,7 +122,7 @@ void testCreateBatchJobType() {
}

@Test(expected = GradBusinessRuleException.class)
void testCreateBatchJobType_codeAlreadyExists() {
public void testCreateBatchJobType_codeAlreadyExists() {
BatchJobType obj = new BatchJobType();
obj.setCode("PSIRUN");
obj.setDescription("PSI Run FTP / Paper");
Expand All @@ -145,7 +145,7 @@ void testCreateBatchJobType_codeAlreadyExists() {
}

@Test
void testUpdateBatchJobType() {
public void testUpdateBatchJobType() {
BatchJobType obj = new BatchJobType();
obj.setCode("REGALG");
obj.setDescription("Graduation Algorithm");
Expand All @@ -168,7 +168,7 @@ void testUpdateBatchJobType() {
}

@Test(expected = GradBusinessRuleException.class)
void testUpdateBatchJobType_codeAlreadyExists() {
public void testUpdateBatchJobType_codeAlreadyExists() {
BatchJobType obj = new BatchJobType();
obj.setCode("REGALG");
obj.setDescription("Graduation Algorithm");
Expand Down

0 comments on commit 41a659c

Please sign in to comment.