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  package org.orekit.files.ccsds.definitions;
18  
19  import org.junit.jupiter.api.Assertions;
20  import org.junit.jupiter.api.BeforeEach;
21  import org.junit.jupiter.api.Test;
22  import org.orekit.Utils;
23  import org.orekit.data.DataContext;
24  
25  public class BodyFacadeTest {
26  
27      @BeforeEach
28      public void setUp() {
29          Utils.setDataRoot("regular-data");
30      }
31  
32      @Test
33      public void testIssue898Earth() {
34  
35          // Create the body facade
36          final BodyFacade body = BodyFacade.create(CenterName.EARTH);
37  
38          // Verify
39          Assertions.assertEquals("EARTH", body.getName());
40          Assertions.assertEquals("Earth", body.getBody().getName());
41  
42      }
43  
44      @Test
45      public void testIssue898Sun() {
46  
47          // Create the body facade
48          final BodyFacade body = BodyFacade.create(CenterName.SUN);
49  
50          // Verify
51          Assertions.assertEquals("SUN", body.getName());
52          Assertions.assertEquals("Sun", body.getBody().getName());
53  
54      }
55  
56      @Test
57      public void testIssue1137() {
58  
59          // Create the body facade (SUN)
60          final BodyFacade sun = BodyFacade.create(CenterName.SUN, DataContext.getDefault());
61  
62          // Verify
63          Assertions.assertEquals("SUN", sun.getName());
64          Assertions.assertEquals("Sun", sun.getBody().getName());
65  
66          // Create the body facade (EARTH)
67          final BodyFacade earth = BodyFacade.create(CenterName.EARTH, DataContext.getDefault().getCelestialBodies());
68  
69          // Verify
70          Assertions.assertEquals("EARTH", earth.getName());
71          Assertions.assertEquals("Earth", earth.getBody().getName());
72  
73      }
74  
75  }