Skip to content

Commit ab81bcd

Browse files
committed
added new update* tests
1 parent 4259123 commit ab81bcd

File tree

1 file changed

+7
-5
lines changed
  • container-registry/container-analysis/src/test/java/com/example/containeranalysis

1 file changed

+7
-5
lines changed

container-registry/container-analysis/src/test/java/com/example/containeranalysis/SamplesTest.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ public void testUpdateNote() throws Exception {
124124

125125
Note.Builder builder = Note.newBuilder(noteObj);
126126
builder.setShortDescription(descriptionText);
127-
Samples.updateNote(client, builder.build(), noteId, PROJECT_ID);
127+
Note returned = Samples.updateNote(client, builder.build(), noteId, PROJECT_ID);
128+
assertEquals(descriptionText, returned.getShortDescription());
128129

129130
Note updated = Samples.getNote(client, noteId, PROJECT_ID);
130131
assertEquals(descriptionText, updated.getShortDescription());
@@ -169,12 +170,13 @@ public void testUpdateOccurrence() throws Exception {
169170
d.setType(typeId);
170171
b.setVulnerability(d);
171172

172-
Samples.updateOccurrence(client, o.getName(), b.build());
173-
Occurrence o2 = Samples.getOccurrence(client, o.getName());
174-
assertEquals(typeId, o2.getVulnerability().getType());
173+
Occurrence returned = Samples.updateOccurrence(client, o.getName(), b.build());
174+
assertEquals(typeId, returned.getVulnerability().getType());
175+
Occurrence got = Samples.getOccurrence(client, o.getName());
176+
assertEquals(typeId, got.getVulnerability().getType());
175177

176178
//clean up
177-
Samples.deleteOccurrence(client, o2.getName());
179+
Samples.deleteOccurrence(client, o.getName());
178180
}
179181

180182
@Test

0 commit comments

Comments
 (0)