package com.hyperwallet.clientsdk.model;

import org.junit.Test;

import java.util.Date;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;

public class HyperwalletWebhookNotificationTest {

    @Test
    public void testHyperwalletWebhookEvent() {
        HyperwalletWebhookNotification event = new HyperwalletWebhookNotification();
        assertThat(event.getType(), is(nullValue()));
        assertThat(event.getCreatedOn(), is(nullValue()));
        assertThat(event.getObject(), is(nullValue()));
        assertThat(event.getToken(), is(nullValue()));

        Date createdOn = new Date();

        event.setCreatedOn(createdOn);
        event.setToken("wbh-token");
        event.setObject("{ payment: token }");
        event.setType(HyperwalletWebhookNotification.Type.BANK_ACCOUNT_UPDATED.toString());

        assertThat(event.getToken(), is(equalTo("wbh-token")));
        assertThat(event.getObject().toString(), is(equalTo("{ payment: token }")));
        assertThat(event.getCreatedOn(), is(equalTo(createdOn)));
        assertThat(event.getType(), is(equalTo(HyperwalletWebhookNotification.Type.BANK_ACCOUNT_UPDATED.toString())));
    }

}

@@ -1179,21 +1179,174 @@
 tring())));%0A
+        assertThat(HyperwalletWebhookNotification.Type.BANK_ACCOUNT_UPDATED, is(equalTo(HyperwalletWebhookNotification.Type.getType(event.getType()))));%0A
     %7D%0A%0A%7D%0A

add more coverage