Estou desenvolvendo testes com junit mas aparece o seguinte erro: java.lang.NullPointerException. Alguém pode me ajudar por favor?
package br.com.sofist.auction.domain;
import java.util.Calendar;
import java.util.List;
import org.assertj.core.api.Assertions;
import org.hamcrest.Matchers;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import org.junit.Before;
import org.junit.BeforeClass;
/**
Test class to Auction
@see br.com.sofist.auction.domain.Auction
**/
public class AuctionTest {
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() throws Exception {
}
@After
public void tearDown() throws Exception {
}
/**
* Test of propose method, of class Auction.
*/
@Test
public void testPropose() {
System.out.println("propose");
Bid auction = null;
Auction instance = null;
instance.propose(auction);
}
/**
* Test of getDescription method, of class Auction.
*/
@Test
public void testGetDescription() {
System.out.println("getDescription");
Auction instance = null;
String expResult = "";
String result = instance.getDescription();
assertEquals(expResult, result);
}
/**
* Test of getBids method, of class Auction.
*/
@Test
public void testGetBids_0args() {
System.out.println("getBids");
Auction instance = null;
List<Bid> expResult = null;
List<Bid> result = instance.getBids();
assertEquals(expResult, result);
}
/**
* Test of getDate method, of class Auction.
*/
@Test
public void testGetDate() {
System.out.println("getDate");
Auction instance = null;
Calendar expResult = null;
Calendar result = instance.getDate();
assertEquals(expResult, result);
}
/**
* Test of close method, of class Auction.
*/
@Test
public void testClose() {
System.out.println("close");
Auction instance = null;
instance.close();
}
/**
* Test of isClosed method, of class Auction.
*/
@Test
public void testIsClosed() {
System.out.println("isClosed");
Auction instance = null;
boolean expResult = false;
boolean result = instance.isClosed();
assertEquals(expResult, result);
}
/**
* Test of setId method, of class Auction.
*/
@Test
public void testSetId() {
System.out.println("setId");
int id = 0;
Auction instance = null;
instance.setId(id);
}
/**
* Test of getId method, of class Auction.
*/
@Test
public void testGetId() {
System.out.println("getId");
Auction instance = null;
int expResult = 0;
int result = instance.getId();
assertEquals(expResult, result);
}
/**
* Test of getBids method, of class Auction.
*/
@Test
public void testGetBids_int() {
System.out.println("getBids");
int i = 0;
Auction instance = null;
Object expResult = null;
Object result = instance.getBids(i);
assertEquals(expResult, result);
}
}