本文整理汇总了Java中org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider类的典型用法代码示例。如果您正苦于以下问题:Java ResteasyJackson2Provider类的具体用法?Java ResteasyJackson2Provider怎么用?Java ResteasyJackson2Provider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResteasyJackson2Provider类属于org.jboss.resteasy.plugins.providers.jackson包,在下文中一共展示了ResteasyJackson2Provider类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: RedfishWebClient
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; //导入依赖的package包/类
public RedfishWebClient()
{
ResteasyJackson2Provider jackson2Provider = new ResteasyJackson2Provider();
ObjectMapper mapper = new ObjectMapper()
.enable( DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL )
.enable( DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES )
.disable( DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES );
jackson2Provider.setMapper( mapper );
this.client = ( (ResteasyClientBuilder) ResteasyClientBuilder.newBuilder() )
.register( jackson2Provider )
.disableTrustManager()
.build();
}
开发者ID:vmware,项目名称:OHMS,代码行数:17,代码来源:RedfishWebClient.java
示例2: callDelete
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; //导入依赖的package包/类
/**
* Test for /services/friends/{userId}/{id}/delete GET Test OK
*
* @throws Exception
*/
@Test
@InSequence(5)
public void callDelete() throws Exception {
Client client = ClientBuilder.newClient().register(ResteasyJackson2Provider.class);
JsonSimpleResponse response = client.target(TestConstants.SERVER_ROOT + APP_NAME + svc_root
+ "/1/3/delete")
.request(MediaType.APPLICATION_JSON)
.header(Constants.HTTP_HEADER_TOKEN, TestConstants.USER_TOKEN)
.get(JsonSimpleResponse.class);
assertTrue("Delete failed", response!=null);
Response friend = client.target(TestConstants.SERVER_ROOT + APP_NAME + svc_root + "/1/2")
.request(MediaType.APPLICATION_JSON)
.header(Constants.HTTP_HEADER_TOKEN, TestConstants.USER_TOKEN)
.get();
assertEquals("Must be 404", 404, friend.getStatus());
}
开发者ID:msansm1,项目名称:medek-server,代码行数:25,代码来源:FriendServiceTest.java
示例3: callMyCollec
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; //导入依赖的package包/类
/**
* Test for /services/home/mycollec Test OK
*
* @throws Exception
*/
@Test
@InSequence(1)
public void callMyCollec() throws Exception {
Client client = ClientBuilder.newClient().register(ResteasyJackson2Provider.class);
JsonCollectionStats response = client.target(TestConstants.SERVER_ROOT + APP_NAME + svc_root + "/mycollec")
.request(MediaType.APPLICATION_JSON)
.header(Constants.HTTP_HEADER_TOKEN, TestConstants.USER_TOKEN)
.get(JsonCollectionStats.class);
assertNotNull(response.getAlbums());
// assertEquals(Integer.valueOf(1), response.getAlbums().getNb());
// assertEquals(Integer.valueOf(1), response.getBooks().getNb());
// assertEquals(Integer.valueOf(1), response.getMovies().getNb());
// assertEquals(Integer.valueOf(1), response.getSeries().getNb());
}
开发者ID:msansm1,项目名称:medek-server,代码行数:21,代码来源:HomeServiceTest.java
示例4: getClient
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; //导入依赖的package包/类
public static Client getClient() throws RestClientException {
final ResteasyJackson2Provider jackson2Provider = RestUtils.createJacksonProvider();
final ApacheHttpClient4Engine engine = new ApacheHttpClient4Engine(RestUtils.createAllTrustingClient());
final Client client = new ResteasyClientBuilder()
.providerFactory(new ResteasyProviderFactory()) // this is needed otherwise default jackson2provider is used, which causes problems with JDK8 Optional
.register(jackson2Provider)
.httpEngine(engine)
.build();
return client;
}
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:13,代码来源:RestUtils.java
示例5: createJacksonProvider
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; //导入依赖的package包/类
private static ResteasyJackson2Provider createJacksonProvider() {
final ResteasyJackson2Provider jackson2Provider = new ResteasyJackson2Provider();
final ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModule(new Jdk8Module());
jackson2Provider.setMapper(objectMapper);
return jackson2Provider;
}
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:8,代码来源:RestUtils.java
示例6: verify
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; //导入依赖的package包/类
@Override
public List<Result> verify(String connectorId, Map<String, String> options) {
final ResteasyJackson2Provider resteasyJacksonProvider = new ResteasyJackson2Provider();
resteasyJacksonProvider.setMapper(MAPPER);
final ResteasyProviderFactory providerFactory = ResteasyProviderFactory.newInstance();
providerFactory.register(resteasyJacksonProvider);
final Configuration configuration = new LocalResteasyProviderFactory(providerFactory);
Client client = ClientBuilder.newClient(configuration);
WebTarget target = client.target(String.format("http://%s/api/v1/verifier/%s", config.getService(), connectorId));
return target.request(MediaType.APPLICATION_JSON).post(Entity.entity(options, MediaType.APPLICATION_JSON),
new GenericType<List<Result>>(){});
}
开发者ID:syndesisio,项目名称:syndesis,代码行数:15,代码来源:ExternalVerifierService.java
示例7: callGetListParamsPTwo
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; //导入依赖的package包/类
/**
* Test for /services/tvshows GET with params
*
* @throws Exception
*/
@Test
@InSequence(7)
public void callGetListParamsPTwo() throws Exception {
Client client = ClientBuilder.newClient().register(ResteasyJackson2Provider.class);
@SuppressWarnings("unchecked")
List<JsonShow> response = client.target(TestConstants.SERVER_ROOT + APP_NAME + svc_root
+ "?from=6&limit=5&orderBy=id&orderDir=asc")
.request(MediaType.APPLICATION_JSON)
.header(Constants.HTTP_HEADER_TOKEN, TestConstants.USER_TOKEN)
.get(List.class);
assertFalse("No tvshow found", response.isEmpty());
assertEquals("List page 2 does not contains 2 entries", Integer.valueOf(2), Integer.valueOf(response.size()));
}
开发者ID:msansm1,项目名称:medek-server,代码行数:20,代码来源:TVShowServiceTest.java
示例8: callGetOne
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; //导入依赖的package包/类
/**
* Test for /services/albums/{id} GET Test OK
*
* @throws Exception
*/
@Test
@InSequence(2)
public void callGetOne() throws Exception {
Client client = ClientBuilder.newClient().register(ResteasyJackson2Provider.class);
JsonAlbum response = client.target(TestConstants.SERVER_ROOT + APP_NAME + svc_root + "/1/loguser/1")
.request(MediaType.APPLICATION_JSON)
.header(Constants.HTTP_HEADER_TOKEN, TestConstants.USER_TOKEN)
.get(JsonAlbum.class);
assertEquals("And justice for all", response.getTitle());
}
开发者ID:msansm1,项目名称:medek-server,代码行数:17,代码来源:AlbumServiceTest.java
示例9: callCreate
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; //导入依赖的package包/类
/**
* Test for /services/albums POST Test OK
* creation
*
* @throws Exception
*/
@Test
@InSequence(3)
public void callCreate() throws Exception {
Client client = ClientBuilder.newClient().register(ResteasyJackson2Provider.class);
JsonAlbum album = new JsonAlbum(null, "la ouache", null, null, "BZH", 1,
12, "CD", 1, "Matmatah", 1, true, 4, false, null);
JsonAlbum response = client.target(TestConstants.SERVER_ROOT + APP_NAME + svc_root)
.request(MediaType.APPLICATION_JSON)
.header(Constants.HTTP_HEADER_TOKEN, TestConstants.USER_TOKEN)
.post(Entity.entity(album, MediaType.APPLICATION_JSON), JsonAlbum.class);
assertEquals("la ouache", response.getTitle());
}
开发者ID:msansm1,项目名称:medek-server,代码行数:20,代码来源:AlbumServiceTest.java
示例10: callUpdate
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; //导入依赖的package包/类
/**
* Test for /services/albums POST Test OK
* update
*
* @throws Exception
*/
@Test
@InSequence(4)
public void callUpdate() throws Exception {
Client client = ClientBuilder.newClient().register(ResteasyJackson2Provider.class);
JsonAlbum album = new JsonAlbum(1, "Master of puppets", null, null, "Metal", 1,
9, "CD", 1, "Metallica", 1, true, 5, false, null);
JsonAlbum response = client.target(TestConstants.SERVER_ROOT + APP_NAME + svc_root)
.request(MediaType.APPLICATION_JSON)
.header(Constants.HTTP_HEADER_TOKEN, TestConstants.USER_TOKEN)
.post(Entity.entity(album, MediaType.APPLICATION_JSON), JsonAlbum.class);
assertEquals("Master of puppets", response.getTitle());
}
开发者ID:msansm1,项目名称:medek-server,代码行数:20,代码来源:AlbumServiceTest.java
示例11: callGetUserAlbums
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; //导入依赖的package包/类
/**
* Test for /services/albums/user GET Test OK
*
* @throws Exception
*/
@Test
@InSequence(5)
public void callGetUserAlbums() throws Exception {
Client client = ClientBuilder.newClient().register(ResteasyJackson2Provider.class);
@SuppressWarnings("unchecked")
List<JsonAlbum> response = client.target(TestConstants.SERVER_ROOT + APP_NAME + svc_root
+ "/user?from=0&limit=5&orderBy=a.id&orderDir=asc&userId=1")
.request(MediaType.APPLICATION_JSON)
.header(Constants.HTTP_HEADER_TOKEN, TestConstants.USER_TOKEN)
.get(List.class);
assertFalse("No album found", response.isEmpty());
assertEquals("List page 1 does not contains 1 entrie", Integer.valueOf(1), Integer.valueOf(response.size()));
}
开发者ID:msansm1,项目名称:medek-server,代码行数:20,代码来源:AlbumServiceTest.java
示例12: callGetAlbumTracks
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; //导入依赖的package包/类
/**
* Test for /services/albums/{id}/tracks GET Test OK
*
* @throws Exception
*/
@Test
@InSequence(6)
public void callGetAlbumTracks() throws Exception {
Client client = ClientBuilder.newClient().register(ResteasyJackson2Provider.class);
@SuppressWarnings("unchecked")
List<JsonTrack> response = client.target(TestConstants.SERVER_ROOT + APP_NAME + svc_root + "/1/tracks")
.request(MediaType.APPLICATION_JSON)
.header(Constants.HTTP_HEADER_TOKEN, TestConstants.USER_TOKEN)
.get(List.class);
assertFalse("No user album found", response.isEmpty());
}
开发者ID:msansm1,项目名称:medek-server,代码行数:18,代码来源:AlbumServiceTest.java
示例13: callGetListParamsPOne
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; //导入依赖的package包/类
/**
* Test for /services/albums GET with params
* Page 1
*
* @throws Exception
*/
@Test
@InSequence(7)
public void callGetListParamsPOne() throws Exception {
Client client = ClientBuilder.newClient().register(ResteasyJackson2Provider.class);
@SuppressWarnings("unchecked")
List<JsonAlbum> response = client.target(TestConstants.SERVER_ROOT + APP_NAME + svc_root
+ "?from=0&limit=5&orderBy=id&orderDir=asc")
.request(MediaType.APPLICATION_JSON)
.header(Constants.HTTP_HEADER_TOKEN, TestConstants.USER_TOKEN)
.get(List.class);
assertFalse("No album found", response.isEmpty());
assertEquals("List page 1 does not contains 5 entries", Integer.valueOf(5), Integer.valueOf(response.size()));
}
开发者ID:msansm1,项目名称:medek-server,代码行数:21,代码来源:AlbumServiceTest.java
示例14: callGetListParamsPTwo
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; //导入依赖的package包/类
/**
* Test for /services/albums GET with params
* Page 2
*
* @throws Exception
*/
@Test
@InSequence(8)
public void callGetListParamsPTwo() throws Exception {
Client client = ClientBuilder.newClient().register(ResteasyJackson2Provider.class);
@SuppressWarnings("unchecked")
List<JsonAlbum> response = client.target(TestConstants.SERVER_ROOT + APP_NAME + svc_root
+ "?from=6&limit=5&orderBy=id&orderDir=asc")
.request(MediaType.APPLICATION_JSON)
.header(Constants.HTTP_HEADER_TOKEN, TestConstants.USER_TOKEN)
.get(List.class);
assertFalse("No album found", response.isEmpty());
assertEquals("List page 2 does not contains 2 entries", Integer.valueOf(2), Integer.valueOf(response.size()));
}
开发者ID:msansm1,项目名称:medek-server,代码行数:21,代码来源:AlbumServiceTest.java
示例15: callAddToCollec
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; //导入依赖的package包/类
/**
* Test for /services/albums/addtocollec POST Test OK
* update
*
* @throws Exception
*/
@Test
@InSequence(9)
public void callAddToCollec() throws Exception {
Client client = ClientBuilder.newClient().register(ResteasyJackson2Provider.class);
JsonMyAlbum album = new JsonMyAlbum(2, 1, 4, "", false);
@SuppressWarnings("unchecked")
List<JsonAlbum> listbefore = client.target(TestConstants.SERVER_ROOT + APP_NAME + svc_root
+ "/user?from=0&limit=5&orderBy=a.id&orderDir=asc&userId=1")
.request(MediaType.APPLICATION_JSON)
.header(Constants.HTTP_HEADER_TOKEN, TestConstants.USER_TOKEN)
.get(List.class);
int sizebefore = listbefore.size();
JsonSimpleResponse response = client.target(TestConstants.SERVER_ROOT + APP_NAME + svc_root + "/addtocollec")
.request(MediaType.APPLICATION_JSON)
.header(Constants.HTTP_HEADER_TOKEN, TestConstants.USER_TOKEN)
.post(Entity.entity(album, MediaType.APPLICATION_JSON), JsonSimpleResponse.class);
assertEquals("true", response.getOk());
@SuppressWarnings("unchecked")
List<JsonAlbum> listafter = client.target(TestConstants.SERVER_ROOT + APP_NAME + svc_root
+ "/user?from=0&limit=5&orderBy=a.id&orderDir=asc&userId=1")
.request(MediaType.APPLICATION_JSON)
.header(Constants.HTTP_HEADER_TOKEN, TestConstants.USER_TOKEN)
.get(List.class);
int sizeafter = listafter.size();
assertTrue("not added correctly : "+sizebefore+" | "+sizeafter, (sizebefore+1)==sizeafter);
}
开发者ID:msansm1,项目名称:medek-server,代码行数:37,代码来源:AlbumServiceTest.java
示例16: callGetList
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; //导入依赖的package包/类
/**
* Test for /services/editors GET Test OK
*
* @throws Exception
*/
@Test
@InSequence(1)
public void callGetList() throws Exception {
Client client = ClientBuilder.newClient().register(ResteasyJackson2Provider.class);
@SuppressWarnings("unchecked")
List<JsonEditor> response = client.target(TestConstants.SERVER_ROOT + APP_NAME + svc_root)
.request(MediaType.APPLICATION_JSON)
.header(Constants.HTTP_HEADER_TOKEN, TestConstants.USER_TOKEN)
.get(List.class);
assertFalse("No editor found", response.isEmpty());
}
开发者ID:msansm1,项目名称:medek-server,代码行数:18,代码来源:EditorServiceTest.java
示例17: callGetOne
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; //导入依赖的package包/类
/**
* Test for /services/editors/{id} GET Test OK
*
* @throws Exception
*/
@Test
@InSequence(2)
public void callGetOne() throws Exception {
Client client = ClientBuilder.newClient().register(ResteasyJackson2Provider.class);
JsonEditor response = client.target(TestConstants.SERVER_ROOT + APP_NAME + svc_root + "/1")
.request(MediaType.APPLICATION_JSON)
.header(Constants.HTTP_HEADER_TOKEN, TestConstants.USER_TOKEN)
.get(JsonEditor.class);
assertEquals("Dupuis", response.getName());
}
开发者ID:msansm1,项目名称:medek-server,代码行数:17,代码来源:EditorServiceTest.java
示例18: callCreate
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; //导入依赖的package包/类
/**
* Test for /services/editors POST Test OK
* creation
*
* @throws Exception
*/
@Test
@InSequence(3)
public void callCreate() throws Exception {
Client client = ClientBuilder.newClient().register(ResteasyJackson2Provider.class);
JsonEditor editor = new JsonEditor(null, "testrest");
JsonEditor response = client.target(TestConstants.SERVER_ROOT + APP_NAME + svc_root)
.request(MediaType.APPLICATION_JSON)
.header(Constants.HTTP_HEADER_TOKEN, TestConstants.USER_TOKEN)
.post(Entity.entity(editor, MediaType.APPLICATION_JSON), JsonEditor.class);
assertEquals("testrest", response.getName());
}
开发者ID:msansm1,项目名称:medek-server,代码行数:19,代码来源:EditorServiceTest.java
示例19: callUpdate
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; //导入依赖的package包/类
/**
* Test for /services/editors POST Test OK
* update
*
* @throws Exception
*/
@Test
@InSequence(4)
public void callUpdate() throws Exception {
Client client = ClientBuilder.newClient().register(ResteasyJackson2Provider.class);
JsonEditor editor = new JsonEditor(1, "msansm1");
JsonEditor response = client.target(TestConstants.SERVER_ROOT + APP_NAME + svc_root)
.request(MediaType.APPLICATION_JSON)
.header(Constants.HTTP_HEADER_TOKEN, TestConstants.USER_TOKEN)
.post(Entity.entity(editor, MediaType.APPLICATION_JSON), JsonEditor.class);
assertEquals("msansm1", response.getName());
}
开发者ID:msansm1,项目名称:medek-server,代码行数:19,代码来源:EditorServiceTest.java
示例20: callDelete
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; //导入依赖的package包/类
/**
* Test for /services/editors POST Test OK
* delete
*
* @throws Exception
*/
@Test
@InSequence(5)
public void callDelete() throws Exception {
Client client = ClientBuilder.newClient().register(ResteasyJackson2Provider.class);
@SuppressWarnings("unchecked")
List<JsonEditor> listbefore = client.target(TestConstants.SERVER_ROOT + APP_NAME + svc_root)
.request(MediaType.APPLICATION_JSON)
.header(Constants.HTTP_HEADER_TOKEN, TestConstants.USER_TOKEN)
.get(List.class);
JsonEditor editor = new JsonEditor(3, Constants.DELETED);
JsonEditor response = client.target(TestConstants.SERVER_ROOT + APP_NAME + svc_root)
.request(MediaType.APPLICATION_JSON)
.header(Constants.HTTP_HEADER_TOKEN, TestConstants.USER_TOKEN)
.post(Entity.entity(editor, MediaType.APPLICATION_JSON), JsonEditor.class);
assertEquals(Constants.DELETED, response.getName());
@SuppressWarnings("unchecked")
List<JsonEditor> listafter = client.target(TestConstants.SERVER_ROOT + APP_NAME + svc_root)
.request(MediaType.APPLICATION_JSON)
.header(Constants.HTTP_HEADER_TOKEN, TestConstants.USER_TOKEN)
.get(List.class);
assertEquals(listbefore.size()-1, listafter.size());
}
开发者ID:msansm1,项目名称:medek-server,代码行数:33,代码来源:EditorServiceTest.java
注:本文中的org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论