package org.azavea.otm.test;

import org.azavea.otm.data.Version;
import org.azavea.otm.rest.RequestGenerator;
import org.azavea.otm.rest.RestClient;
import org.azavea.otm.rest.handlers.RestHandler;

import static org.mockito.Mockito.*;


public class RequestGeneratorTest extends OpenTreeMapTestCase {
    private RequestGenerator rg;

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        rg = new RequestGenerator();
    }

    public void testGetVersion() {
        // Create a handler
        RestHandler<Version> handler = new RestHandler<>(new Version());
        // Create a mock RestClient
        RestClient mockClient = mock(RestClient.class);

        // Inject mock RestClient into RequestGenerator
        rg.setClient(mockClient);

        // Make the call
        rg.getVersion(handler);

        // See if mock RestClient was called correctly
        verify(mockClient).get("/version", null, handler);
    }

}

@@ -23,16 +23,50 @@
 .test;%0A%0A
+import org.azavea.otm.data.Model;%0A
 import o
@@ -609,16 +609,23 @@
 Handler%3C
+Version
 %3E(new Ve
@@ -632,16 +632,245 @@
 rsion())
+ %7B%0A            @Override%0A            public void dataReceived(Version responseObject) %7B%0A                %0A            %7D%0A%0A            @Override%0A            public void failure(Throwable e, String message) %7B%0A%0A            %7D%0A        %7D
 ;%0A      

Fix unit test