Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added OperationResultTestMixin providing createOperationResult methods
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
infra/test-util/src/main/java/com/evolveum/midpoint/test/util/OperationResultTestMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.evolveum.midpoint.test.util; | ||
|
||
import com.evolveum.midpoint.schema.result.OperationResult; | ||
import com.evolveum.midpoint.tools.testng.MidpointTestMixin; | ||
|
||
/** | ||
* Mixin interface adding methods for {@link OperationResult} creation with context in its name. | ||
* It is based on {@link MidpointTestMixin} and provides all its operations too. | ||
*/ | ||
public interface OperationResultTestMixin extends MidpointTestMixin { | ||
|
||
/** | ||
* Creates new {@link OperationResult} with name equal to {@link #contextName()}. | ||
*/ | ||
default OperationResult createOperationResult() { | ||
return new OperationResult(contextName()); | ||
} | ||
|
||
/** | ||
* Creates new {@link OperationResult} with name prefixed by {@link #contextName()}. | ||
*/ | ||
default OperationResult createOperationResult(String nameSuffix) { | ||
return new OperationResult(contextName() + "." + nameSuffix); | ||
} | ||
} |