@Test public void should_enable_scroll_collapse() { goToPage("basics/enable_scroll_collapse"); assertThat(find("#" + Constants.TABLE_ID + "_wrapper").find(".dataTables_scrollBody").getAttribute("style"))// .matches(".*height: [0-9]*px.*")// .doesNotContain("height: 1000px"); } }
@Test public void cannotInsertSameEntityTwice() throws Exception { em.getTransaction().begin(); // given MakeupArtist wibke = new MakeupArtist( "wibke", "halloween" ); em.persist( wibke ); em.getTransaction().commit(); em.clear(); em.getTransaction().begin(); // when MakeupArtist notWibke = new MakeupArtist( "wibke", "glamorous" ); em.persist( notWibke ); try { em.getTransaction().commit(); fail( "Expected exception wasn't raised" ); } catch ( Exception e ) { // then assertThat( e.getCause() ).isExactlyInstanceOf( PersistenceException.class ); assertThat( e.getCause().getMessage() ).matches( ".*OGM000067.*" ); } em.clear(); em.getTransaction().begin(); MakeupArtist loadedMakeupArtist = em.find( MakeupArtist.class, "wibke" ); assertThat( loadedMakeupArtist ).isNotNull(); assertThat( loadedMakeupArtist.getFavoriteStyle() ).describedAs( "Second insert should not be applied" ) .isEqualTo( "halloween" ); em.remove( loadedMakeupArtist ); em.getTransaction().commit(); }
assertThat( e.getCause().getMessage() ).matches( ".*OGM000067.*" );
.matches("^(notLegacy|legacy).*"); if (name.startsWith("legacy")) { assertThat(id)