Package org.agoncal.book.javaee7.chapter02

Source Code of org.agoncal.book.javaee7.chapter02.BookServiceIT

package org.agoncal.book.javaee7.chapter02;

import org.jboss.weld.environment.se.Weld;
import org.jboss.weld.environment.se.WeldContainer;
import org.junit.Test;

import static org.junit.Assert.assertTrue;

/**
* @author Antonio Goncalves
*         APress Book - Beginning Java EE 7 with Glassfish 4
*         http://www.apress.com/
*         http://www.antoniogoncalves.org
*         --
*/
public class BookServiceIT {

  // ======================================
  // =              Methods               =
  // ======================================

  @Test
  public void shouldCheckNumberIsMock() {

    Weld weld = new Weld();
    WeldContainer container = weld.initialize();

    BookService bookService = container.instance().select(BookService.class).get();

    Book book = bookService.createBook("H2G2", 12.5f, "Geeky scifi Book");

    assertTrue(book.getNumber().startsWith("MOCK"));

    weld.shutdown();
  }
}
TOP

Related Classes of org.agoncal.book.javaee7.chapter02.BookServiceIT

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.