This is an automated email from the ASF dual-hosted git repository.

ccondit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 9e107467 [YUNIKORN-2859] Add missing assertion in 
TestGetApplicationHandler (#965)
9e107467 is described below

commit 9e107467c867f3c10bddba1db1b8923415684958
Author: ryankert <[email protected]>
AuthorDate: Tue Sep 10 15:38:47 2024 -0500

    [YUNIKORN-2859] Add missing assertion in TestGetApplicationHandler (#965)
    
    Closes: #965
    
    Signed-off-by: Craig Condit <[email protected]>
---
 pkg/webservice/handlers_test.go | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/pkg/webservice/handlers_test.go b/pkg/webservice/handlers_test.go
index 03edae71..45f7669b 100644
--- a/pkg/webservice/handlers_test.go
+++ b/pkg/webservice/handlers_test.go
@@ -1741,12 +1741,10 @@ func TestGetApplicationHandler(t *testing.T) {
        getApplication(resp, req)
        err = json.Unmarshal(resp.outputBytes, &appsDao)
        assert.NilError(t, err, unmarshalError)
-
-       if !appsDao.HasReserved {
-               assert.Equal(t, len(appsDao.Reservations), 0)
-       } else {
-               assert.Check(t, len(appsDao.Reservations) > 0, "app should have 
at least 1 reservation")
-       }
+       assert.Equal(t, appsDao.ApplicationID, "app-1")
+       assert.Equal(t, appsDao.Partition, "default")
+       assert.Equal(t, appsDao.QueueName, "root.default")
+       assert.Equal(t, len(appsDao.Allocations), 0)
 
        // test nonexistent partition
        var req1 *http.Request
@@ -1781,6 +1779,11 @@ func TestGetApplicationHandler(t *testing.T) {
        getApplication(resp4, req4)
        err = json.Unmarshal(resp4.outputBytes, &appsDao4)
        assert.NilError(t, err, unmarshalError)
+       assert.Assert(t, appsDao4 != nil)
+       assert.Equal(t, appsDao4.ApplicationID, "app-1")
+       assert.Equal(t, appsDao4.Partition, "default")
+       assert.Equal(t, appsDao4.QueueName, "root.default")
+       assert.Equal(t, len(appsDao4.Reservations), 0)
 
        // test invalid queue name
        var req5 *http.Request


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to