Skip to content

Commit

Permalink
Merge branch 'steve-community:master' into MultiUsers
Browse files Browse the repository at this point in the history
  • Loading branch information
fnkbsi authored Dec 24, 2023
2 parents 2f67258 + bbb526c commit 6fde7dc
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.2</version>
<version>3.2.3</version>
</plugin>

<!-- Static analysis and check style -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ private void tryInsertingFailed(UpdateTransactionParams p, Exception e) {
try {
ctx.insertInto(TRANSACTION_STOP_FAILED)
.set(TRANSACTION_STOP_FAILED.TRANSACTION_PK, p.getTransactionId())
.set(TRANSACTION_STOP_FAILED.CHARGE_BOX_ID, p.getChargeBoxId())
.set(TRANSACTION_STOP_FAILED.EVENT_TIMESTAMP, p.getEventTimestamp())
.set(TRANSACTION_STOP_FAILED.EVENT_ACTOR, mapActor(p.getEventActor()))
.set(TRANSACTION_STOP_FAILED.STOP_TIMESTAMP, p.getStopTimestamp())
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/rwth/idsg/steve/web/validation/IdTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
@Constraint(validatedBy = {IdTagValidator.class, IdTagListValidator.class})
public @interface IdTag {

String message() default "ID Tag can only contain upper or lower case letters, numbers and dot, colon, dash, underscore symbols";
String message() default "ID Tag can only contain upper or lower case letters, numbers and dot, colon, dash, underscore or hash symbols";

// Required by validation runtime
Class<?>[] groups() default {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/
public class IdTagValidator implements ConstraintValidator<IdTag, String> {

private static final String IDTAG_PATTERN = "^[a-zA-Z0-9.:_-]{1,20}$";
private static final String IDTAG_PATTERN = "^[a-zA-Z0-9.:_#-]{1,20}$";
private static final Pattern PATTERN = Pattern.compile(IDTAG_PATTERN);

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,20 @@ public void testColon() {
Assertions.assertTrue(validator.isValid("VID:00XXXXXXXXXX", null));
}

@Test
public void testPoundSign() {
Assertions.assertTrue(validator.isValid("#test", null));
Assertions.assertTrue(validator.isValid("test#", null));
Assertions.assertTrue(validator.isValid("te##st", null));

// Tag provided by Webasto charge points
// https://github.com/steve-community/steve/pull/1322
Assertions.assertTrue(validator.isValid("#FreeCharging", null));
}

@Test
public void testCombined() {
Assertions.assertTrue(validator.isValid("1t.E-S_:t20", null));
Assertions.assertTrue(validator.isValid("1t.E-S_:t20#", null));
}

}

0 comments on commit 6fde7dc

Please sign in to comment.