test_class.declarator: DEFAULT_GRAPHITE_URL
test_class.modifier: private static final
test_class.original_string: private static final URI DEFAULT_GRAPHITE_URL;
test_class.type: URI
test_class.var_name: DEFAULT_GRAPHITE_URL
test_class.declarator: OTHER_GRAPHITE_URL
test_class.modifier: private static final
test_class.original_string: private static final URI OTHER_GRAPHITE_URL;
test_class.type: URI
test_class.var_name: OTHER_GRAPHITE_URL
test_class.declarator: DEFAULT_GRAPHITE_IPPORT
test_class.modifier: private static final
test_class.original_string: private static final URI DEFAULT_GRAPHITE_IPPORT;
test_class.type: URI
test_class.var_name: DEFAULT_GRAPHITE_IPPORT
test_class.declarator: OTHER_GRAPHITE_IPPORT
test_class.modifier: private static final
test_class.original_string: private static final URI OTHER_GRAPHITE_IPPORT;
test_class.type: URI
test_class.var_name: OTHER_GRAPHITE_IPPORT
test_class.declarator: alarmMapper = new AlarmMapper()
test_class.modifier: @InjectMocks
      private
test_class.original_string: @InjectMocks
      private AlarmMapper alarmMapper = new AlarmMapper();
test_class.type: AlarmMapper
test_class.var_name: alarmMapper
test_class.declarator: graphiteSources
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private GraphiteSources graphiteSources;
test_class.type: GraphiteSources
test_class.var_name: graphiteSources
test_class.declarator: alarmValidator
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private AlarmValidator alarmValidator;
test_class.type: AlarmValidator
test_class.var_name: alarmValidator
test_class.declarator: subscriptionMapper
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private SubscriptionMapper subscriptionMapper;
test_class.type: SubscriptionMapper
test_class.var_name: subscriptionMapper
test_class.declarator: defaultAlarm
test_class.modifier: private
test_class.original_string: private Alarm defaultAlarm;
test_class.type: Alarm
test_class.var_name: defaultAlarm
test_class.file: services/src/test/java/com/vsct/supervision/notification/model/AlarmMapperTest.java
test_class.identifier: AlarmMapperTest
test_case.body: @Test
      public void testUnknownFrontendUrlWithNoMapping() throws Exception {
  
          Map<URI, URI> emptyMap = new HashMap<>();
          when(graphiteSources.getIpportsByUrl()).thenReturn(new HashMap<>());
          when(this.graphiteSources.getSources()).thenReturn(new ArrayList<GraphiteSources.GraphiteSource>());
  
          Alarm frontendAlarm = TestUtils.getDefaultAlarm();
          frontendAlarm.setGraphiteBaseUrl(OTHER_GRAPHITE_URL);
          Alarm backendAlarm = alarmMapper.mapNewAlarmFormToSeyren(frontendAlarm);
          assertEquals(OTHER_GRAPHITE_URL, backendAlarm.getGraphiteBaseUrl());
      }
