Skip to content

Commit

Permalink
Address some trivial warnings and deprecations in two model test clas…
Browse files Browse the repository at this point in the history
…ses (strimzi#10024)

Signed-off-by: Jakub Scholz <[email protected]>
  • Loading branch information
scholzj authored Apr 25, 2024
1 parent 941ede8 commit affc196
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
import java.security.cert.CertificateParsingException;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
Expand Down Expand Up @@ -4084,7 +4083,7 @@ public void testNodePortWithBootstrapExternalIPs() {
// set externalIP
GenericKafkaListenerConfigurationBootstrap bootstrapConfig = new GenericKafkaListenerConfigurationBootstrapBuilder()
.withNodePort(32100)
.withExternalIPs(Arrays.asList("10.0.0.1"))
.withExternalIPs(List.of("10.0.0.1"))
.build();

Kafka kafkaAssembly = new KafkaBuilder(KAFKA)
Expand All @@ -4107,7 +4106,7 @@ public void testNodePortWithBootstrapExternalIPs() {

List<Service> services = kc.generateExternalBootstrapServices();
assertThat(services.get(0).getSpec().getType(), is("NodePort"));
assertEquals(services.get(0).getSpec().getExternalIPs(), Arrays.asList("10.0.0.1"));
assertEquals(services.get(0).getSpec().getExternalIPs(), List.of("10.0.0.1"));
}

@ParallelTest
Expand All @@ -4117,7 +4116,7 @@ public void testNodePortWithBrokerExternalIPs() {
nodePortListenerBrokerConfig.setBroker(0);
nodePortListenerBrokerConfig.setNodePort(32000);
nodePortListenerBrokerConfig.setAdvertisedHost("advertised.host");
nodePortListenerBrokerConfig.setExternalIPs(Arrays.asList("10.0.0.1"));
nodePortListenerBrokerConfig.setExternalIPs(List.of("10.0.0.1"));

Kafka kafkaAssembly = new KafkaBuilder(KAFKA)
.editSpec()
Expand All @@ -4139,6 +4138,6 @@ public void testNodePortWithBrokerExternalIPs() {

List<Service> services = kc.generatePerPodServices();
assertThat(services.get(0).getSpec().getType(), is("NodePort"));
assertEquals(services.get(0).getSpec().getExternalIPs(), Arrays.asList("10.0.0.1"));
assertEquals(services.get(0).getSpec().getExternalIPs(), List.of("10.0.0.1"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ public void testGenerateBrokerSecret() throws CertificateParsingException {
"foo-zookeeper-1.crt", "foo-zookeeper-1.key", "foo-zookeeper-1.p12", "foo-zookeeper-1.password",
"foo-zookeeper-2.crt", "foo-zookeeper-2.key", "foo-zookeeper-2.p12", "foo-zookeeper-2.password")));
X509Certificate cert = Ca.cert(secret, "foo-zookeeper-0.crt");
assertThat(cert.getSubjectDN().getName(), is("CN=foo-zookeeper, O=io.strimzi"));
assertThat(cert.getSubjectX500Principal().getName(), is("CN=foo-zookeeper,O=io.strimzi"));
assertThat(new HashSet<Object>(cert.getSubjectAlternativeNames()), is(set(
asList(2, "foo-zookeeper-0"),
asList(2, "foo-zookeeper-0.foo-zookeeper-nodes.test.svc"),
Expand Down

0 comments on commit affc196

Please sign in to comment.