Skip to content

Instantly share code, notes, and snippets.

View Opalo's full-sized avatar

Maciek Opala Opalo

View GitHub Profile
@ToString(callSuper = true)
abstract class DomainException extends ResponseStatusException {
DomainException(HttpStatus status, String reason) {
super(status, reason);
}
}
@Opalo
Opalo / wrapper.java
Last active November 27, 2018 16:26
@Slf4j
@Component
class DomainExceptionWrapper extends DefaultErrorAttributes {
private final ReqTracer tracer;
DomainExceptionWrapper(ReqTracer tracer) {
super(false);
this.tracer = tracer;
}
import io.vavr.collection.List;
import io.vavr.control.Try;
class Lol {
public static void main(String[] args) {
final List<Node> myNodeList = Try.of(NodeUtils::new)
.onFailure(System.out::println)
.mapTry(NodeUtils::retrieveNodes)
.getOrElse(List.empty());
task unit(type: Test)
task functional(type: Test)
task check // lifecycle task
task report
check.dependsOn unit, functional
functional.mustRunAfter unit //shouldRunAfter
task unit(type: Test)
task functional(type: Test)
task check // lifecycle task
task report
task itMustRun {
doFirst {
println "It's running from start..."
}
doLast {
println "...to an end."
}
}
task itMustRun
println 'a'
task t1 {
doFirst {
println 'b'
}
}
println 'c'
processResources {
def profile = project.properties['profile']
def replace_tokens = profile ? filter_tokens[profile] : filter_tokens['default']
exclude '**/log4j-test.xml'
from('src/main/resources') {
exclude '**/*.ttf'
tasks.withType(CreateStartScripts) {
def tplName = 'unixStartScriptTemplate.txt'
assert new File(tplName).exists()
template = resources.text.fromFile(tplName)
}