/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2020,2022 Nordix Foundation
+ * Modifications Copyright (C) 2020, 2022, 2024 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.policy.apex.testsuites.integration.common.model;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Comparator;
-import org.junit.Test;
+import java.util.Objects;
+import org.junit.jupiter.api.Test;
import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
/**
* Test the sample domain model saver.
*/
-public class SampleDomainModelSaverTest {
+class SampleDomainModelSaverTest {
@Test
- public void testSampleDomainModelSaver() throws IOException, ApexException {
+ void testSampleDomainModelSaver() throws IOException, ApexException {
assertThatThrownBy(() -> SampleDomainModelSaver.main(null)).isInstanceOf(NullPointerException.class);
String[] args0 =
File tempDir = new File(tempDirectory.toString());
assertTrue(tempDir.isDirectory());
- assertEquals(5, tempDir.listFiles().length);
+ assertEquals(5, Objects.requireNonNull(tempDir.listFiles()).length);
Files.walk(tempDirectory).sorted(Comparator.reverseOrder()).map(Path::toFile).forEach(File::delete);
}