Fix null analysis error in ThingMigrationOSGiTest (#3008)

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born 2022-06-20 22:10:24 +02:00 committed by GitHub
parent 916b6e9db1
commit 5545004e09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,14 +13,13 @@
package org.openhab.core.storage.json.internal;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasItems;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.*;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Collection;
import java.util.Objects;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
@ -47,8 +46,7 @@ public class ThingMigrationOSGiTest extends JavaOSGiTest {
public void migrationParsable() throws IOException {
Files.createDirectories(DB_DIR);
StorageService storageService = getService(StorageService.class);
assertThat(storageService, is(notNullValue()));
StorageService storageService = Objects.requireNonNull(getService(StorageService.class));
// prepare storage
Files.copy(bundleContext.getBundle().getResource(DB_NAME + ".json").openStream(),