use of org.zalando.nakadi.config.JsonConfig in project nakadi by zalando.
the class SubscriptionDbRepositoryTest method whenCreateSubscriptionThenOk.
@Test
public void whenCreateSubscriptionThenOk() throws Exception {
final SubscriptionBase subscription = RandomSubscriptionBuilder.builder().build();
final Subscription createdSubscription = repository.createSubscription(subscription);
checkSubscriptionCreatedFromSubscriptionBase(createdSubscription, subscription);
final int rows = template.queryForObject("SELECT count(*) FROM zn_data.subscription where s_id=?", Integer.class, createdSubscription.getId());
assertThat("Number of rows should be 1", rows, equalTo(1));
final Map<String, Object> result = template.queryForMap("SELECT s_subscription_object FROM zn_data.subscription WHERE s_id=?", createdSubscription.getId());
final ObjectMapper mapper = (new JsonConfig()).jacksonObjectMapper();
final Subscription saved = mapper.readValue(result.get("s_subscription_object").toString(), Subscription.class);
assertThat("Saved subscription equal to original one", saved, equalTo(createdSubscription));
}
use of org.zalando.nakadi.config.JsonConfig in project nakadi by zalando.
the class Aruha771MigrationHelper method main.
public static void main(final String[] args) throws Exception {
final Aruha771MigrationHelper helper = new Aruha771MigrationHelper(new HashGenerator(), new JsonConfig().jacksonObjectMapper());
helper.fillSubscriptionsHashes();
}
Aggregations