Set project name property in a test

I have a gradle test and need to override the project.name property. Here is my code:

project = org.gradle.testfixtures.ProjectBuilder.builder().build()
project.setProperty("name", "eda-eventtypeeditor-isdoctype")

unfortunately, the name property is read-only so I get a ““Cannot set the value of read-only property ‘name’ on root project ‘test’.””

Is there a way to set my project name for my test? thanks

here is the answer:

project.metaClass.getName {"eda-eventtypeeditor-isdoctype"}

Thank you for sharing your fix, this has helped me a lot.