Skip to content

Instantly share code, notes, and snippets.

View mariuszs's full-sized avatar

Mariusz Smykuła mariuszs

View GitHub Profile
@mariuszs
mariuszs / SomeServiceTest.java
Last active December 28, 2015 10:58
BDD Style expect exception for JUnit
import org.junit.Test;
import static com.googlecode.catchexception.CatchException.caughtException;
import static com.googlecode.catchexception.apis.CatchExceptionBdd.then;
import static com.googlecode.catchexception.apis.CatchExceptionBdd.when;
public class SomeServiceTest {
@Test
public void testDoThat() {
@mariuszs
mariuszs / MyTest.java
Last active December 28, 2015 10:49
Mockito + Catch Exception + Fest Assertion 2 - BDD Style!
import org.junit.Test;
import static com.googlecode.catchexception.CatchException.caughtException;
import static com.googlecode.catchexception.apis.CatchExceptionBdd.then;
import static com.googlecode.catchexception.apis.CatchExceptionBdd.when;
import static org.mockito.BDDMockito.given;
public class SomeServiceTest {
private SomeService myMock;
@mariuszs
mariuszs / gist:7474626
Created November 14, 2013 21:27
GPG Key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.15 (GNU/Linux)
mQINBFKFPiYBEADBlrIGwiTARKzRt1AjcQgfyQvKYmBmFyTZWqXafm+TPWN59ZZO
Jon98Q0GWqOtKDUDW1nWdaARgxhCgaPSqcqreaegcFHmUe34+/bhEErx3tMkQBQk
n2OMUe7admnyoO8nLFf6NFisY/0hTjOXHkUcuqZ6McBSljAEkjdSZZ8W2ccP0WFb
oTPJf7AbAypD2AsmZO7kF+RcGZxbIYe0tROiM1WHjtdAjL33G8hssfPhMQp3M8BK
STXsPO57nBt6UB23f+Lo6adBFs6SdkmoSDKVGDA08CKTUDgxJX/C6bpbmYY0ZdCA
iVZbZr5PpZK7IlkGLTfqc2iKPjlkdJjoaT6UZiYZD7qNTEmjwcHsf8YD646vp/e+
NVyZskMPqLZ+0hDJ1cUP3YsYpwozS7VGZ2FEF1ygHBfemEshkBWlXnKL5syzRU61
<pluginManagement>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
</plugin>
...
</pluginManagement>
def text = Hook.create().text()
println text.loremIpsum
println "* Words "
println text.words(1)
println text.words()
println text.words(190)
println "* Sentences"
println text.sentence()
println text.sentence(3)
println text.sentence(190)
Bring your own phone
Error opening /portlets/common/checkout/leadGenShareReadyOrderSummary.jsp.
The source of this error is:
javax.servlet.ServletException: java.lang.NullPointerException
at org.apache.beehive.netui.util.internal.ServletUtils.throwServletException(ServletUtils.java:165)
at org.apache.beehive.netui.pageflow.PageFlowPageFilter.runPage(PageFlowPageFilter.java:412)
at org.apache.beehive.netui.pageflow.PageFlowPageFilter.doFilter(PageFlowPageFilter.java:284)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:60)
@mariuszs
mariuszs / result.log
Last active August 29, 2015 14:18
Ambiguous under java 8 with Float
```java
public class Ambiguous {
public static void main(String... args){
then(bar());
}
public static <E extends Float> E bar() {
return null;
}
@mariuszs
mariuszs / skype.spec
Created January 7, 2015 19:58
Fedora 21 RPM Spec for Skype
# skype.spec for skype-4.3.0.37 (x32)
#
# Build with: rpmbuild -ba --target=i686 skype.spec
#
# Original skype.spec for 4.2.0.11
# https://github.com/mopsfelder/skype-rpm/blob/master/skype.spec
#%global debug_package %{nil}
Name: skype
@RestClient(endpoint = "http://city.com/rest/",
version = "v2")
@Logging(logLevel = LogLevel.BASIC)
public class CityService {
@Cache(ttl = 3000)
public CIty findCityByLocation(Location location);
@Logging(logLevel = LogLevel.FULL)
@RestClient
@Logging(loglevel = LogLevel.FULL)
private CityClient clietClient;
@RestClient(loglevel = LogLevel.FULL)