My project uses PostgreSQL for production and H2 database for tests. Some content is saved to database and afterwards it is retrieved, changed and saved again to new rows. In this method some of retrieved contents' IDs are set to null, and PostgreSQL autoincrements them again when contents are being saved for the second time. In my test case H2 database doesn't do the same - it autoincrements IDs when contents are being saved for the first time, but when I retrieve them and set the IDs to null and save them again, IDs stay null. They don't get autoincremented when being saved, and only when I try to map this new object to a DTO, I get this error: identifier of an instance of X was altered from 1 to null. The method is called from a controller that I'm mocking in a test, if that makes a difference.
H2 database doesn't autoincrement IDs after them being set to null, while PostgreSQL does
91 views Asked by bluebird At
0
There are 0 answers
Related Questions in POSTGRESQL
- Only the first SQL script gets executed inside Docker Postgres container
- Compare fields in two tables
- Hibernate ClobJdbcType bindings: what are the diferences?
- Postgres && statement Error in Mybatis Mapper?
- Can this query be optimized? (Choosing a random row to insert, that excludes previously inserted Rows)
- Connection terminated unexpectedly while performing multi row insert using pg-promise
- Processing multiple forms in nodejs and postgresql
- How to copy data from SQLite to postgreSQL?
- PGAdmin4 configured behind a reverse proxy but unable to connect to Postgresql server
- Updates to pgsodium encrypted values don't use specified key_id
- Connecting to Postgres running in a Docker container using psql
- Can't connect to local postgresql server from my docker container
- Django Arrayfield migration to cloud sql (Postgresql) not creating the column
- Get list of matching keywords for each post
- docker-compose can't reset postgresql database
Related Questions in TESTING
- Using ES Modules with TS, and Jest testing(cannot use import statement outside module)
- Mocking AmazonS3 listObjects function in scala
- How to refer to the filepath of test data in test sourcecode?
- No tests found for given includes: [com.bright.TwitterAnalog.AuthenticationControllerSpec.Register user with valid request](--tests filter)
- Error WebMock::NetConnectNotAllowedError in testing with stub using minitest in rails (using Faraday)
- How to use Mockito for WebClient get call?
- Jest + JavaScript ES Modules
- How to configure api http request with load testing
- How can I make asserts on outbound HTTP requests?
- higher coefficient of determination values in the testing phase compared to the training phase
- Writing test methods with shared expensive set-up
- Slow performance when testing non-local IP services with Playwright
- uiState not updating in Tests
- Incorrect implementation of calloc() introduces division by zero and how to detect it via testing?
- How to test Creating and Cancelling Subscription in ThriveCart in Test Mode
Related Questions in INTEGRATION-TESTING
- S3 integration testing
- UI Integration Testing - Android Instrumentation ref now in android app
- Specflow defination not showing references
- How can I cause mouseenter and mouseleave from dispatched mousemove events
- Automation testing for Flutter app in complex environment
- Error when trying to run an integration test
- Selenium firefox webdriver failed to update gecko (tcp connect error)
- Cannot access a widget by its key during integration test flutter
- How to verify method invocation of a class which is a constructor parameter for another class Mockito Kotlin?
- Exception when using Sqlite with Nhibernate for integration tests
- .Net TestContainers and Integration Tests
- TestContainers - disable test containers based on spring profile
- How to profile integration tests in java
- How do I code an integration test for a .NET 8 web app that checks that when an endpoint has an uncaught exception, the server responds with HTTP 500?
- Integration tests for secure endpoint in quarkus
Related Questions in H2
- No qualifying bean of type 'com.example.dao.impl.UserDaoImpl' available: expected at least 1 bean which qualifies as autowire candidate
- I am trying to use h2 in-memory db from my spring boot application, my spring boot version is 3.1.10, but its not connecting to h2 properly
- spark use the metastore with H2
- Rollback to Savepoint with H2 Database
- Sum of grouped array column elements
- How does one convert a JSON string value to a VARCHAR value (excluding quotes) in H2?
- Why H2 tries to drop table upon adding a new column with Liquibase changeset?
- Unique constaraint not working properly in unit test script
- Mockito test does not trigger unique constraint violation in H2
- H2 spring boot test drop table
- Failed to start quarkus for tests. "Datasource '<default>' is not configured." YAML configuration problem
- H2 from version upgrade 1.3.176 - 2.2.224 Exception: Cannot find h2db client jar file, h2 jdbc driver will not be available by default
- null JsonNode object saved as "null" string using H2 DB
- Proper use of field reference on JSON column in H2 database query?
- how to use flyway + h2 + jooq codegen together?
Related Questions in CONTROLLER-TESTS
- Controller integration tests lose the session after follow_redirect
- Getting no route matches when simulating a session in rails minitest
- H2 database doesn't autoincrement IDs after them being set to null, while PostgreSQL does
- mockMvc.perform is ignoring @pattern annotation on header field when testing controller method
- No qualifying bean of type 'org.springframework.boot.actuate.health.HealthEndpoint' in controller test
- StatementInvalid: SQLite3::BusyException: database is locked
- how moq one of the interfaces in controller test
- Moq; Unit Test - Method is always failing. ISetup is not working
- wrong number of arguments error while testing comments controller using Rspec
- @SpringBootTest: @MockBean not injected when multiple test classes
- Rspec rails-controller-testing gem's assigns doesn't work
- UrlGenerationError when testing controller usinf Rspec
- How to manipulate the application configs for controller tests?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)