Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SoftAssertions changes error #107

Closed
soezen opened this issue Oct 17, 2020 · 2 comments · Fixed by #108
Closed

SoftAssertions changes error #107

soezen opened this issue Oct 17, 2020 · 2 comments · Fixed by #108

Comments

@soezen
Copy link
Contributor

soezen commented Oct 17, 2020

softAssertions.assertThat(changes).ofCreationOnTable(tableName).hasNumberOfChanges(1);

results in error


org.assertj.db.exception.AssertJDBException: There is an exception 'org.assertj.db.api.ChangesAssert$ByteBuddy$TtRdXl7M'
	 in the instantiation of the element org.assertj.db.api.ChangesAssert
	 on class org.assertj.db.type.Changes with class org.assertj.db.api.ChangesAssert$ByteBuddy$TtRdXl7M.
 It is normally impossible.
 That means there is a big mistake in the development of AssertJDB.
 Please write an issue for that if you meet this problem.

	at org.assertj.db.navigation.PositionWithChanges.getChangesInstance(PositionWithChanges.java:135)
	at org.assertj.db.api.ChangesAssert.ofCreation(ChangesAssert.java:96)
	at org.assertj.db.api.ChangesAssert$ByteBuddy$TtRdXl7M.ofCreation$accessor$KthGkVzp(Unknown Source)
	at org.assertj.db.api.ChangesAssert$ByteBuddy$TtRdXl7M$AssertJDb$SoftProxies$tYMTquiR.call(Unknown Source)
	at org.assertj.db.api.ProxifyPositionResult.intercept(ProxifyPositionResult.java:43)
	at org.assertj.db.api.ChangesAssert$ByteBuddy$TtRdXl7M.ofCreation(Unknown Source)
	at org.assertj.db.api.ChangesAssert$ByteBuddy$TtRdXl7M.ofCreation(Unknown Source)
	at org.assertj.db.api.AbstractAssertWithOriginWithChanges.ofCreation(AbstractAssertWithOriginWithChanges.java:57)
	at org.assertj.db.api.ChangeAssert$ByteBuddy$uKlLzKqG.ofCreation$accessor$TFsp0MZt(Unknown Source)
	at org.assertj.db.api.ChangeAssert$ByteBuddy$uKlLzKqG$AssertJDb$SoftProxies$ih8LKRw6.call(Unknown Source)
	at org.assertj.db.api.ProxifyPositionResult.intercept(ProxifyPositionResult.java:43)
	at org.assertj.db.api.ChangeAssert$ByteBuddy$uKlLzKqG.ofCreation(Unknown Source)

In debug it seems that the error occurs on line 128
of PositionWithChanges, there the class name has a replace

Class clazz = Class.forName(myself.getClass().getName().replaceAll("\\$\\$.*", ""));

I think the regex should be replaced with \\$.*\\$.* or \\$.*
As you can see in the error message the actual class name has text in between which is why the current regex is not working

soezen added a commit to soezen/assertj-db that referenced this issue Oct 17, 2020
@soezen soezen changed the title SoftAssertions SoftAssertions changes error Oct 17, 2020
@soezen
Copy link
Contributor Author

soezen commented Oct 17, 2020

When can this be released? or can you suggest a workaround?

soezen added a commit to soezen/assertj-db that referenced this issue Oct 17, 2020
VanRoy pushed a commit that referenced this issue Oct 17, 2020
@VanRoy
Copy link
Member

VanRoy commented Oct 17, 2020

@soezen It's release in 2.0.2. Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants