Package org.jboss.resteasy.test.regression

Source Code of org.jboss.resteasy.test.regression.ResteasyProviderFactoryTest$MyStringParameterUnmarshaller

package org.jboss.resteasy.test.regression;

import org.jboss.resteasy.spi.ResteasyProviderFactory;
import org.jboss.resteasy.spi.StringParameterUnmarshaller;
import org.junit.Before;
import org.junit.Test;

import java.lang.annotation.Annotation;
import java.sql.Date;

import static org.junit.Assert.assertNotNull;
/**
* resteasy-584
*
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
* @version $Revision: 1 $
*/
public class ResteasyProviderFactoryTest
{
  private ResteasyProviderFactory factory;

  @Before
  public void createBean() {
    factory = new ResteasyProviderFactory();
  }

  @Test
  public void shouldReturnStringParameterUnmarshallerAddedForType() {
    factory.addStringParameterUnmarshaller(MyStringParameterUnmarshaller.class);

    assertNotNull(factory.createStringParameterUnmarshaller(Date.class));
  }

  public static class MyStringParameterUnmarshaller implements StringParameterUnmarshaller<Date>
   {

    @Override
    public void setAnnotations(Annotation[] annotations) {
  }

    @Override
    public Date fromString(String str) {
      return null;
    }

  }
}
TOP

Related Classes of org.jboss.resteasy.test.regression.ResteasyProviderFactoryTest$MyStringParameterUnmarshaller

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.