Skip to content

Commit

Permalink
add additional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-mlb committed Nov 18, 2024
1 parent 616f656 commit 54e9a5d
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/test/java/emissary/core/BaseDataObjectTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1465,12 +1465,19 @@ void testNewInputStream() throws IOException {
}

@Test
void testGetParameterAsString() {
this.b.putParameter("A", 1L);
this.b.appendParameter("A", "TWO");
this.b.appendParameter("A", "THREE");
assertEquals("1", this.b.getParameterAsString("A"));
assertEquals("1;TWO;THREE", this.b.getParameterAsConcatString("A"));
void testGetParameterAsString() throws IOException {
assertNotNull(this.b);

try (LogbackTester logbackTester = new LogbackTester(BaseDataObject.class.getName())) {
this.b.putParameter("A", 1L);
this.b.appendParameter("A", "TWO");
this.b.appendParameter("A", "THREE");
assertEquals("1", this.b.getParameterAsString("A"));
assertEquals("1;TWO;THREE", this.b.getParameterAsConcatString("A"));
LogbackTester.SimplifiedLogEvent logEvent = new LogbackTester.SimplifiedLogEvent(Level.WARN,
"Multiple values for parameter, returning the first - parameter:A, number of values:3", null);
logbackTester.checkLogList(Collections.singletonList(logEvent));
}

this.b.putParameter("A", 2L);
assertEquals("2", this.b.getParameterAsString("A"));
Expand Down

0 comments on commit 54e9a5d

Please sign in to comment.