Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,13 @@ public void testExtraCompleteHappy() {
null,
null,
null);
disconnect();
close();
}
catch (Exception ex) {
fail("Exception during connect: " + ex.toString());
} finally {
disconnect();
close();
}
disconnect();
close();
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ public void testHttpConnection() throws Exception {
testConnectionWithAllCiphers(new URI("https://kms-fips.us-east-1.amazonaws.com:443"), true, null);
testConnectionWithAllCiphers(new URI("https://kms.us-west-2.amazonaws.com:443"), true, null);
testConnectionWithAllCiphers(new URI("https://kms-fips.us-west-2.amazonaws.com:443"), true, null);

// BadSSL
testConnectionWithAllCiphers(new URI("https://rsa2048.badssl.com/"), true, null);
testConnectionWithAllCiphers(new URI("http://http.badssl.com/"), true, null);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import org.junit.After;

class MissingCredentialsException extends RuntimeException {
MissingCredentialsException(String message) {
Expand Down Expand Up @@ -142,6 +143,13 @@ protected void setConnectionMessageTransformer(Consumer<MqttMessage> connectionM
this.connectionMessageTransfomer = connectionMessageTransfomer;
}

@After
@Override
public void tearDown() {
close();
super.tearDown();
}

MqttClientConnectionFixture() {
}

Expand Down Expand Up @@ -386,7 +394,10 @@ void disconnect() {
}

void close() {
connection.close();
if(connection!=null) {
connection.close();
connection = null;
}
}

CompletableFuture<Integer> publish(String topic, byte[] payload, QualityOfService qos) {
Expand Down Expand Up @@ -444,4 +455,3 @@ OnConnectionClosedReturn waitForConnectClose() throws Exception {
return onConnectionClosedFuture.get(60, TimeUnit.SECONDS);
}
}