Skip to content

Commit

Permalink
validation testing
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekdrobczyk committed Jul 31, 2024
1 parent 0463929 commit fba4255
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import com.google.common.base.Strings;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Objects;

Expand All @@ -13,6 +15,7 @@
public class TopicName {

public static final char GROUP_SEPARATOR = '.';
private static final Logger logger = LoggerFactory.getLogger(TopicName.class);

@NotEmpty
@Pattern(regexp = ALLOWED_NAME_REGEX)
Expand All @@ -39,7 +42,7 @@ public static TopicName fromQualifiedName(String qualifiedName) {

int index = qualifiedName.lastIndexOf(GROUP_SEPARATOR);
if (index == -1) {
System.out.println("Invalid qualified name: " + qualifiedName);
logger.info("Invalid qualified name {}", qualifiedName);
throw new IllegalArgumentException("Missing group");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class OfflineRetransmissionEndpoint {
private final OfflineRetransmissionService retransmissionService;
private final RetransmissionPermissions permissions;
private final OfflineRetransmissionAuditor auditor;
private final Logger logger = LoggerFactory.getLogger(OfflineRetransmissionEndpoint.class);

public OfflineRetransmissionEndpoint(OfflineRetransmissionService retransmissionService,
TopicRepository topicRepository, ManagementRights managementRights) {
Expand All @@ -47,7 +48,7 @@ public OfflineRetransmissionEndpoint(OfflineRetransmissionService retransmission
@POST
@Consumes(APPLICATION_JSON)
public Response createRetransmissionTask(@Valid OfflineRetransmissionRequest request, @Context ContainerRequestContext requestContext) {
System.out.println("Offline retransmission request: " + request);
logger.info("Offline retransmission request: {}", request);
retransmissionService.validateRequest(request);
permissions.ensurePermissionsToBothTopics(request, requestContext);
var task = retransmissionService.createTask(request);
Expand Down

0 comments on commit fba4255

Please sign in to comment.