1   /* Copyright 2002-2025 CS GROUP
2    * Licensed to CS GROUP (CS) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * CS licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *   http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.orekit.propagation.conversion;
19  
20  import org.junit.jupiter.api.Assertions;
21  import org.junit.jupiter.api.Test;
22  import org.orekit.Utils;
23  import org.orekit.data.DataContext;
24  import org.orekit.orbits.PositionAngleType;
25  import org.orekit.propagation.analytical.tle.TLE;
26  import org.orekit.propagation.analytical.tle.generation.FixedPointTleGenerationAlgorithm;
27  
28  import static org.orekit.propagation.conversion.AbstractPropagatorBuilderTest.assertPropagatorBuilderIsACopy;
29  
30  public class TLEPropagatorBuilderTest {
31  
32      @Test
33      void testClone() {
34  
35          // Given
36          final DataContext dataContext = Utils.setDataRoot("regular-data");
37          final TLE tle = new TLE("1 27421U 02021A   02124.48976499 -.00021470  00000-0 -89879-2 0    20",
38                  "2 27421  98.7490 199.5121 0001333 133.9522 226.1918 14.26113993    62");
39          final TLEPropagatorBuilder builder = new TLEPropagatorBuilder(tle, PositionAngleType.MEAN, 1.0, dataContext,
40                  new FixedPointTleGenerationAlgorithm());
41  
42          // When
43          final TLEPropagatorBuilder copyBuilder = (TLEPropagatorBuilder) builder.clone();
44  
45          // Then
46          assertPropagatorBuilderIsACopy(builder, copyBuilder);
47          Assertions.assertEquals(builder.getTemplateTLE(), copyBuilder.getTemplateTLE());
48  
49      }
50  }