Skip to content

Commit

Permalink
test(objectionary#1385): fix all qulice complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
volodya-lombrozo committed Nov 2, 2022
1 parent 822baeb commit 15553c1
Showing 1 changed file with 38 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2016-2022 Objectionary.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.eolang.maven;

import java.util.Collections;
Expand All @@ -8,13 +31,21 @@
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

/**
* Test case for {@link org.eolang.maven.DcsNoOneHasTransitive}.
*
* @since 0.28.11
*/
class DcsNoOneHasTransitiveTest {

@Test
void checksAllDependenciesWithoutTransitive() throws Exception {
MatcherAssert.assertThat(
new LengthOf(
new DcsNoOneHasTransitive(single("eo-collections"), d -> empty())).value(),
new DcsNoOneHasTransitive(
this.single("eo-collections"),
dependency -> this.empty()
)).value(),
Matchers.equalTo(1L)
);
}
Expand All @@ -23,7 +54,10 @@ void checksAllDependenciesWithoutTransitive() throws Exception {
void checksAllDependenciesWithTransitive() {
Assertions.assertThrows(
IllegalStateException.class,
new DcsNoOneHasTransitive(single("eo-foo"), d -> single("eo-bar"))::iterator
new DcsNoOneHasTransitive(
this.single("eo-foo"),
dependency -> this.single("eo-bar")
)::iterator
);
}

Expand All @@ -32,7 +66,7 @@ private Dependencies empty() {
}

private Dependencies single(final String artifact) {
return () -> Collections.singletonList(dependency(artifact)).iterator();
return () -> Collections.singletonList(this.dependency(artifact)).iterator();
}

private Dependency dependency(final String artifact) {
Expand All @@ -43,4 +77,4 @@ private Dependency dependency(final String artifact) {
dependency.setScope("compile");
return dependency;
}
}
}

0 comments on commit 15553c1

Please sign in to comment.