@SuppressWarnings("ConstantConditions") @Test void testAddEntityNull() { Entity entity = null; Exception exception = assertThrows(NullPointerException.class, () -> postgreSqlRepo.add(entity)); assertThat(exception.getMessage()) .containsPattern("PostgreSqlRepository.add\\(\\) failed: entity was null"); }
@Override public void add(Entity entity) { if (entity == null) { throw new NullPointerException("PostgreSqlRepository.add() failed: entity was null"); } add(Stream.of(entity)); }
PostgreSqlRepository extends AbstractRepository { @Override public void add(Entity entity) { if (entity == null) { throw new NullPointerException("PostgreSqlRepository.add() failed: entity was null"); } add(Stream.of(entity)); } }
PostgreSqlRepository extends AbstractRepository { @Override public void add(Entity entity) { if (entity == null) { throw new NullPointerException("PostgreSqlRepository.add() failed: entity was null"); } add(Stream.of(entity)); } PostgreSqlRepository(
      PostgreSqlEntityFactory postgreSqlEntityFactory,
      JdbcTemplate jdbcTemplate,
      DataSource dataSource,
      EntityType entityType); }
PostgreSqlRepository extends AbstractRepository { @Override public void add(Entity entity) { if (entity == null) { throw new NullPointerException("PostgreSqlRepository.add() failed: entity was null"); } add(Stream.of(entity)); } PostgreSqlRepository(
      PostgreSqlEntityFactory postgreSqlEntityFactory,
      JdbcTemplate jdbcTemplate,
      DataSource dataSource,
      EntityType entityType); @Override Iterator<Entity> iterator(); @Override Set<RepositoryCapability> getCapabilities(); @Override Set<Operator> getQueryOperators(); @Override EntityType getEntityType(); @Override long count(Query<Entity> q); @Override Stream<Entity> findAll(Query<Entity> q); @Override Entity findOne(Query<Entity> q); @Override Entity findOneById(Object id); @Override Entity findOneById(Object id, Fetch fetch); @Override void update(Entity entity); @Override void update(Stream<Entity> entities); @Override void delete(Entity entity); @Override void delete(Stream<Entity> entities); @Override void deleteById(Object id); @Override void deleteAll(Stream<Object> ids); @Override void deleteAll(); @Override void add(Entity entity); @Override Integer add(Stream<Entity> entities); @Override void forEachBatched(Fetch fetch, Consumer<List<Entity>> consumer, int batchSize); }
PostgreSqlRepository extends AbstractRepository { @Override public void add(Entity entity) { if (entity == null) { throw new NullPointerException("PostgreSqlRepository.add() failed: entity was null"); } add(Stream.of(entity)); } PostgreSqlRepository(
      PostgreSqlEntityFactory postgreSqlEntityFactory,
      JdbcTemplate jdbcTemplate,
      DataSource dataSource,
      EntityType entityType); @Override Iterator<Entity> iterator(); @Override Set<RepositoryCapability> getCapabilities(); @Override Set<Operator> getQueryOperators(); @Override EntityType getEntityType(); @Override long count(Query<Entity> q); @Override Stream<Entity> findAll(Query<Entity> q); @Override Entity findOne(Query<Entity> q); @Override Entity findOneById(Object id); @Override Entity findOneById(Object id, Fetch fetch); @Override void update(Entity entity); @Override void update(Stream<Entity> entities); @Override void delete(Entity entity); @Override void delete(Stream<Entity> entities); @Override void deleteById(Object id); @Override void deleteAll(Stream<Object> ids); @Override void deleteAll(); @Override void add(Entity entity); @Override Integer add(Stream<Entity> entities); @Override void forEachBatched(Fetch fetch, Consumer<List<Entity>> consumer, int batchSize);  }