test_case.class_method_signature: AlarmMapperTest.testUnknownFrontendUrlWithNoMapping()
test_case.full_signature: @Test public void testUnknownFrontendUrlWithNoMapping()
test_case.identifier: testUnknownFrontendUrlWithNoMapping
test_case.invocations: thenReturn when getIpportsByUrl thenReturn when getSources getDefaultAlarm setGraphiteBaseUrl mapNewAlarmFormToSeyren assertEquals getGraphiteBaseUrl
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testUnknownFrontendUrlWithNoMapping()
focal_class.declarator: DEFAULT_FROM = "-25min"
focal_class.modifier: public static final
focal_class.original_string: public static final String DEFAULT_FROM = "-25min";
focal_class.type: String
focal_class.var_name: DEFAULT_FROM
focal_class.declarator: DEFAULT_UNTIL = "-1min"
focal_class.modifier: public static final
focal_class.original_string: public static final String DEFAULT_UNTIL = "-1min";
focal_class.type: String
focal_class.var_name: DEFAULT_UNTIL
focal_class.declarator: graphiteSources
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private GraphiteSources graphiteSources;
focal_class.type: GraphiteSources
focal_class.var_name: graphiteSources
focal_class.declarator: subscriptionMapper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private SubscriptionMapper subscriptionMapper;
focal_class.type: SubscriptionMapper
focal_class.var_name: subscriptionMapper
focal_class.declarator: alarmValidator = new AlarmValidator()
focal_class.modifier: private
focal_class.original_string: private AlarmValidator alarmValidator = new AlarmValidator();
focal_class.type: AlarmValidator
focal_class.var_name: alarmValidator
focal_class.file: services/src/main/java/com/vsct/supervision/notification/model/AlarmMapper.java
focal_class.identifier: AlarmMapper
focal_class.class_method_signature: AlarmMapper.mapToPresentation(Alarm.Alarms alarms)
focal_class.full_signature: public Alarm.Alarms mapToPresentation(Alarm.Alarms alarms)
focal_class.identifier: mapToPresentation
focal_class.modifiers: public
focal_class.parameters: (Alarm.Alarms alarms)
focal_class.return: Alarm.Alarms
focal_class.signature: Alarm.Alarms mapToPresentation(Alarm.Alarms alarms)
focal_class.class_method_signature: AlarmMapper.mapToPresentation(final Collection<Alarm> alarms)
focal_class.full_signature: public Collection<Alarm> mapToPresentation(final Collection<Alarm> alarms)
focal_class.identifier: mapToPresentation
focal_class.modifiers: public
focal_class.parameters: (final Collection<Alarm> alarms)
focal_class.return: Collection<Alarm>
focal_class.signature: Collection<Alarm> mapToPresentation(final Collection<Alarm> alarms)
focal_class.class_method_signature: AlarmMapper.mapToPresentation(Alarm alarm)
focal_class.full_signature: public Alarm mapToPresentation(Alarm alarm)
focal_class.identifier: mapToPresentation
focal_class.modifiers: public
focal_class.parameters: (Alarm alarm)
focal_class.return: Alarm
focal_class.signature: Alarm mapToPresentation(Alarm alarm)
focal_class.class_method_signature: AlarmMapper.mapNewAlarmFormToSeyren(Alarm newAlarm)
focal_class.full_signature: public Alarm mapNewAlarmFormToSeyren(Alarm newAlarm)
focal_class.identifier: mapNewAlarmFormToSeyren
focal_class.modifiers: public
focal_class.parameters: (Alarm newAlarm)
focal_class.return: Alarm
focal_class.signature: Alarm mapNewAlarmFormToSeyren(Alarm newAlarm)
focal_class.class_method_signature: AlarmMapper.mapUpdateAlarmFormToSeyren(final Alarm updatedAlarm)
focal_class.full_signature: public Alarm mapUpdateAlarmFormToSeyren(final Alarm updatedAlarm)
focal_class.identifier: mapUpdateAlarmFormToSeyren
focal_class.modifiers: public
focal_class.parameters: (final Alarm updatedAlarm)
focal_class.return: Alarm
focal_class.signature: Alarm mapUpdateAlarmFormToSeyren(final Alarm updatedAlarm)
focal_class.class_method_signature: AlarmMapper.initListSubscription(final Alarm newAlarm)
focal_class.full_signature: private void initListSubscription(final Alarm newAlarm)
focal_class.identifier: initListSubscription
focal_class.modifiers: private
focal_class.parameters: (final Alarm newAlarm)
focal_class.return: void
focal_class.signature: void initListSubscription(final Alarm newAlarm)
focal_class.class_method_signature: AlarmMapper.updateSourcesToBackend(final Alarm alarm)
focal_class.full_signature: private void updateSourcesToBackend(final Alarm alarm)
focal_class.identifier: updateSourcesToBackend
focal_class.modifiers: private
focal_class.parameters: (final Alarm alarm)
focal_class.return: void
focal_class.signature: void updateSourcesToBackend(final Alarm alarm)
focal_method.body: public Alarm mapNewAlarmFormToSeyren(Alarm newAlarm) throws CerebroException {
  
          // Validate required fields
          alarmValidator.validateAlarm(newAlarm);
  
          // Reset unwanted fields or enforced default values
          newAlarm.setId(null);
          newAlarm.setLastCheck(null);
  
          if (newAlarm.getFrom() == null || newAlarm.getFrom().isEmpty()) {
              newAlarm.setFrom(DEFAULT_FROM);
          }
  
          if (newAlarm.getUntil() == null || newAlarm.getUntil().isEmpty()) {
              newAlarm.setUntil(DEFAULT_UNTIL);
          }
  
          updateSourcesToBackend(newAlarm);
  
          initListSubscription(newAlarm);
  
          return newAlarm;
      }
focal_method.class_method_signature: AlarmMapper.mapNewAlarmFormToSeyren(Alarm newAlarm)
focal_method.full_signature: public Alarm mapNewAlarmFormToSeyren(Alarm newAlarm)
focal_method.identifier: mapNewAlarmFormToSeyren
focal_method.invocations: validateAlarm setId setLastCheck getFrom isEmpty getFrom setFrom getUntil isEmpty getUntil setUntil updateSourcesToBackend initListSubscription
focal_method.modifiers: public
focal_method.parameters: (Alarm newAlarm)
focal_method.return: Alarm
focal_method.signature: Alarm mapNewAlarmFormToSeyren(Alarm newAlarm)