Skip to content

SoftAssertions changes error #107

Closed
@soezen

Description

@soezen
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

Activity

added a commit that references this issue on Oct 17, 2020
2d7754c
changed the title [-]SoftAssertions [/-] [+]SoftAssertions changes error[/+] on Oct 17, 2020
soezen

soezen commented on Oct 17, 2020

@soezen
ContributorAuthor

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

added a commit that references this issue on Oct 17, 2020
added a commit that references this issue on Oct 17, 2020
e753f0a
VanRoy

VanRoy commented on Oct 17, 2020

@VanRoy
Member

@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @VanRoy@soezen

      Issue actions

        SoftAssertions changes error · Issue #107 · assertj/assertj-db