Skip to content

Commit 5a08cd1

Browse files
committed
Fix disabled DefaultPluginXmlFactoryTest unit test
1 parent 06769f5 commit 5a08cd1

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

impl/maven-impl/src/test/java/org/apache/maven/impl/DefaultPluginXmlFactoryTest.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,17 @@
3737
import org.apache.maven.api.services.xml.XmlWriterRequest;
3838
import org.apache.maven.impl.model.DefaultModelProcessor;
3939
import org.junit.jupiter.api.Test;
40-
import org.junit.jupiter.api.condition.DisabledOnOs;
4140
import org.junit.jupiter.api.io.TempDir;
4241

4342
import static java.util.UUID.randomUUID;
4443
import static org.assertj.core.api.Assertions.assertThat;
4544
import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType;
4645
import static org.junit.jupiter.api.Assertions.assertNotNull;
4746
import static org.junit.jupiter.api.Assertions.assertThrows;
48-
import static org.junit.jupiter.api.condition.OS.WINDOWS;
4947
import static org.mockito.Mockito.mock;
5048
import static org.mockito.Mockito.when;
5149

52-
class DefaultPluginXmlFactoryReadWriteTest {
50+
class DefaultPluginXmlFactoryTest {
5351

5452
private static final String NAME = "sample-plugin-" + randomUUID();
5553
private static final String SAMPLE_PLUGIN_XML =
@@ -252,15 +250,11 @@ void locateExistingPomWithFilePathShouldReturnSameFileIfRegularFile() throws IOE
252250
}
253251

254252
@Test
255-
@DisabledOnOs(
256-
value = WINDOWS,
257-
disabledReason = "windows related issue https://github.com/apache/maven/pull/2312#issuecomment-2876291814")
258253
void readFromUrlParsesPluginDescriptorCorrectly() throws Exception {
259254
Path xmlFile = tempDir.resolve("plugin.xml");
260255
Files.write(xmlFile, SAMPLE_PLUGIN_XML.getBytes());
261-
PluginDescriptor descriptor = defaultPluginXmlFactory.read(XmlReaderRequest.builder()
262-
.inputStream(xmlFile.toUri().toURL().openStream())
263-
.build());
256+
PluginDescriptor descriptor = defaultPluginXmlFactory.read(
257+
XmlReaderRequest.builder().url(xmlFile.toUri().toURL()).build());
264258
assertThat(descriptor.getName()).isEqualTo(NAME);
265259
assertThat(descriptor.getGroupId()).isEqualTo("org.example");
266260
assertThat(descriptor.getArtifactId()).isEqualTo("sample-plugin");

0 commit comments

Comments
 (0)