Skip to content

Instantly share code, notes, and snippets.

View yanhua365's full-sized avatar

yanhua365 yanhua365

View GitHub Profile
<mvc:annotation-driven conversion-service="conversionService" ignoreDefaultModelOnRedirect="true">
<mvc:argument-resolvers>
<bean class="org.springframework.data.web.PageableArgumentResolver"/>
</mvc:argument-resolvers>
</mvc:annotation-driven>
<bean class="org.springframework.data.repository.support.DomainClassConverter">
<constructor-arg ref="conversionService"/>
</bean>
@yanhua365
yanhua365 / ConcordionSpringJunit4ClassRunner.java
Created August 25, 2017 10:49 — forked from eeichinger/ConcordionSpringJunit4ClassRunner.java
Spring Test / Concordion integration - integrate Concordion with Spring's test runner
package testsupport;
import org.concordion.api.ResultSummary;
import org.concordion.internal.FixtureRunner;
import org.junit.runner.Description;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.InitializationError;
import org.junit.runners.model.Statement;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@yanhua365
yanhua365 / gist:cbdc2512ab5d75003ab4d80e399af774
Created June 26, 2018 07:07 — forked from tinoviena/gist:2893779
Groovy script to make HTTP request using Java standard library.
URL url = new URL(urlTarget);
HttpURLConnection connection;
method = "GET" // POST, PUT, ...
data = "" // for GET, otherwise e..g JSON
connection.setDoOutput(true);
connection.setDoInput(true);
connection.setRequestMethod(method);
connection.setRequestProperty("Content-Length", "" + Integer.toString(data.getBytes().length));