package com.example;

import com.example.data.SampleRepository;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.dao.InvalidDataAccessResourceUsageException;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.Arrays;
import java.util.Collections;

import static org.hamcrest.Matchers.containsString;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;

@RunWith(SpringRunner.class)
@SpringBootTest
public class ApplicationTests {

    @Autowired
    SampleRepository repository;

    @Test
    public void nonEmptyIn() {
        repository.queryIn(Arrays.asList(1, 2, 3));
    }

    @Test
    public void emptyIn() {
        try {
            repository.queryIn(Collections.emptyList());
            fail("InvalidDataAccessResourceUsageException expected");
        } catch (InvalidDataAccessResourceUsageException ex) {
            assertThat(ExceptionUtils.getRootCauseMessage(ex), containsString("unexpected token: )"));
        }
    }

}

@@ -1103,19 +1103,107 @@
     
-assertThat(
+ex.printStackTrace();%0A            assertThat(ExceptionUtils.getStackTrace(ex),%0A                    
 Exce
@@ -1237,16 +1237,36 @@
 age(ex),
+%0A                   
  contain
@@ -1295,16 +1295,29 @@
 ken: )%22)
+%0A            
 );%0A     

print stack trace in test