File tree Expand file tree Collapse file tree
crud-spring/src/test/java/com/loiane/integration Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77import org .springframework .test .context .ActiveProfiles ;
88import org .junit .jupiter .api .BeforeEach ;
99import org .springframework .web .client .RestTemplate ;
10+ import org .springframework .web .client .ResponseErrorHandler ;
11+ import org .springframework .http .client .ClientHttpResponse ;
1012import org .springframework .web .util .DefaultUriBuilderFactory ;
1113
14+ import java .io .IOException ;
15+
1216import com .loiane .config .TestContainersConfiguration ;
1317
1418/**
@@ -31,6 +35,14 @@ public abstract class AbstractIntegrationTest {
3135 void setUpRestTemplate () {
3236 restTemplate = new RestTemplate ();
3337 restTemplate .setUriTemplateHandler (new DefaultUriBuilderFactory ("http://localhost:" + port ));
38+ restTemplate .setErrorHandler (new NoOpResponseErrorHandler ());
39+ }
40+
41+ static class NoOpResponseErrorHandler implements ResponseErrorHandler {
42+ @ Override
43+ public boolean hasError (ClientHttpResponse response ) throws IOException {
44+ return false ;
45+ }
3446 }
3547
3648 /**
You can’t perform that action at this time.
0 commit comments