Skip to content

Commit bddd754

Browse files
authored
Merge pull request #179 from valfirst/keep-browser-optional-in-log
Keep `browser` optional in `log` object
2 parents f62c5cd + c962984 commit bddd754

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/main/java/de/sstoehr/harreader/model/HarLog.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,9 @@ public void setCreator(HarCreatorBrowser creator) {
5959
}
6060

6161
/**
62-
* @return Information about the browser used.
62+
* @return Information about the browser used, may be null.
6363
*/
6464
public HarCreatorBrowser getBrowser() {
65-
if (browser == null) {
66-
browser = new HarCreatorBrowser();
67-
}
6865
return browser;
6966
}
7067

src/test/java/de/sstoehr/harreader/model/HarLogTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import static org.junit.jupiter.api.Assertions.assertEquals;
66
import static org.junit.jupiter.api.Assertions.assertNotNull;
7+
import static org.junit.jupiter.api.Assertions.assertNull;
78

89
import java.util.ArrayList;
910
import java.util.List;
@@ -63,7 +64,7 @@ void testCreatorNull() {
6364
void testBrowserNull() {
6465
HarLog log = new HarLog();
6566
log.setBrowser(null);
66-
assertNotNull(log.getBrowser());
67+
assertNull(log.getBrowser());
6768
}
6869

6970
@Override

0 commit comments

Comments
 (0)