This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.googlecode.catchexception.MyException; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.mockito.InjectMocks; | |
import org.mockito.Mock; | |
import org.mockito.junit.MockitoJUnitRunner; | |
import static com.googlecode.catchexception.apis.BDDCatchException.caughtException; | |
import static com.googlecode.catchexception.apis.BDDCatchException.when; | |
import static org.assertj.core.api.BDDAssertions.then; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Provider | |
public class FriendlyIdConverterProvider implements ParamConverterProvider { | |
@Override | |
public <T> ParamConverter<T> getConverter(Class<T> clazz, Type type, Annotation[] annotations) { | |
if (clazz.getName().equals(UUID.class.getName())) { | |
return new ParamConverter<T>() { | |
@SuppressWarnings("unchecked") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sdkman | |
set PATH $PATH (find ~/.sdkman/candidates/*/current/bin -maxdepth 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.restdemo; | |
import java.util.Arrays; | |
import java.util.List; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.http.HttpStatus; | |
import org.springframework.http.MediaType; | |
import org.springframework.http.ResponseEntity; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fortune -s | cowsay -f (cowsay -l | tail -n +2 | tr ' ' '\n' | shuf -n 1) | |
_______________ | |
/ Universe, n.: \ | |
| | | |
\ The problem. / | |
--------------- | |
\ ^___^ | |
\ (ooo)\_______ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Formatting constants | |
BOLD=`tput bold` | |
UNDERLINE_ON=`tput smul` | |
UNDERLINE_OFF=`tput rmul` | |
TEXT_BLACK=`tput setaf 0` | |
TEXT_RED=`tput setaf 1` | |
TEXT_GREEN=`tput setaf 2` | |
TEXT_YELLOW=`tput setaf 3` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.Rule; | |
import org.junit.Test; | |
import org.junit.rules.ExpectedException; | |
import java.util.Arrays; | |
import java.util.List; | |
public class FooBarTest { | |
@Rule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.Test; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import static com.googlecode.catchexception.CatchException.caughtException; | |
import static com.googlecode.catchexception.apis.CatchExceptionAssertJ.then; | |
import static com.googlecode.catchexception.apis.CatchExceptionAssertJ.when; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Solution without PowerMock | |
-- | |
import ch.qos.logback.classic.*; | |
import ch.qos.logback.classic.spi.LoggingEvent; | |
import ch.qos.logback.core.Appender; | |
import org.junit.*; | |
import org.junit.runner.RunWith; | |
import org.mockito.*; | |
import org.mockito.runners.MockitoJUnitRunner; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 SomeTest { | |
SomeService foo; |
NewerOlder