test thrown expected with jupiter spring boot

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import static org.junit.jupiter.api.Assertions.assertEquals;

class YourSpringBootApplicationTests {

    private YourService yourService;

    void testYourServiceMethod() {
        // Given
        // Define the input parameters or initial conditions for the test

        // When
        // Perform the action or method call to be tested
        String result = yourService.yourMethod(/ provide necessary parameters /);

        // Then
        // Assert the expected outcome
        assertEquals("expectedResult", result);