Skip to content

How to parameterize an InjectMock in a junit ParamterizedTest? #35437

Discussion options

You must be logged in to vote

I resolved it like

getMock1() -> InsertedService

getMock2() -> InsertedService

test1() -> void {
QuarkusMock.installMockForInstance(getMock1(), insertedService)
//
}

test2() -> void {
QuarkusMock.installMockForInstance(getMock2(), insertedService)
//
}

Had to change @InjectMock to @Inject

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@geoand
Comment options

geoand Aug 22, 2023
Collaborator

@matter-it-does
Comment options

Answer selected by matter-it-does
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants