Skip to content

Commit

Permalink
Add test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikaël Francoeur committed Nov 28, 2023
1 parent bf63f4d commit 510a36a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (c) 2023 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.java21;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.spy;

import java.util.List;

import org.junit.Test;

public class RecordTest {

@Test
public void given_list_is_already_spied__when_spying_record__then_record_fields_are_correctly_populated() {
var ignored = spy(List.of());

record MyRecord(String name) {
}
MyRecord spiedRecord = spy(new MyRecord("something"));

assertThat(spiedRecord.name()).isEqualTo("something");
}
}

0 comments on commit 510a36a

Please sign in to comment.