generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(refactor): code styling (#852)
- Loading branch information
Showing
13 changed files
with
53 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -287,21 +287,21 @@ func TestV2Client_BrowserLogin(t *testing.T) { | |
srv := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | ||
if r.Method == "GET" { | ||
_, _ = w.Write([]byte("{\"loginId\":\"login.id\",\"subdomainRequired\":false}")) | ||
} else if strings.Contains(r.URL.Path, "/login.id"){ | ||
} else if strings.Contains(r.URL.Path, "/login.id") { | ||
|
||
res, _ := io.ReadAll(r.Body) | ||
|
||
idp := strings.Split(strings.Split(string(res), ",")[0], ":")[1] | ||
if idp == "\"\"" { | ||
idp = "accounts.sap.com" | ||
} else { | ||
idp = "customidp.accounts.ondemand.com" | ||
} | ||
|
||
w.Header().Add("HeaderCLISessionId", "sessionid") | ||
w.WriteHeader(http.StatusOK) | ||
|
||
_, _ = w.Write([]byte("{\"issuer\":\""+idp+"\",\"refreshToken\":\"sessionid\",\"user\":\"john.doe\",\"mail\":\"[email protected]\"}")) | ||
_, _ = w.Write([]byte("{\"issuer\":\"" + idp + "\",\"refreshToken\":\"sessionid\",\"user\":\"john.doe\",\"mail\":\"[email protected]\"}")) | ||
} else { | ||
w.WriteHeader(http.StatusForbidden) | ||
} | ||
|
@@ -334,15 +334,15 @@ func TestV2Client_BrowserLogin(t *testing.T) { | |
}, | ||
}, uut.session) | ||
}) | ||
|
||
t.Run("happy path - with custom idp", func(t *testing.T) { | ||
uut := NewV2ClientWithHttpClient(srv.Client(), srvUrl) | ||
uut.session = &Session{} | ||
uut.newCorrelationID = func() string { | ||
return "fake-correlation-id" | ||
} | ||
_, err := uut.BrowserLogin(context.TODO(), &BrowserLoginRequest{ | ||
CustomIdp: "my.custom.idp", | ||
CustomIdp: "my.custom.idp", | ||
GlobalAccountSubdomain: "my-subdomain", | ||
}) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters