Skip to content
This repository was archived by the owner on May 23, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions sources/payment-hub/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,25 @@
<artifactId>interop-ilp-conditions</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>5.1.2.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
</dependency>
</dependencies>

<dependencyManagement>
Expand Down
44 changes: 44 additions & 0 deletions sources/payment-hub/src/main/java/hu/HubSettingsTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package hu;

import hu.dpc.rt.psp.config.HubSettings;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import static org.junit.Assert.*;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = { HubSettingsTest.TestConfiguration.class })
public class HubSettingsTest {

@Autowired
private HubSettings hubSettings;

@Test
public void getInstance() {
assertEquals("in01",hubSettings.getInstance());
}

@Test
public void getExpiration() {
assertEquals("30000",hubSettings.getExpiration().toString());
}

@Test
public void getTenants_0() {
assertEquals("tn03",hubSettings.getTenants().get(0));
}

@Test
public void getTenants_1() {
assertEquals("tn04",hubSettings.getTenants().get(1));
}

@EnableConfigurationProperties(HubSettings.class)
public static class TestConfiguration {
// nothing
}
}