@Test
public void addMeterProtocolInfoSaved() throws FunctionalException {

    // SETUP
    when(this.smartMeteringDeviceRepository.findByDeviceIdentification(DEVICE_IDENTIFICATION)).thenReturn(null);
    when(this.smartMeteringDevice.getProtocolName()).thenReturn(PROTOCOL_NAME);
    when(this.smartMeteringDevice.getProtocolVersion()).thenReturn(PROTOCOL_VERSION);
    when(this.protocolInfoRepository
            .findByProtocolAndProtocolVersion(this.smartMeteringDevice.getProtocolInfoLookupName(),
                    PROTOCOL_VERSION)).thenReturn(this.protocolInfo);
    // CALL
    this.instance.addMeter(this.deviceMessageMetadata, this.addSmartMeterRequest);
    // VERIFY
    verify(this.smartMeter).updateProtocol(this.protocolInfo);
    verify(this.smartMeteringDeviceRepository).save(this.smartMeter);
}