File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
java/src/test/java/org/eclipse/ditto/client Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -57,14 +57,10 @@ public final class DittoClientPoliciesTest extends AbstractDittoClientTest {
57
57
public void verifyClientDefaultsToSchemaVersion2ForPolicyCommands () {
58
58
messaging = new MockMessagingProvider (JsonSchemaVersion .V_1 );
59
59
final DittoClient client = DittoClients .newInstance (messaging );
60
- try {
61
- assertEventualCompletion (client .policies ().retrieve (POLICY_ID ));
62
- final RetrievePolicy command = expectMsgClass (RetrievePolicy .class );
63
- reply (RetrievePolicyResponse .of (POLICY_ID , POLICY , command .getDittoHeaders ()));
64
- assertThat (command ).hasSchemaVersion (JsonSchemaVersion .V_2 );
65
- } finally {
66
- client .destroy ();
67
- }
60
+ assertEventualCompletion (client .policies ().retrieve (POLICY_ID ).thenRun (client ::destroy ));
61
+ final RetrievePolicy command = expectMsgClass (RetrievePolicy .class );
62
+ reply (RetrievePolicyResponse .of (POLICY_ID , POLICY , command .getDittoHeaders ()));
63
+ assertThat (command ).hasSchemaVersion (JsonSchemaVersion .V_2 );
68
64
}
69
65
70
66
@ Test
You can’t perform that action at this time.
0 commit comments