package app.minimal.com.aol.micro.server; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; import java.util.concurrent.ExecutionException; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import com.aol.micro.server.MicroserverApp; import com.aol.micro.server.auto.discovery.Rest; import com.aol.micro.server.testing.RestAgent; import com.aol.micro.server.spring.boot.MicroSpringBoot; @Rest @Path("/single") @MicroSpringBoot public class MinimalClassTest { RestAgent rest = new RestAgent(); MicroserverApp server; @Before public void startServer(){ server = new MicroserverApp(()-> "minimal-app"); } @Test public void runAppAndBasicTest() throws InterruptedException, ExecutionException{ assertThat(rest.get("http://localhost:8080/minimal-app/single/ping"),is("ok1")); } @GET @Produces("text/plain") @Path("/ping") public String ping() { return "ok1"; } }