Class OpenAIProviderPrivateMethodsTest

java.lang.Object
org.machanism.machai.ai.provider.openai.OpenAIProviderPrivateMethodsTest

class OpenAIProviderPrivateMethodsTest extends Object
Unit tests for OpenAIProvider private/package-private helper methods.

These tests deliberately avoid network access by using reflection and by exercising only pure logic and error handling paths.

  • Constructor Details

    • OpenAIProviderPrivateMethodsTest

      OpenAIProviderPrivateMethodsTest()
  • Method Details

    • tearDown

      @AfterEach void tearDown()
    • safelyInvokeTool_whenToolThrowsIOException_returnsErrorMessageInsteadOfThrowing

      @Test void safelyInvokeTool_whenToolThrowsIOException_returnsErrorMessageInsteadOfThrowing() throws Exception
      Throws:
      Exception
    • firstNonBlankReasoning_whenAllBlank_returnsNull

      @Test void firstNonBlankReasoning_whenAllBlank_returnsNull() throws Exception
      Throws:
      Exception
    • captureUsage_whenUsageMissing_setsZeroUsage

      @Test void captureUsage_whenUsageMissing_setsZeroUsage() throws Exception
      Throws:
      Exception
    • callFunction_whenArgumentsInvalidJson_throwsIllegalArgumentException

      @Test void callFunction_whenArgumentsInvalidJson_throwsIllegalArgumentException() throws Exception
      Throws:
      Exception
    • callFunction_whenToolMatches_passesParsedJsonAndWorkingDirIntoHandler

      @Test void callFunction_whenToolMatches_passesParsedJsonAndWorkingDirIntoHandler() throws Exception
      Throws:
      Exception
    • callFunction_whenNoMatchingTool_returnsNull

      @Test void callFunction_whenNoMatchingTool_returnsNull() throws Exception
      Throws:
      Exception