Package org.easycassandra.persistence.cassandra.spring

Source Code of org.easycassandra.persistence.cassandra.spring.ContactRepositoryTest

package org.easycassandra.persistence.cassandra.spring;

import java.util.UUID;

import junit.framework.Assert;

import org.easycassandra.persistence.cassandra.spring.entity.Contact;
import org.easycassandra.persistence.cassandra.spring.repository.ContactRepository;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*  test to ContactRepository.
*/
public class ContactRepositoryTest {

  private static final int TWENTY = 20;
    private ContactRepository contactReporitory;
  /**
     * run the test.
     */
  @Test
  public void insertTest() {
        Contact contact = new Contact();
    contact.setId(UUID.randomUUID());
    contact.setName("Poliana");
    contact.setYear(TWENTY);
    Assert.assertNotNull(contactReporitory.save(contact));

  }
  /**
   * run the test.
   */
  @Test
  public void getFacotryTest() {
        CassandraFactorySpring cassandraFactorySpring = SpringUtil.INSTANCE
                .getBean(CassandraFactorySpring.class);
    Assert.assertNotNull(cassandraFactorySpring);
  }
  /**
     * before the test.
     */
  @Before
  public void initMethod() {
        contactReporitory = SpringUtil.INSTANCE
                .getBean(ContactRepository.class);
  }
  /**
     * run the all test.
     */
  @BeforeClass
  public static void init() {
        SpringUtil spring = SpringUtil.INSTANCE;
  }

}
TOP

Related Classes of org.easycassandra.persistence.cassandra.spring.ContactRepositoryTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.