test_class.declarator: thrown= ExpectedException.none()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public ExpectedException thrown= ExpectedException.none();
test_class.type: ExpectedException
test_class.var_name: thrown
test_class.declarator: subscriptionsRepository
test_class.modifier: @Autowired
test_class.original_string: @Autowired
      SubscriptionsRepository subscriptionsRepository;
test_class.type: SubscriptionsRepository
test_class.var_name: subscriptionsRepository
test_class.declarator: jdbcTemplate
test_class.modifier: @Autowired
      protected
test_class.original_string: @Autowired
      protected JdbcTemplate jdbcTemplate;
test_class.type: JdbcTemplate
test_class.var_name: jdbcTemplate
test_class.file: cepheus-broker/src/test/java/com/orange/cepheus/broker/persistence/SubscriptionsRepositoryTest.java
test_class.identifier: SubscriptionsRepositoryTest
test_case.body: @Test
      public void getAllSubscriptionsWithExceptionTest() throws SubscriptionPersistenceException {
          thrown.expect(SubscriptionPersistenceException.class);
          Instant expirationDate = Instant.now().plus(1, ChronoUnit.DAYS);
          jdbcTemplate.update("insert into t_subscriptions(id,expirationDate,subscribeContext) values(?,?,?)", "12345", expirationDate.toString(), "aaaaaa");
          Map<String, Subscription> subscriptions = subscriptionsRepository.getAllSubscriptions();
      }
test_case.class_method_signature: SubscriptionsRepositoryTest.getAllSubscriptionsWithExceptionTest()
test_case.full_signature: @Test public void getAllSubscriptionsWithExceptionTest()
test_case.identifier: getAllSubscriptionsWithExceptionTest
test_case.invocations: expect plus now update toString getAllSubscriptions
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getAllSubscriptionsWithExceptionTest()
focal_class.declarator: logger = LoggerFactory.getLogger(SubscriptionsRepository.class)
focal_class.modifier: private static
focal_class.original_string: private static Logger logger = LoggerFactory.getLogger(SubscriptionsRepository.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: jdbcTemplate
focal_class.modifier: @Autowired
      protected
focal_class.original_string: @Autowired
      protected JdbcTemplate jdbcTemplate;
focal_class.type: JdbcTemplate
focal_class.var_name: jdbcTemplate
focal_class.declarator: mapper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private ObjectMapper mapper;
focal_class.type: ObjectMapper
focal_class.var_name: mapper
focal_class.file: cepheus-broker/src/main/java/com/orange/cepheus/broker/persistence/SubscriptionsRepository.java
focal_class.identifier: SubscriptionsRepository
focal_class.class_method_signature: SubscriptionsRepository.createTableOnStartup()
focal_class.full_signature: @PostConstruct protected void createTableOnStartup()
focal_class.identifier: createTableOnStartup
focal_class.modifiers: @PostConstruct protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void createTableOnStartup()
focal_class.class_method_signature: SubscriptionsRepository.saveSubscription(Subscription subscription)
focal_class.full_signature: public void saveSubscription(Subscription subscription)
focal_class.identifier: saveSubscription
focal_class.modifiers: public
focal_class.parameters: (Subscription subscription)
focal_class.return: void
focal_class.signature: void saveSubscription(Subscription subscription)
focal_class.class_method_signature: SubscriptionsRepository.updateSubscription(Subscription subscription)
focal_class.full_signature: public void updateSubscription(Subscription subscription)
focal_class.identifier: updateSubscription
focal_class.modifiers: public
focal_class.parameters: (Subscription subscription)
focal_class.return: void
focal_class.signature: void updateSubscription(Subscription subscription)
focal_class.class_method_signature: SubscriptionsRepository.getAllSubscriptions()
focal_class.full_signature: public Map<String, Subscription> getAllSubscriptions()
focal_class.identifier: getAllSubscriptions
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Map<String, Subscription>
focal_class.signature: Map<String, Subscription> getAllSubscriptions()
focal_class.class_method_signature: SubscriptionsRepository.removeSubscription(String subscriptionId)
focal_class.full_signature: public void removeSubscription(String subscriptionId)
focal_class.identifier: removeSubscription
focal_class.modifiers: public
focal_class.parameters: (String subscriptionId)
focal_class.return: void
focal_class.signature: void removeSubscription(String subscriptionId)
focal_method.body: public Map<String, Subscription> getAllSubscriptions() throws SubscriptionPersistenceException {
          Map<String, Subscription> subscriptions = new ConcurrentHashMap<>();
          try {
              List<Subscription> subscriptionList = jdbcTemplate.query("select id, expirationDate, subscribeContext from t_subscriptions",
                      (ResultSet rs, int rowNum) ->  {
                              Subscription subscription = new Subscription();
                              try {
                                  subscription.setSubscriptionId(rs.getString("id"));
                                  subscription.setExpirationDate(Instant.parse(rs.getString("expirationDate")));
  
                                  subscription.setSubscribeContext(mapper.readValue(rs.getString("subscribeContext"), SubscribeContext.class));
                              } catch (IOException e) {
                                      throw new SQLException(e);
                              }
                              return subscription;
                          });
              subscriptionList.forEach(subscription -> subscriptions.put(subscription.getSubscriptionId(), subscription));
          } catch (DataAccessException e) {
              throw new SubscriptionPersistenceException(e);
          }
          return subscriptions;
      }
focal_method.class_method_signature: SubscriptionsRepository.getAllSubscriptions()
focal_method.full_signature: public Map<String, Subscription> getAllSubscriptions()
focal_method.identifier: getAllSubscriptions
focal_method.invocations: query setSubscriptionId getString setExpirationDate parse getString setSubscribeContext readValue getString forEach put getSubscriptionId
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: Map<String, Subscription>
focal_method.signature: Map<String, Subscription> getAllSubscriptions()