Skip to content

Commit

Permalink
Fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Clayton Walker committed Jan 23, 2024
1 parent 440bd48 commit f386100
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,26 +155,26 @@ public void testObtainBaseImageLayers_skipObtainingDuplicateLayers()

@Test
public void testIsImagePushed_skipExistingEnabledAndManifestPresent() {
Optional<ManifestAndDigest<ManifestTemplate>> manifestResult = Mockito.mock(Optional.class);
Mockito.when(manifestResult.isPresent()).thenReturn(true);
@SuppressWarnings("unchecked")
Optional<ManifestAndDigest<ManifestTemplate>> manifestResult =
Optional.of(Mockito.mock(ManifestAndDigest.class));
System.setProperty(JibSystemProperties.SKIP_EXISTING_IMAGES, "true");

Assert.assertFalse(stepsRunner.isImagePushed(manifestResult));
}

@Test
public void testIsImagePushed_skipExistingImageDisabledAndManifestPresent() {
Optional<ManifestAndDigest<ManifestTemplate>> manifestResult = Mockito.mock(Optional.class);
Optional<ManifestAndDigest<ManifestTemplate>> manifestResult = Optional.empty();
System.setProperty(JibSystemProperties.SKIP_EXISTING_IMAGES, "false");

Assert.assertTrue(stepsRunner.isImagePushed(manifestResult));
}

@Test
public void testIsImagePushed_skipExistingImageEnabledAndManifestNotPresent() {
Optional<ManifestAndDigest<ManifestTemplate>> manifestResult = Mockito.mock(Optional.class);
Optional<ManifestAndDigest<ManifestTemplate>> manifestResult = Optional.empty();
System.setProperty(JibSystemProperties.SKIP_EXISTING_IMAGES, "true");
Mockito.when(manifestResult.isPresent()).thenReturn(false);

Assert.assertTrue(stepsRunner.isImagePushed(manifestResult));
}
Expand Down

0 comments on commit f386100

Please sign in to comment.