(t *testing.T)
| 102 | } |
| 103 | |
| 104 | func TestLogRequest(t *testing.T) { |
| 105 | type args struct { |
| 106 | level logrus.Level |
| 107 | reqType RequestType |
| 108 | req api.PayloadRequest |
| 109 | params []string |
| 110 | } |
| 111 | tests := []struct { |
| 112 | name string |
| 113 | args args |
| 114 | want string |
| 115 | }{ |
| 116 | { |
| 117 | name: "Request missing", |
| 118 | args: args{ |
| 119 | level: logrus.DebugLevel, |
| 120 | reqType: Register, |
| 121 | }, |
| 122 | want: "", |
| 123 | }, |
| 124 | { |
| 125 | name: "Register certification target", |
| 126 | args: args{ |
| 127 | level: logrus.DebugLevel, |
| 128 | reqType: Register, |
| 129 | req: &orchestrator.RegisterCertificationTargetRequest{ |
| 130 | CertificationTarget: &orchestrator.CertificationTarget{}, |
| 131 | }, |
| 132 | }, |
| 133 | want: "level=debug msg=CertificationTarget registered.\n", |
| 134 | }, |
| 135 | |
| 136 | { |
| 137 | name: "Register certification target", |
| 138 | args: args{ |
| 139 | level: logrus.DebugLevel, |
| 140 | reqType: Register, |
| 141 | req: &orchestrator.RegisterCertificationTargetRequest{ |
| 142 | CertificationTarget: &orchestrator.CertificationTarget{Id: testdata.MockCertificationTargetID1}, |
| 143 | }, |
| 144 | }, |
| 145 | want: "level=debug msg=CertificationTarget with ID '11111111-1111-1111-1111-111111111111' registered.\n", |
| 146 | }, |
| 147 | { |
| 148 | name: "Create AuditScope", |
| 149 | args: args{ |
| 150 | level: logrus.DebugLevel, |
| 151 | reqType: Update, |
| 152 | req: &orchestrator.UpdateAuditScopeRequest{ |
| 153 | AuditScope: &orchestrator.AuditScope{ |
| 154 | CertificationTargetId: testdata.MockCertificationTargetID1, |
| 155 | CatalogId: testdata.MockCatalogID, |
| 156 | }, |
| 157 | }, |
| 158 | }, |
| 159 | want: "level=debug msg=AuditScope updated for Certification Target '11111111-1111-1111-1111-111111111111'.\n", |
| 160 | }, |
| 161 | { |
nothing calls this directly
no test coverage detected