Skip to content

Commit 21b2e9d

Browse files
sgramponeBeta Bot
authored andcommitted
Cherry pick branch 'genexuslabs:securityapicommons' into beta
1 parent 6d14dbc commit 21b2e9d

File tree

4 files changed

+28
-11
lines changed

4 files changed

+28
-11
lines changed

gxjwt/pom.xml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<groupId>${project.groupId}</groupId>
5858
<artifactId>securityapicommons</artifactId>
5959
<type>test-jar</type>
60-
<version>${project.version}</version>
60+
<version>${revision}${changelist}</version>
6161
<scope>test</scope>
6262
</dependency>
6363
</dependencies>
@@ -71,6 +71,18 @@
7171
<artifactId>maven-compiler-plugin</artifactId>
7272
<version>3.8.0</version>
7373
</plugin>
74+
<plugin>
75+
<groupId>org.apache.maven.plugins</groupId>
76+
<artifactId>maven-jar-plugin</artifactId>
77+
<version>3.1.1</version>
78+
<executions>
79+
<execution>
80+
<goals>
81+
<goal>test-jar</goal>
82+
</goals>
83+
</execution>
84+
</executions>
85+
</plugin>
7486
</plugins>
7587
</build>
7688

gxjwt/src/main/java/com/genexus/JWT/utils/UnixTimestampCreator.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.text.DateFormat;
66
import java.text.SimpleDateFormat;
77
import java.util.Date;
8+
import java.util.TimeZone;
89

910
public class UnixTimestampCreator extends SecurityAPIObject {
1011

@@ -17,6 +18,7 @@ public String create(String date)
1718
{
1819
Date datef = null;
1920
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
21+
dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
2022
try {
2123

2224
datef = dateFormat.parse(date);

gxjwt/src/test/java/com/genexus/test/jwt/features/UnixTimeStampCreatorTest.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,13 @@ public void runTest() {
2828
public void setUp() {
2929
date = "2023/07/19 11:41:00";
3030
creator = new UnixTimestampCreator();
31-
expected = "1689777660";
31+
expected = "1689766860";
3232
}
3333

3434

3535
public void testCreate()
3636
{
37-
System.out.println("date: " + date);
3837
String obtained = creator.create(date);
39-
if(creator.hasError())
40-
{
41-
System.out.println("Error. Code: " + creator.getErrorCode() + " Desc: " + creator.getErrorDescription());
42-
}else{
43-
System.out.println("No error");
44-
}
45-
System.out.println("expected: " + expected);
46-
System.out.println("obtained: " + obtained);
4738
Equals(expected, obtained, creator);
4839
}
4940
}

securityapicommons/pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@
3434
<artifactId>maven-compiler-plugin</artifactId>
3535
<version>3.8.0</version>
3636
</plugin>
37+
<plugin>
38+
<groupId>org.apache.maven.plugins</groupId>
39+
<artifactId>maven-jar-plugin</artifactId>
40+
<version>3.1.1</version>
41+
<executions>
42+
<execution>
43+
<goals>
44+
<goal>test-jar</goal>
45+
</goals>
46+
</execution>
47+
</executions>
48+
</plugin>
3749
</plugins>
3850
</build>
3951

0 commit comments

Comments
 (0)