Skip to content

Feature/api test runner#31

Open
junaeid13 wants to merge 5 commits into
AkashBhuiyan:mainfrom
junaeid13:feature/api-test-runner
Open

Feature/api test runner#31
junaeid13 wants to merge 5 commits into
AkashBhuiyan:mainfrom
junaeid13:feature/api-test-runner

Conversation

@junaeid13
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown
Owner

@AkashBhuiyan AkashBhuiyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution! However, this PR doesn't align with the project's current needs and structure. Here are the specific issues:

Problems Identified

1. Out of Scope

  • This PR adds API testing functionality, but we need unit tests for the service layer
  • The tests should focus on service classes like ApiExecutorServiceImpl, CollectionServiceImpl, RequestServiceImpl, or EnvironmentServiceImpl

2. Wrong Test Type

  • These are integration/API tests using MockMvc
  • We need unit tests with mocked dependencies (using @Mock and @InjectMocks)
  • Reference: See HistoryServiceImplTest.java (already implemented) for the expected pattern

3. Incorrect Test Target

  • Tests are targeting the controller layer (/api/history endpoints)
  • Should be testing service layer methods directly

4. Wrong Service

  • HistoryServiceImpl tests are already completed
  • Please pick one of the remaining services from issue #13

What's Needed

Please create unit tests following the same structure as HistoryServiceImplTest.java:

@ExtendWith(MockitoExtension.class)
class [YourService]ImplTest {
    @Mock
    private [YourRepository] repository;
    
    @InjectMocks
    private [YourService]Impl service;
    
    @Test
    void testMethod_Scenario_ExpectedResult() {
        // Test service method directly
    }
}

Next Steps

  1. Review HistoryServiceImplTest.java as a reference
  2. Choose one of the remaining services: ApiExecutorServiceImpl, CollectionServiceImpl, RequestServiceImpl, or EnvironmentServiceImpl
  3. Focus on testing service layer methods, not API endpoints
  4. Mock repository dependencies
  5. Follow the test coverage requirements listed in issue #13

Would you like guidance on writing unit tests for one of these services? Happy to help! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants