File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed
main/java/com/dynatrace/openkit/core/communication
test/java/com/dynatrace/openkit/core/communication Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ void doExecute(BeaconSendingContext context) throws InterruptedException {
9090
9191 @ Override
9292 AbstractBeaconSendingState getShutdownState () {
93- return new BeaconSendingTerminalState ();
93+ return initialTimeSync ? new BeaconSendingTerminalState () : new BeaconSendingFlushSessionsState ();
9494 }
9595
9696 /**
Original file line number Diff line number Diff line change @@ -51,10 +51,10 @@ public void timeSyncStateIsNotATerminalState() {
5151 }
5252
5353 @ Test
54- public void getShutdownStateGivesABeaconSendingTerminalStateInstance () {
54+ public void getShutdownStateGivesATerminalStateInstanceForInitialTimeSync () {
5555
5656 // given
57- BeaconSendingTimeSyncState target = new BeaconSendingTimeSyncState ();
57+ BeaconSendingTimeSyncState target = new BeaconSendingTimeSyncState (true );
5858
5959 // when
6060 AbstractBeaconSendingState obtained = target .getShutdownState ();
@@ -64,6 +64,20 @@ public void getShutdownStateGivesABeaconSendingTerminalStateInstance() {
6464 assertThat (obtained , is (instanceOf (BeaconSendingTerminalState .class )));
6565 }
6666
67+ @ Test
68+ public void getShutdownStateGivesAFlushSessionsStateInstanceForInitialTimeSync () {
69+
70+ // given
71+ BeaconSendingTimeSyncState target = new BeaconSendingTimeSyncState ();
72+
73+ // when
74+ AbstractBeaconSendingState obtained = target .getShutdownState ();
75+
76+ // then
77+ assertThat (obtained , is (notNullValue ()));
78+ assertThat (obtained , is (instanceOf (BeaconSendingFlushSessionsState .class )));
79+ }
80+
6781 @ Test
6882 public void onInterruptedSetsCallsInitCompletedInContextOnlyForInitialTimeSync () {
6983
You can’t perform that action at this time.
0 commit comments