Skip to content

Instantly share code, notes, and snippets.

View mbenson's full-sized avatar

Matt Benson mbenson

  • Three's
  • Ashland City, TN USA
View GitHub Profile
@mbenson
mbenson / gist:bfaca20b70c2280dceec
Last active February 25, 2016 16:42
inheritance-aware Spring MethodArgumentResolver; spring-boot based workaround for SPR-11055
import java.lang.reflect.Method;
import java.util.stream.Stream;
import org.apache.commons.lang3.ClassUtils.Interfaces;
import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.reflect.MethodUtils;
import org.springframework.core.DefaultParameterNameDiscoverer;
import org.springframework.core.MethodParameter;
import org.springframework.core.ParameterNameDiscoverer;
import org.springframework.core.annotation.SynthesizingMethodParameter;
@mbenson
mbenson / InjectMocksTest.java
Created January 8, 2016 16:13
Illustrates injecting mock objects into Spring ApplicationContext for spring-boot testing
package com.mbenson;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.SpringApplicationConfiguration;
@mbenson
mbenson / AbstractOpenEjbTest.java
Created June 26, 2012 16:49
OpenEJB-consuming tests
/*
* Copyright der Gesellschaften der KarstadtQuelle Versicherungen
* Projekt:
* Dateiname: ComponentATest.java
* Erzeugt: 26.05.2009
*
* Beschreibung:
*
*
************************************************************************