package com.yammer.dropwizard.json.tests;

import com.yammer.dropwizard.json.JsonBundle;
import com.yammer.dropwizard.config.Environment;
import com.yammer.dropwizard.jersey.JacksonMessageBodyProvider;
import com.yammer.dropwizard.jersey.OptionalQueryParamInjectableProvider;
import com.yammer.dropwizard.json.ObjectMapperFactory;
import org.junit.Before;
import org.junit.Test;

import static org.mockito.Matchers.isA;
import static org.mockito.Mockito.*;

public class JsonBundleTest {
    private final ObjectMapperFactory factory = mock(ObjectMapperFactory.class);
    private final Environment environment = mock(Environment.class);
    private final JsonBundle bundle = new JsonBundle();

    @Before
    public void setUp() throws Exception {
        when(environment.getObjectMapperFactory()).thenReturn(factory);
    }

    @Test
    public void addsJSONSupport() throws Exception {
        bundle.run(environment);
        
        verify(environment).addProvider(isA(JacksonMessageBodyProvider.class));
    }

    @Test
    public void addsOptionalQueryParamSupport() throws Exception {
        bundle.run(environment);

        verify(environment).addProvider(eq(OptionalQueryParamInjectableProvider.class));
    }
}

@@ -40,54 +40,8 @@
 s;%0A%0A
-import com.yammer.dropwizard.json.JsonBundle;%0A
 impo
@@ -183,50 +183,22 @@
 rd.j
-ersey.OptionalQueryParamInjectableProvider
+son.JsonBundle
 ;%0Aim
@@ -942,214 +942,7 @@
    %7D
-%0A%0A    @Test%0A    public void addsOptionalQueryParamSupport() throws Exception %7B%0A        bundle.run(environment);%0A%0A        verify(environment).addProvider(eq(OptionalQueryParamInjectableProvider.class));%0A    %7D
 %0A%7D%0A

Fix JsonBundleTest.