@@ -36,18 +36,18 @@ public void testList () {
3636 Document doc = new Document ();
3737 AtomicReference <Throwable > error = new AtomicReference <>();
3838
39- doc .append ("name" ,"TestProject1 " ).append ("creation" , new Date ());
39+ doc .append ("name" ,"TestData1 " ).append ("creation" , new Date ());
4040 removeEntities (entityName );
4141 removeEntities (otherEntityName );
4242 getEntities (entityName ).insertOne (doc ).onFailure ().invoke (throwable -> {
4343 error .set (throwable );
4444 }).await ().atMost (Duration .ofSeconds (10 ));
45- doc .put ("name" ,"TestProject2 " );
45+ doc .put ("name" ,"TestData2 " );
4646 doc .remove ("_id" );
4747 getEntities (entityName ).insertOne (doc ).onFailure ().invoke (throwable -> {
4848 error .set (throwable );
4949 }).await ().atMost (Duration .ofSeconds (10 ));
50- doc .put ("name" ,"OtherTestProject " );
50+ doc .put ("name" ,"OtherData " );
5151 doc .remove ("_id" );
5252 getEntities (otherEntityName ).insertOne (doc ).onFailure ().invoke (throwable -> {
5353 error .set (throwable );
@@ -58,10 +58,10 @@ public void testList () {
5858
5959 Assertions .assertNull (isError , "Error writing test data to Mongo " +errorMessage );
6060 given ().accept (ContentType .JSON ).when ().get ("/{entityName}" ,entityName ).then ().statusCode (HttpStatus .SC_OK )
61- .body ("[0].name" , Matchers .equalTo ("TestProject1 " )).body ( "[1].name" , Matchers .equalTo ("TestProject2 " ) );
61+ .body ("[0].name" , Matchers .equalTo ("TestData1 " )).body ( "[1].name" , Matchers .equalTo ("TestData2 " ) );
6262
6363 given ().accept (ContentType .JSON ).when ().get ("/{entityName}" ,otherEntityName ).then ().statusCode (HttpStatus .SC_OK )
64- .body ("[0].name" , Matchers .equalTo ("OtherTestProject " ) );
64+ .body ("[0].name" , Matchers .equalTo ("OtherData " ) );
6565 }
6666
6767 @ Test
@@ -70,15 +70,15 @@ public void testCreateAndRead () {
7070
7171 removeEntities (entityName );
7272 Document resp = given ().contentType (ContentType .JSON ).accept (ContentType .JSON ).body ("{" +
73- "\" name\" :\" PrjCreated1 \" ," +
73+ "\" name\" :\" DataCreated1 \" ," +
7474 "\" creation\" :\" 2021-03-04\" " +
7575 "}" ).when ().post ("/{entityName}" , entityName ).then ().statusCode (HttpStatus .SC_OK )
7676 .body ("_id" , Matchers .notNullValue () )
7777 .and ().extract ().as (Document .class );
7878
7979
8080 given ().accept (ContentType .JSON ).when ().get ("/{entityName}/{entityId}" ,entityName , resp .get ("_id" ).toString ()).then ().statusCode (HttpStatus .SC_OK )
81- .body ("name" , Matchers .is ("PrjCreated1 " ));
81+ .body ("name" , Matchers .is ("DataCreated1 " ));
8282 }
8383
8484 @ Test
@@ -94,27 +94,28 @@ public void testCompleteFlow () {
9494
9595 removeEntities (entityName );
9696 Document created = given ().contentType (ContentType .JSON ).accept (ContentType .JSON ).body ("{" +
97- "\" name\" :\" PrjCreated2 \" ," +
97+ "\" name\" :\" DataCreated2 \" ," +
9898 "\" creation\" :\" 2021-05-05\" " +
9999 "}" ).when ().post ("/{entityName}" , entityName ).then ().statusCode (HttpStatus .SC_OK )
100100 .body ("_id" , Matchers .notNullValue () )
101101 .and ().extract ().as (Document .class );
102102 String entityId = created .get ("_id" ).toString ();
103103
104104 given ().accept (ContentType .JSON ).when ().get ("/{entityName}/{entityId}" , entityName , entityId ).then ().statusCode (HttpStatus .SC_OK )
105- .body ("name" , Matchers .is ("PrjCreated2 " ));
105+ .body ("name" , Matchers .is ("DataCreated2 " ));
106106
107107 Document updated = given ().contentType (ContentType .JSON ).accept (ContentType .JSON ).body ("{" +
108108 "\" _id\" :\" " +entityId +"\" ," +
109- "\" name\" :\" PrjUpdated2 \" ," +
109+ "\" name\" :\" DataUpdated2 \" ," +
110110 "\" creation\" :\" 2021-06-07\" " +
111111 "}" ).when ().put ("/{entityName}/{entityId}" ,entityName , entityId ).then ().statusCode (HttpStatus .SC_OK )
112112 .body ("_id" , Matchers .notNullValue () )
113113 .and ().extract ().as (Document .class );
114114 Assertions .assertEquals (entityId , updated .get ("_id" ).toString ());
115+ Assertions .assertEquals ("DataUpdated2" , updated .get ("name" ));
115116
116117 given ().accept (ContentType .JSON ).when ().get ("/{entityName}/{entityId}" ,entityName , entityId ).then ().statusCode (HttpStatus .SC_OK )
117- .body ("name" , Matchers .is ("PrjUpdated2 " ))
118+ .body ("name" , Matchers .is ("DataUpdated2 " ))
118119 .body ("_id" , Matchers .equalTo (created .get ("_id" )));
119120
120121 given ().accept (ContentType .JSON ).when ().delete ("/{entityName}/{entityId}" ,entityName , entityId ).then ().statusCode (HttpStatus .SC_OK );
0 commit comments