Rule string compare in if statement [SOLVED]

I have an issue with a string comparison from a thing state.
The rule never reaches the if “ONLINE” part, it always fails into the else part.

// Spotify workarounds
rule "Spotify_Thing_change"
when
    Thing "spotify:device:ee6539e7:7769" changed or
    Thing "spotify:device:ee6539e7:74c1" changed
then
    var status = getThingStatusInfo("spotify:device:ee6539e7:7769").getStatus()
    var status1 = getThingStatusInfo("spotify:device:ee6539e7:74c1").getStatus()

    logInfo("DEBUG SPOTIFY", "status: XXX" + status + "XXX")
    logInfo("DEBUG SPOTIFY", "status1: XXX" + status1 + "XXX")

    if (status.equals("ONLINE")) {
        postUpdate(Spotify_Device_Helper_Wohnzimmer, "ON")
        logInfo("DEBUG SPOTIFY", "Spotify Wohnzimmer Status online: " + status)
    } else {
        postUpdate(Spotify_Device_Helper_Wohnzimmer, "OFF")
        logInfo("DEBUG SPOTIFY", "Spotify Wohnzimmer Status offline: " + status)
    }
    if (status1.equals("ONLINE")) {
        postUpdate(Spotify_Device_Helper_Wohnzimmer1, "ON")
        logInfo("DEBUG SPOTIFY", "Spotify Wohnzimmer1 Status online: " + status1)
    } else {
        postUpdate(Spotify_Device_Helper_Wohnzimmer1, "OFF")
        logInfo("DEBUG SPOTIFY", "Spotify Wohnzimmer1 Status offline: " + status1)
    }
end

from log

2019-06-06 19:02:14.618 [INFO ] [smarthome.model.script.DEBUG SPOTIFY] - status: XXXONLINEXXX
2019-06-06 19:02:14.628 [INFO ] [smarthome.model.script.DEBUG SPOTIFY] - status1: XXXOFFLINEXXX
2019-06-06 19:02:14.633 [INFO ] [smarthome.model.script.DEBUG SPOTIFY] - Spotify Wohnzimmer Status offline: ONLINE
2019-06-06 19:02:14.638 [INFO ] [smarthome.model.script.DEBUG SPOTIFY] - Spotify Wohnzimmer1 Status offline: OFFLINE

What I’m doing wrong ?

Try:

...
if (status.toString() == 'ONLINE'){
...

thanks for your help, that’s now fixed