Skip to content

Commit 46248d3

Browse files
Igor UrismanIgor Urisman
authored andcommitted
Squashed commit of the following:
commit 3161c9e Author: Igor Urisman <igor@Igors-MacBook-Pro.local> Date: Wed Jun 19 15:11:37 2024 -0700 1.3.2 commit 9cdba92 Author: Igor Urisman <igor@Igors-MacBook-Pro.local> Date: Wed Jun 19 11:30:32 2024 -0700 Change for Client 1.3.2
1 parent 3400081 commit 46248d3

File tree

3 files changed

+32
-9
lines changed

3 files changed

+32
-9
lines changed

pom.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<properties>
1111
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
12-
<variant.version>1.3.1</variant.version>
12+
<variant.version>1.3.2</variant.version>
1313
</properties>
1414

1515
<groupId>com.variant</groupId>
@@ -35,6 +35,13 @@
3535
<version>10.4.0</version>
3636
<scope>provided</scope>
3737
</dependency>
38+
<!-- JUnit -->
39+
<dependency>
40+
<groupId>junit</groupId>
41+
<artifactId>junit</artifactId>
42+
<version>4.12</version>
43+
<scope>test</scope>
44+
</dependency>
3845
</dependencies>
3946

4047
<build>

src/main/java/com/variant/client/stdlib/SessionIdTrackerAkka.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,15 @@ public void set(String sid) {
3434
}
3535

3636
@Override
37-
public void save(Object data) {
38-
Object[] asArray = (Object[]) data;
39-
HttpResponse resp = (HttpResponse) asArray[0];
37+
public Object save(Object data) {
38+
HttpResponse resp = (HttpResponse) data;
4039
var pair = HttpCookiePair$.MODULE$.apply(cookieName, sid.get());
41-
var cookie = pair.toCookie()
42-
.withHttpOnly(false)
43-
.withPath("/");
44-
var foo = resp.addHeader(SetCookie.create(cookie));
45-
asArray[0] = foo;
40+
return resp.addHeader(
41+
SetCookie.create(
42+
pair.toCookie()
43+
.withHttpOnly(false)
44+
.withPath("/")
45+
)
46+
);
4647
}
4748
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.variant.client.stdlib;
2+
3+
import com.variant.share.util.ReflectUtils;
4+
import org.junit.Test;
5+
6+
/**
7+
* A very basic test.
8+
* TODO: Write real test that ensures the tracking in cookie. (Prob. hard)
9+
*/
10+
public class SessionIdTrackerAkkaTest {
11+
@Test
12+
public void instantiationTest() throws Exception {
13+
ReflectUtils.instantiate(SessionIdTrackerAkka.class, null, null);
14+
}
15+
}

0 commit comments

Comments
 (0)