diff --git a/src/test/java/com/example/e2eminimax/service/MinimaxServiceTest.java b/src/test/java/com/example/e2eminimax/service/MinimaxServiceTest.java new file mode 100644 index 0000000..31dcdbb --- /dev/null +++ b/src/test/java/com/example/e2eminimax/service/MinimaxServiceTest.java @@ -0,0 +1,47 @@ +package com.example.e2eminimax.service; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +class MinimaxServiceTest { + + private MinimaxService minimaxService; + + @BeforeEach + void setUp() { + minimaxService = new MinimaxService(); + } + + @Test + void processRequest_ValidInput_ReturnsProcessedString() { + String result = minimaxService.processRequest("test input"); + assertEquals("Processed: test input", result); + } + + @Test + void processRequest_NullInput_ThrowsException() { + assertThrows(IllegalArgumentException.class, () -> minimaxService.processRequest(null)); + } + + @Test + void processRequest_BlankInput_ThrowsException() { + assertThrows(IllegalArgumentException.class, () -> minimaxService.processRequest(" ")); + } + + @Test + void validateInput_ValidInput_ReturnsTrue() { + assertTrue(minimaxService.validateInput("valid")); + } + + @Test + void validateInput_NullInput_ReturnsFalse() { + assertFalse(minimaxService.validateInput(null)); + } + + @Test + void validateInput_BlankInput_ReturnsFalse() { + assertFalse(minimaxService.validateInput("")); + } +}