@@ -98,19 +98,24 @@ public void testUrlsRequireAuthentication() throws Exception {
9898 @ Transactional
9999 public void smokeTestStream () throws Exception {
100100
101- final View view = viewTestTools .createView ("TestView" );
101+ final View view = viewTestTools .createView ("TestView-" + System . currentTimeMillis () );
102102
103- // Hit the stream page for specified view.
104- mockMvc
105- .perform (get ("/stream/" + view .getId ())
106- .with (user (adminUserDetails )))
107- //.andDo(print())
108- .andExpect (status ().isOk ())
109- // Contains some basic text
110- .andExpect (content ().string (containsString (view .getName ())))
111- .andExpect (content ().string (containsString (view .getTopic ())))
112- .andExpect (content ().string (containsString ("Switch to View" )))
113- .andExpect (content ().string (containsString ("href=\" /view/" + view .getId () + "\" " )));
103+ try {
104+ // Hit the stream page for specified view.
105+ mockMvc
106+ .perform (get ("/stream/" + view .getId ())
107+ .with (user (adminUserDetails )))
108+ //.andDo(print())
109+ .andExpect (status ().isOk ())
110+ // Contains some basic text
111+ .andExpect (content ().string (containsString (view .getName ())))
112+ .andExpect (content ().string (containsString (view .getTopic ())))
113+ .andExpect (content ().string (containsString ("Switch to View" )))
114+ .andExpect (content ().string (containsString ("href=\" /view/" + view .getId () + "\" " )));
115+ } finally {
116+ // Cleanup.
117+ viewRepository .delete (view );
118+ }
114119 }
115120
116121 /**
@@ -137,7 +142,7 @@ public void shouldReceiveAMessageFromTheServer() throws Exception {
137142
138143 // Create view
139144 final View view = viewTestTools
140- .createViewWithCluster ("TestView" , cluster );
145+ .createViewWithCluster ("TestView-" + System . currentTimeMillis () , cluster );
141146
142147 // Sanity test, no enforced partitions
143148 assertEquals ("Partitions Property should be empty string" , "" , view .getPartitions ());
0 commit comments