package uk.gov.register.resources.v1;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
import uk.gov.register.resources.v2.EntryResource;
import uk.gov.register.views.representations.ExtraMediaType;

import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import java.lang.reflect.Method;
import java.util.List;

import static java.util.Arrays.asList;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasItems;

@RunWith(MockitoJUnitRunner.class)
public class EntryResourceTest {
    @Test
    public void findByEntryNumberSupportsJson() throws Exception {
        Method findBySerialMethod = EntryResource.class.getDeclaredMethod("findByEntryNumber", int.class);
        List<String> declaredMediaTypes = asList(findBySerialMethod.getDeclaredAnnotation(Produces.class).value());
        assertThat(declaredMediaTypes,
                hasItems(MediaType.APPLICATION_JSON));
    }
}

@@ -173,9 +173,9 @@
 es.v
-2
+1
 .Ent
@@ -543,16 +543,16 @@
 .class)%0A
-
 public c
@@ -576,16 +576,423 @@
 eTest %7B%0A
+    @Test%0A    public void findByEntryNumberHtmlSupportsHtml() throws Exception %7B%0A        Method findBySerialMethod = EntryResource.class.getDeclaredMethod(%22findByEntryNumberHtml%22, int.class);%0A        List%3CString%3E declaredMediaTypes = asList(findBySerialMethod.getDeclaredAnnotation(Produces.class).value());%0A        assertThat(declaredMediaTypes,%0A                hasItems(ExtraMediaType.TEXT_HTML));%0A    %7D%0A%0A
     @Tes

V1 test should test V1, not V2