JaxbJsonSerializer { public T deserialize(String json) throws IOException { return (T) mapper.readValue(json, type); } JaxbJsonSerializer(Class<T> type); String serialize(T object); T deserialize(String json);  }
@Test public void testDeSerialize() throws Exception { JaxbJsonSerializer<TestConfig> serializer = new JaxbJsonSerializer<>(TestConfig.class); TestConfig desCreds = serializer.deserialize(jsonTestConfig); List<StorageProviderCredential> credList = desCreds.getProviderCredentials(); Assert.assertEquals(1, credList.size()); Assert.assertEquals("amazon-user", credList.get(0).getCredential().getUsername()); Assert.assertEquals("queue-name", desCreds.getQueueName()); }