X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frestconf%2Fimpl%2Ftest%2FCodecsExceptionsCatchingTest.java;h=4ff4f707106a59058702166beb99a5cf8f506cb2;hp=767aaf36c149a9a61763d71f9e7722f997e9a595;hb=c46e223995956f1f759c551163c212947c1e2fb7;hpb=cef5d589ec91bd797a6c520856d7019c7ba074b4 diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/CodecsExceptionsCatchingTest.java b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/CodecsExceptionsCatchingTest.java index 767aaf36c1..4ff4f70710 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/CodecsExceptionsCatchingTest.java +++ b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/CodecsExceptionsCatchingTest.java @@ -3,17 +3,16 @@ package org.opendaylight.controller.sal.restconf.impl.test; import static org.junit.Assert.assertTrue; import java.io.FileNotFoundException; - import javax.ws.rs.client.Entity; import javax.ws.rs.core.Application; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; - import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.test.JerseyTest; import org.junit.BeforeClass; import org.junit.Test; import org.opendaylight.controller.sal.rest.impl.JsonToCompositeNodeProvider; +import org.opendaylight.controller.sal.rest.impl.RestconfDocumentedExceptionMapper; import org.opendaylight.controller.sal.rest.impl.StructuredDataToJsonProvider; import org.opendaylight.controller.sal.rest.impl.StructuredDataToXmlProvider; import org.opendaylight.controller.sal.rest.impl.XmlToCompositeNodeProvider; @@ -46,6 +45,7 @@ public class CodecsExceptionsCatchingTest extends JerseyTest { resourceConfig = resourceConfig.registerInstances(restConf, StructuredDataToXmlProvider.INSTANCE, StructuredDataToJsonProvider.INSTANCE, XmlToCompositeNodeProvider.INSTANCE, JsonToCompositeNodeProvider.INSTANCE); + resourceConfig.registerClasses(RestconfDocumentedExceptionMapper.class); return resourceConfig; } @@ -54,6 +54,6 @@ public class CodecsExceptionsCatchingTest extends JerseyTest { Response response = target("/config/number:cont").request(MediaType.APPLICATION_XML).put( Entity.entity("3f", MediaType.APPLICATION_XML)); String exceptionMessage = response.readEntity(String.class); - assertTrue(exceptionMessage.contains("Incorrect lexical representation of Integer value: 3f")); + assertTrue(exceptionMessage.contains("invalid-value")); } } \ No newline at end of file