-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from witx98/hofund-connection-tags
Fixed hofund connection tags
- Loading branch information
Showing
10 changed files
with
137 additions
and
71 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
title: Fixed an issue with registering hofund.node, caused by inconsistent sets of tag keys across different connection types | ||
authors: | ||
- name: Mateusz Witkowski | ||
nick: witx98 | ||
url: https://github.com/witx98 | ||
type: fixed #[added/changed/deprecated/removed/fixed/security/other] | ||
issues: | ||
- 57 | ||
merge_requests: | ||
- 58 |
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
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
21 changes: 0 additions & 21 deletions
21
hofund-core/src/main/java/dev/logchange/hofund/connection/HofundDatabaseConnection.java
This file was deleted.
Oops, something went wrong.
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
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
73 changes: 73 additions & 0 deletions
73
hofund-core/src/test/java/dev/logchange/hofund/connection/HofundConnectionTest.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,73 @@ | ||
package dev.logchange.hofund.connection; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.EnumSource; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
class HofundConnectionTest { | ||
|
||
|
||
@ParameterizedTest | ||
@EnumSource( | ||
value = Type.class, | ||
names = "DATABASE", | ||
mode = EnumSource.Mode.EXCLUDE) | ||
void shouldTargetPropertyWhenTypeIsDifferentThanDB() { | ||
// given: | ||
HofundConnection connection = HofundConnection.builder() | ||
.target("Target") | ||
.type(Type.HTTP) | ||
.build(); | ||
|
||
// when: | ||
String targetTag = connection.toTargetTag(); | ||
|
||
// then: | ||
assertEquals("Target", targetTag); | ||
} | ||
|
||
@Test | ||
void shouldTargetPropertyWhenTypeIsDB() { | ||
// given: | ||
HofundConnection connection = HofundConnection.builder() | ||
.target("Target") | ||
.type(Type.DATABASE) | ||
.build(); | ||
|
||
String expected = "Target_database"; | ||
|
||
// when: | ||
String targetTag = connection.toTargetTag(); | ||
|
||
// then: | ||
assertEquals(expected, targetTag); | ||
} | ||
|
||
@Test | ||
void shouldReturnEmptyDescriptionWhenPropertyIsNull() { | ||
// given: | ||
HofundConnection connection = HofundConnection.builder().build(); | ||
|
||
// when: | ||
String description = connection.getDescription(); | ||
|
||
// then: | ||
assertEquals("", description); | ||
} | ||
|
||
@Test | ||
void shouldReturnValueOfDescriptionWhenPropertyIsNotNull() { | ||
// given: | ||
|
||
String expected = "Description"; | ||
HofundConnection connection = HofundConnection.builder().description(expected).build(); | ||
|
||
// when: | ||
String description = connection.getDescription(); | ||
|
||
// then: | ||
assertEquals(expected, description); | ||
} | ||
} |
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
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
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