Skip to content

Commit 5d76e4a

Browse files
committed
update dependencies and release 1.0.1
1 parent b73d8bc commit 5d76e4a

File tree

2 files changed

+32
-13
lines changed

2 files changed

+32
-13
lines changed

pom.xml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66

77
<groupId>de.rytrox</groupId>
88
<artifactId>varo</artifactId>
9-
<version>1.0.1-SNAPSHOT</version>
9+
<version>1.0.1</version>
1010
<packaging>jar</packaging>
1111

1212
<name>Varo</name>
1313

1414
<description>Ein Varo-Plugin</description>
1515
<properties>
1616
<java.version>1.8</java.version>
17+
<mockito-version>4.2.0</mockito-version>
1718
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1819
</properties>
1920

@@ -149,13 +150,13 @@
149150
<dependency>
150151
<groupId>org.jetbrains</groupId>
151152
<artifactId>annotations</artifactId>
152-
<version>22.0.0</version>
153+
<version>23.0.0</version>
153154
</dependency>
154155

155156
<dependency>
156157
<groupId>org.junit.jupiter</groupId>
157158
<artifactId>junit-jupiter-engine</artifactId>
158-
<version>5.8.1</version>
159+
<version>5.8.2</version>
159160
<scope>test</scope>
160161
</dependency>
161162

@@ -169,38 +170,38 @@
169170
<dependency>
170171
<groupId>org.mockito</groupId>
171172
<artifactId>mockito-core</artifactId>
172-
<version>4.0.0</version>
173+
<version>${mockito-version}</version>
173174
<scope>test</scope>
174175
</dependency>
175176
<dependency>
176177
<groupId>org.mockito</groupId>
177178
<artifactId>mockito-inline</artifactId>
178-
<version>4.0.0</version>
179+
<version>${mockito-version}</version>
179180
<scope>test</scope>
180181
</dependency>
181182
<dependency>
182183
<groupId>org.mockito</groupId>
183184
<artifactId>mockito-junit-jupiter</artifactId>
184-
<version>4.0.0</version>
185+
<version>${mockito-version}</version>
185186
<scope>test</scope>
186187
</dependency>
187188
<dependency>
188189
<groupId>org.junit.platform</groupId>
189190
<artifactId>junit-platform-runner</artifactId>
190-
<version>1.8.1</version>
191+
<version>1.8.2</version>
191192
<scope>test</scope>
192193
</dependency>
193194
<dependency>
194195
<groupId>org.junit.vintage</groupId>
195196
<artifactId>junit-vintage-engine</artifactId>
196-
<version>5.8.1</version>
197+
<version>5.8.2</version>
197198
<scope>test</scope>
198199
</dependency>
199200

200201
<dependency>
201202
<groupId>io.ebean</groupId>
202203
<artifactId>ebean</artifactId>
203-
<version>12.13.0</version>
204+
<version>12.14.0</version>
204205
</dependency>
205206
<dependency>
206207
<groupId>io.ebean</groupId>
@@ -210,7 +211,7 @@
210211
<dependency>
211212
<groupId>io.ebean</groupId>
212213
<artifactId>ebean-core</artifactId>
213-
<version>12.13.0</version>
214+
<version>12.13.1</version>
214215
</dependency>
215216
<dependency>
216217
<groupId>io.ebean</groupId>
@@ -220,18 +221,18 @@
220221
<dependency>
221222
<groupId>io.ebean</groupId>
222223
<artifactId>ebean-ddl-generator</artifactId>
223-
<version>12.13.0</version>
224+
<version>12.14.0</version>
224225
</dependency>
225226
<dependency>
226227
<groupId>io.ebean</groupId>
227228
<artifactId>ebean-test</artifactId>
228-
<version>12.13.0</version>
229+
<version>12.14.0</version>
229230
<scope>test</scope>
230231
</dependency>
231232
<dependency>
232233
<groupId>com.h2database</groupId>
233234
<artifactId>h2</artifactId>
234-
<version>1.4.200</version>
235+
<version>2.0.204</version>
235236
</dependency>
236237
</dependencies>
237238
</project>

src/test/java/de/rytrox/varo/teams/GameTimeServiceTest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package de.rytrox.varo.teams;
22

3+
import de.rytrox.varo.Varo;
34
import de.rytrox.varo.game.GameTimeService;
5+
import de.rytrox.varo.gamestate.GameStateHandler;
46
import org.apache.commons.lang.reflect.FieldUtils;
57
import org.bukkit.event.player.PlayerLoginEvent;
68
import org.junit.jupiter.api.BeforeEach;
@@ -23,9 +25,16 @@ public class GameTimeServiceTest {
2325
@Mock
2426
GameTimeService service;
2527

28+
@Mock
29+
GameStateHandler gameStateHandler;
30+
31+
@Mock
32+
Varo main;
33+
2634
@BeforeEach
2735
void init() throws IllegalAccessException {
2836
FieldUtils.writeField(service, "startTime", startTime, true);
37+
FieldUtils.writeField(service, "main", main, true);
2938
FieldUtils.writeField(service, "endTime", endTime, true);
3039
FieldUtils.writeField(service, "kickMessage", "Du wurdest gekickt", true);
3140
}
@@ -70,6 +79,9 @@ public void shouldCalculateCorrectOffsetWhenNowEqualsEnd() {
7079
public void shouldKickPlayerWhenSystemTimeIsBeforeStart() {
7180
PlayerLoginEvent event = mock(PlayerLoginEvent.class);
7281
doCallRealMethod().when(service).onInvalidJoin(eq(event));
82+
doReturn(gameStateHandler).when(main).getGameStateHandler();
83+
doAnswer((invocationOnMock) -> GameStateHandler.GameState.MAIN)
84+
.when(gameStateHandler).getCurrentGameState();
7385

7486
LocalTime now = LocalTime.of(14, 0);
7587
try(MockedStatic<LocalTime> mockedStatic = mockStatic(LocalTime.class, CALLS_REAL_METHODS)) {
@@ -85,6 +97,9 @@ public void shouldKickPlayerWhenSystemTimeIsBeforeStart() {
8597
public void shouldNotKickPlayerWhenSystemTimeIsInRange() {
8698
PlayerLoginEvent event = mock(PlayerLoginEvent.class);
8799
doCallRealMethod().when(service).onInvalidJoin(eq(event));
100+
doReturn(gameStateHandler).when(main).getGameStateHandler();
101+
doAnswer((invocationOnMock) -> GameStateHandler.GameState.MAIN)
102+
.when(gameStateHandler).getCurrentGameState();
88103

89104
LocalTime now = LocalTime.of(16, 0);
90105
try(MockedStatic<LocalTime> mockedStatic = mockStatic(LocalTime.class, CALLS_REAL_METHODS)) {
@@ -99,6 +114,9 @@ public void shouldNotKickPlayerWhenSystemTimeIsInRange() {
99114
public void shouldKickPlayerOnEndTime() {
100115
PlayerLoginEvent event = mock(PlayerLoginEvent.class);
101116
doCallRealMethod().when(service).onInvalidJoin(eq(event));
117+
doReturn(gameStateHandler).when(main).getGameStateHandler();
118+
doAnswer((invocationOnMock) -> GameStateHandler.GameState.MAIN)
119+
.when(gameStateHandler).getCurrentGameState();
102120

103121
LocalTime now = LocalTime.of(22, 0, 1);
104122
try(MockedStatic<LocalTime> mockedStatic = mockStatic(LocalTime.class, CALLS_REAL_METHODS)) {

0 commit comments

Comments
 (0)