@@ -49,7 +49,7 @@ public class Issue663RegressionTest {
4949 @ DisplayName ("Should successfully parse BOM with nested components in metadata" )
5050 public void testParsingMetadataWithNestedComponents () throws Exception {
5151 // Arrange
52- File inputFile = new File ("src/test/resources/issue-663-metadata-nested-components.xml" );
52+ File inputFile = new File ("src/test/resources/regression/ issue-663-metadata-nested-components.xml" );
5353 Parser parser = BomParserFactory .createParser (inputFile );
5454
5555 // Act & Assert - This should not throw an exception
@@ -162,7 +162,7 @@ public void testParsingEmptyMetadataComponent() throws Exception {
162162 @ DisplayName ("Should successfully convert XML with nested components to JSON and back" )
163163 public void testXmlToJsonRoundTripWithNestedComponents () throws Exception {
164164 // Arrange
165- File inputFile = new File ("src/test/resources/issue-663-metadata-nested-components.xml" );
165+ File inputFile = new File ("src/test/resources/regression/ issue-663-metadata-nested-components.xml" );
166166 XmlParser xmlParser = new XmlParser ();
167167 JsonParser jsonParser = new JsonParser ();
168168
@@ -190,64 +190,15 @@ public void testXmlToJsonRoundTripWithNestedComponents() throws Exception {
190190 @ Test
191191 @ DisplayName ("Should successfully convert JSON with nested components to XML and back" )
192192 public void testJsonToXmlRoundTripWithNestedComponents () throws Exception {
193- // Arrange - Create JSON equivalent of our test XML
194- String nestedComponentsJson = "{\n " +
195- " \" bomFormat\" : \" CycloneDX\" ,\n " +
196- " \" specVersion\" : \" 1.6\" ,\n " +
197- " \" serialNumber\" : \" urn:uuid:12345678-1234-1234-1234-123456789abc\" ,\n " +
198- " \" version\" : 1,\n " +
199- " \" metadata\" : {\n " +
200- " \" timestamp\" : \" 2023-01-01T12:00:00Z\" ,\n " +
201- " \" component\" : {\n " +
202- " \" type\" : \" application\" ,\n " +
203- " \" bom-ref\" : \" main-app\" ,\n " +
204- " \" name\" : \" Main Application\" ,\n " +
205- " \" version\" : \" 1.0.0\" ,\n " +
206- " \" description\" : \" Main application component\" ,\n " +
207- " \" components\" : [\n " +
208- " {\n " +
209- " \" type\" : \" library\" ,\n " +
210- " \" bom-ref\" : \" nested-lib-1\" ,\n " +
211- " \" name\" : \" Nested Library 1\" ,\n " +
212- " \" version\" : \" 2.1.0\" ,\n " +
213- " \" description\" : \" First nested library\" \n " +
214- " },\n " +
215- " {\n " +
216- " \" type\" : \" library\" ,\n " +
217- " \" bom-ref\" : \" nested-lib-2\" ,\n " +
218- " \" name\" : \" Nested Library 2\" ,\n " +
219- " \" version\" : \" 3.2.1\" ,\n " +
220- " \" description\" : \" Second nested library\" ,\n " +
221- " \" components\" : [\n " +
222- " {\n " +
223- " \" type\" : \" library\" ,\n " +
224- " \" bom-ref\" : \" deeply-nested-lib\" ,\n " +
225- " \" name\" : \" Deeply Nested Library\" ,\n " +
226- " \" version\" : \" 1.5.0\" ,\n " +
227- " \" description\" : \" Deeply nested component\" \n " +
228- " }\n " +
229- " ]\n " +
230- " }\n " +
231- " ]\n " +
232- " }\n " +
233- " },\n " +
234- " \" components\" : [\n " +
235- " {\n " +
236- " \" type\" : \" library\" ,\n " +
237- " \" bom-ref\" : \" root-lib\" ,\n " +
238- " \" name\" : \" Root Level Library\" ,\n " +
239- " \" version\" : \" 4.0.0\" \n " +
240- " }\n " +
241- " ]\n " +
242- "}" ;
243-
193+ // Arrange
194+ File inputFile = new File ("src/test/resources/regression/issue-663-metadata-nested-components.json" );
244195 JsonParser jsonParser = new JsonParser ();
245196 XmlParser xmlParser = new XmlParser ();
246197
247198 // Act & Assert
248199 assertThatNoException ().isThrownBy (() -> {
249200 // Step 1: Parse original JSON
250- Bom originalBom = jsonParser .parse (nestedComponentsJson . getBytes () );
201+ Bom originalBom = jsonParser .parse (inputFile );
251202
252203 // Step 2: Convert to XML
253204 BomXmlGenerator xmlGenerator = BomGeneratorFactory .createXml (Version .VERSION_16 , originalBom );
@@ -269,7 +220,7 @@ public void testJsonToXmlRoundTripWithNestedComponents() throws Exception {
269220 @ DisplayName ("Should maintain data integrity through complete round-trip XML->JSON->XML->JSON" )
270221 public void testCompleteRoundTripDataIntegrity () throws Exception {
271222 // Arrange
272- File inputFile = new File ("src/test/resources/issue-663-metadata-nested-components.xml" );
223+ File inputFile = new File ("src/test/resources/regression/ issue-663-metadata-nested-components.xml" );
273224 XmlParser xmlParser = new XmlParser ();
274225 JsonParser jsonParser = new JsonParser ();
275226
0 commit comments