Skip to content

Commit

Permalink
Asn1CommandManagerTest and SecurityServicesPropertiesValidator test u…
Browse files Browse the repository at this point in the history
…pdates for better validation
  • Loading branch information
mcook42 committed Nov 1, 2024
1 parent f0ebedc commit 04cee75
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import java.net.URI;
import java.net.URISyntaxException;
import java.util.Objects;

public class SecurityServicesPropertiesValidator implements Validator {

Expand All @@ -29,7 +30,7 @@ public void validate(Object target, org.springframework.validation.Errors errors
if (!uri.getScheme().equals("http") && !uri.getScheme().equals("https")) {
errors.rejectValue(fieldName, errorCode, "Signature endpoint must be an http URL");
}
if (uri.getHost() == null || uri.getHost().isEmpty()) {
if (uri.getHost() == null || Objects.equals(uri.getHost(), "null") || uri.getHost().isEmpty()) {
errors.rejectValue(fieldName, errorCode, "Signature endpoint must have a host");
}
if (uri.getPort() < 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import us.dot.its.jpo.ode.kafka.SDXDepositorTopics;
import us.dot.its.jpo.ode.model.OdeTravelerInputData;
import us.dot.its.jpo.ode.rsu.RsuProperties;
import us.dot.its.jpo.ode.security.SecurityServicesProperties;
import us.dot.its.jpo.ode.services.asn1.Asn1CommandManager.Asn1CommandManagerException;
import us.dot.its.jpo.ode.snmp.SnmpSession;
import us.dot.its.jpo.ode.wrapper.MessageProducer;
Expand All @@ -47,6 +48,9 @@ public class Asn1CommandManagerTest {
@Injectable
RsuProperties injectableRsuProperties;

@Injectable
SecurityServicesProperties injectableSecurityServicesProperties;

@Capturing
MessageProducer<String, String> capturingMessageProducer;
@Capturing
Expand Down
2 changes: 1 addition & 1 deletion jpo-ode-svcs/src/test/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ode:
brokers: "localhost:9092"
producer:
type: "async"
acks: "some"
acks: "0"
retries: 1
batch-size: 1638
linger-ms: 2
Expand Down

0 comments on commit 04cee75

Please sign in to comment.