Skip to content

Instantly share code, notes, and snippets.

View El-kady's full-sized avatar

Moustafa Elkady El-kady

View GitHub Profile
package com.github.leosilvadev.verticle;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.DeploymentOptions;
import io.vertx.core.Vertx;
import java.util.concurrent.atomic.AtomicLong;
/**
* Created by leonardo on 11/18/17.
@takezoe
takezoe / CustomerServiceTest.java
Created June 25, 2017 06:36
Test case which uses @MockBean in Spring Boot application
package com.example.service;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import java.util.Collections;
import com.example.repository.CustomerRepository;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
@cangelis
cangelis / command.class.php
Last active June 21, 2023 02:03
A simple Command Pattern implementation (Calculator example) on PHP
<?php
abstract class Command {
abstract public function unExecute ();
abstract public function Execute ();
}
class concreteCommand extends Command {
private $operator,$operand,$calculator;
public function __construct ($calculator,$operator,$operand) {
$this->operator = $operator;
$this->operand = $operand;