Run it in Five Minutes

With Docker

docker pull uaihebert/uaimockserver
docker run uaihebert/uaimockserver


Running the JarFile

If you want to run a WebService standalone on your PC (IOS, Android, WinPhone, PHP, .NET, JAVA, etc)

First of all, you will need to install a JDK version 1.7 or higher. 

Search for in Goole: “install jdk”.

OR

You can use this link: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html to download the latest version.

Make sure that when you type “java -version” in your console a friendly message appears.

Download the uaiMockService jar and the uaiMockServer.json file and save both on the same folder. You will find both here: Download uaiMockServer

To run just open your console and type: java -jar uaiMockServer-{VERSION}.Standalone.jar


With your Unit Tests

If you want to run a WebService with your Unitary Tests (JUnit, etc)

Add the code below in your pom dependencies:

<dependency>
    <groupId>uaihebert.com</groupId>
    <artifactId>uaiMockServer</artifactId>
    <version>1.1.2</version>
    <scope>test</scope>
</dependency>

Save the config (sample file) file in the resources folder (src/test/resources).

You can run a test like (for Android):

public class YourTestClass {

    private static UaiMockServer uaiMockServer;

    @BeforeClass
    public static void beforeClass() {
        uaiMockServer = UaiMockServer.start();
    }

    @AfterClass
    public static void afterClass() {
        uaiMockServer.shutdown();
    }

    // your tests
}

You could also run with annotations (backend):

@RunWith(UaiMockServerRunner.class)
public class YourTestClass {
 
    @Test
    public void yourTest(){
        // test executing the http request
    }
}