@Test
public void decodeSmr5AlarmsWithAlarmRegister() throws UnrecognizedMessageDataException {

    // SETUP
    this.decoder = new DlmsPushNotificationDecoder();
    final ByteBuf buffer = mock(ByteBuf.class);
    // Create alarm register with 4 alarms: replace battery, 2 mbus alarms
    // and phase outage detected (new in SMR5.1)
    final byte[] alarmRegister = new byte[] { 0x10, 0x18, 0x00, 0x02 };
    this.setupSmr5BufferWithAlarm(buffer, IDENTIFIER, ALARM_OBISCODE_BYTES, alarmRegister);
    // CALL
    final List<Object> out = new ArrayList<>();
    this.decoder.decode(this.ctx, buffer, out);
    final Object pushNotificationObject = out.get(0);
    // VERIFY
    assertThat(pushNotificationObject instanceof DlmsPushNotification).isTrue();
    final DlmsPushNotification dlmsPushNotification = (DlmsPushNotification) pushNotificationObject;
    assertThat(dlmsPushNotification.getEquipmentIdentifier()).isEqualTo(IDENTIFIER);
    assertThat(dlmsPushNotification.getTriggerType()).isEqualTo(PUSH_ALARM_TRIGGER);
    final Set<AlarmTypeDto> alarms = dlmsPushNotification.getAlarms();
    assertThat(alarms.size()).isEqualTo(4);
    assertThat(alarms.contains(REPLACE_BATTERY)).isTrue();
    assertThat(alarms.contains(COMMUNICATION_ERROR_M_BUS_CHANNEL_4)).isTrue();
    assertThat(alarms.contains(FRAUD_ATTEMPT_M_BUS_CHANNEL_1)).isTrue();
    assertThat(alarms.contains(PHASE_OUTAGE_DETECTED_L_1)).isTrue();
    this.verifySmr5BufferCallsWithAlarm(buffer, alarmRegister);
    // Verify the addressing bytes, the 0x0F for data-notification and the
    // invoke-id bytes were skipped
    verify(buffer, times(1))
            .skipBytes(SMR5_NUMBER_OF_BYTES_FOR_ADDRESSING + 1 + SMR5_NUMBER_OF_BYTES_FOR_INVOKE_ID);
}