From 032a2420ab03e8d43035ab9f480ad113cae80950 Mon Sep 17 00:00:00 2001 From: alesstimec Date: Mon, 9 Oct 2023 16:14:09 +0200 Subject: [PATCH] Fixes GetApplicationOfferConsumeDetails. --- internal/jimm/applicationoffer.go | 2 +- internal/jujuapi/applicationoffers_test.go | 2 -- internal/jujuclient/applicationoffers_test.go | 7 +------ 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/internal/jimm/applicationoffer.go b/internal/jimm/applicationoffer.go index fa7dade20..a057d54d7 100644 --- a/internal/jimm/applicationoffer.go +++ b/internal/jimm/applicationoffer.go @@ -224,7 +224,7 @@ func (j *JIMM) GetApplicationOfferConsumeDetails(ctx context.Context, user *open } defer api.Close() - if err := api.GetApplicationOfferConsumeDetails(ctx, names.NewUserTag(user.Username), details, v); err != nil { + if err := api.GetApplicationOfferConsumeDetails(ctx, names.NewUserTag("admin"), details, v); err != nil { return errors.E(op, err) } diff --git a/internal/jujuapi/applicationoffers_test.go b/internal/jujuapi/applicationoffers_test.go index 8370f8d84..2fd97ced5 100644 --- a/internal/jujuapi/applicationoffers_test.go +++ b/internal/jujuapi/applicationoffers_test.go @@ -85,8 +85,6 @@ func (s *applicationOffersSuite) TestOffer(c *gc.C) { } func (s *applicationOffersSuite) TestGetConsumeDetails(c *gc.C) { - // NOTE (alesstimec): remove the skip once that is fixed in juju - c.Skip("JUJU_GET_CONSUME_DETAILS") conn := s.open(c, nil, "bob@external") defer conn.Close() client := applicationoffers.NewClient(conn) diff --git a/internal/jujuclient/applicationoffers_test.go b/internal/jujuclient/applicationoffers_test.go index bc30bd3e3..219c3fc5e 100644 --- a/internal/jujuclient/applicationoffers_test.go +++ b/internal/jujuclient/applicationoffers_test.go @@ -699,8 +699,6 @@ func (s *applicationoffersSuite) TestDestroyApplicationOffer(c *gc.C) { } func (s *applicationoffersSuite) TestGetApplicationOfferConsumeDetails(c *gc.C) { - // NOTE (alesstimec): remove the skip once that is fixed in juju - c.Skip("JUJU_GET_CONSUME_DETAILS") modelState, err := s.StatePool.Get(s.modelInfo.UUID) c.Assert(err, gc.Equals, nil) defer modelState.Release() @@ -741,7 +739,7 @@ func (s *applicationoffersSuite) TestGetApplicationOfferConsumeDetails(c *gc.C) info.Offer = &jujuparams.ApplicationOfferDetails{ OfferURL: offerURL.String(), } - err = s.API.GetApplicationOfferConsumeDetails(ctx, names.NewUserTag("test-user@external"), &info, bakery.Version2) + err = s.API.GetApplicationOfferConsumeDetails(ctx, names.NewUserTag("admin"), &info, bakery.Version2) c.Assert(err, gc.Equals, nil) c.Check(info.Offer.OfferUUID, gc.Not(gc.Equals), "") info.Offer.OfferUUID = "" @@ -770,9 +768,6 @@ func (s *applicationoffersSuite) TestGetApplicationOfferConsumeDetails(c *gc.C) UserName: auth.Everyone, DisplayName: "", Access: "read", - }, { - UserName: "test-user@external", - Access: "admin", }}, }, ControllerInfo: &jujuparams.ExternalControllerInfo{