Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: mock sfera communication and add example JP and SP #323

Merged
merged 4 commits into from
Oct 25, 2024

Conversation

mghilardelli
Copy link
Collaborator

No description provided.

@mghilardelli mghilardelli requested a review from Grodien as a code owner October 24, 2024 11:28
@mghilardelli mghilardelli linked an issue Oct 24, 2024 that may be closed by this pull request

var tid = TrainIdentification.fromString(elements[length - 2], elements[length - 3]);

return new RequestContext(tid, new ClientId(UUID.fromString(elements[length - 1])), incomingMessageId, Optional.empty());

This comment was marked as resolved.

import java.util.UUID;
import lombok.NonNull;

public record ClientId(@NonNull UUID value) implements Comparable<ClientId> {
Copy link
Collaborator Author

@mghilardelli mghilardelli Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • value: String

import java.util.UUID;
import lombok.NonNull;

public record RequestContext(@NonNull TrainIdentification tid, @NonNull ClientId clientId, @NonNull Optional<UUID> incomingMessageId, @NonNull Optional<String> customPrefix) {

This comment was marked as resolved.

Copy link
Collaborator

@rawi-coding rawi-coding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good to me 👍 I didn't test it locally but if you wish for it, maybe we can take a look at the setup together.

public static TrainIdentification fromString(String tid, String companyCode) {
var matcher = TID_PATTERN.matcher(tid);
if (matcher.matches()) {
var operationalNumber = matcher.group(2);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: you could use final var generally in your code. Just a nitpick, no need to change it now.

@mghilardelli mghilardelli merged commit d44a434 into main Oct 25, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mock Backend für Integrations-/End to end-Tests
2 participants