Skip to content

Commit

Permalink
fix: tests adapted to modifications on new exceptions for sql integri…
Browse files Browse the repository at this point in the history
…ty violations
  • Loading branch information
angelo.andreussi committed Jan 13, 2025
1 parent 02998f4 commit ff4209e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void convertPersistenceDatabaseExceptionTest() {
Mockito.when(mockedDatabaseException.getInternalException()).thenReturn(mockedDatabaseException);
Assert.assertEquals("ComparisonFailure not expected for: " + exception,kapuaException.toString(), KapuaExceptionUtils.convertPersistenceException(exception).toString());

Mockito.verify(mockedDatabaseException, Mockito.times(12)).getInternalException();
Mockito.verify(mockedDatabaseException, Mockito.times(13)).getInternalException();
Mockito.verify(mockedDatabaseException, Mockito.times(12)).getMessage();
Mockito.verify(mockedDatabaseException, Mockito.times(13)).getErrorCode();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Feature: Domain Service tests
| test_name_1 | read,write |
Then A domain was created
And The domain matches the creator
Given I expect the exception "KapuaException" with the text "Error during Persistence Operation"
Given I expect the exception "KapuaSQLIntegrityConstraintViolationException" with the text "SQL integrity constraint violation!"
When I create the domain
| name | actions |
| test_name_1 | read,write |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ Feature: User Coupling
And I set the reserved user for the connection from device "device-1" in account "test-acc-1" to "test-user-1"
Then I set the user coupling mode for the connection from device "device-2" in account "test-acc-1" to "STRICT"
# Try to set a duplicate reserved user
Given I expect the exception "KapuaException" with the text "Error during Persistence Operation"
Given I expect the exception "KapuaSQLIntegrityConstraintViolationException" with the text "SQL integrity constraint violation!"
When I set the reserved user for the connection from device "device-2" in account "test-acc-1" to "test-user-1"
Then An exception was thrown
# Reserved users must be unique!
Expand Down Expand Up @@ -873,7 +873,7 @@ Feature: User Coupling
And I set the reserved user for the connection from device "device-1" in account "test-acc-1" to "test-user-1"
Then I set the user coupling mode for the connection from device "device-2" in account "test-acc-1" to "STRICT"
# Try to set a duplicate reserved user
Given I expect the exception "KapuaException" with the text "Error during Persistence Operation"
Given I expect the exception "KapuaSQLIntegrityConstraintViolationException" with the text "SQL integrity constraint violation!"
When I set the reserved user for the connection from device "device-2" in account "test-acc-1" to "test-user-1"
Then An exception was thrown
# Reserved users must be unique!
Expand Down

0 comments on commit ff4209e

Please sign in to comment.