@Test
public void testAddSubscription_ko() {

    ResponseEntity<Object> response = new ResponseEntity(HttpStatus.CONFLICT);
    Subscription subscription = new Subscription();
    when(restTemplate.postForEntity(anyString(),anyObject(),Matchers.<Class<Object>>any())).thenReturn(response);
    try{
        repository.addSubscription(subscription,"alarmid");
        verify(restTemplate).postForEntity(DEFAULT_SEYREN_URL + SeyrenRepository.API_ALARMS+"/alarmid/subscriptions/", subscription, Object.class);
        fail();
    }
    catch(SeyrenException e){
        assertEquals(e.getHttpStatus(),HttpStatus.CONFLICT.value());
        assertEquals(e.getAction(),"addSubscription");
    }
}