SubscriptionMapper { public Subscription mapUpdateSubscriptionFormToSeyren(Subscription subscription) throws CerebroException { setDefaultFromToTimeIfEmptyOrNull(subscription); return subscription; }  Subscription mapNewSubscriptionFormToSeyren(Subscription subscription); Subscription mapUpdateSubscriptionFormToSeyren(Subscription subscription); static final String DEFAULT_FROM_TIME; static final String DEFAULT_TO_TIME; }
@Test public void testMapUpdateSetNullFromToTimeToDefaultValues() throws Exception { Subscription s = this.defaultSubscription; s.setFromTime(null); s.setToTime(null); s = subscriptionMapper.mapUpdateSubscriptionFormToSeyren(s); assertEquals(SubscriptionMapper.DEFAULT_FROM_TIME, s.getFromTime()); assertEquals(SubscriptionMapper.DEFAULT_TO_TIME, s.getToTime()); }
@Test public void testMapUpdateSetEmptyFromToTimeToDefaultValues() throws Exception { Subscription s = this.defaultSubscription; s.setFromTime(""); s.setToTime(""); s = subscriptionMapper.mapUpdateSubscriptionFormToSeyren(s); assertEquals(SubscriptionMapper.DEFAULT_FROM_TIME, s.getFromTime()); assertEquals(SubscriptionMapper.DEFAULT_TO_TIME, s.getToTime()); }