-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
integration test to ensure that 1 observation use same endpoint
- Loading branch information
1 parent
b9201e3
commit 14fc20e
Showing
2 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...ion-tests/src/test/java/org/eclipse/leshan/integration/tests/RedisMultiEndpointsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Sierra Wireless and others. | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* and Eclipse Distribution License v1.0 which accompany this distribution. | ||
* | ||
* The Eclipse Public License is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* and the Eclipse Distribution License is available at | ||
* http://www.eclipse.org/org/documents/edl-v10.html. | ||
* | ||
* Contributors: | ||
* Sierra Wireless - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.leshan.integration.tests; | ||
|
||
import org.eclipse.leshan.core.endpoint.Protocol; | ||
import org.eclipse.leshan.integration.tests.util.LeshanTestServerBuilder; | ||
import org.eclipse.leshan.integration.tests.util.RedisTestUtil; | ||
import org.eclipse.leshan.server.redis.RedisRegistrationStore; | ||
|
||
import redis.clients.jedis.Jedis; | ||
import redis.clients.jedis.util.Pool; | ||
|
||
public class RedisMultiEndpointsTest extends MultiEndpointsTest { | ||
|
||
@Override | ||
public LeshanTestServerBuilder givenServerWithTwoEndpoint(Protocol givenProtocol, | ||
String givenServerEndpointProvider) { | ||
LeshanTestServerBuilder builder = super.givenServerWithTwoEndpoint(givenProtocol, givenServerEndpointProvider); | ||
|
||
// Create redis store | ||
Pool<Jedis> jedis = RedisTestUtil.createJedisPool(); | ||
// TODO use custom key when https://github.com/eclipse/leshan/issues/1249 will be available | ||
builder.setRegistrationStore(new RedisRegistrationStore(jedis)); | ||
|
||
return builder; | ||
} | ||
} |